R User to Runtime Engineer
This path is for R users who write code daily and want to know how the R runtime executes it. It needs no C or compiler knowledge. You already use functions, vectors and environments; the path follows each one down into the C runtime underneath, and ends with why parallel R is hard.
How R Executes Code Today. This orients you on what happens when the interpreter runs a line of R.
How R Executes Code. This teaches the mechanics of parsing, compilation, and evaluation at the runtime level.
R Objects. Every R value is an object that carries its type and its attributes, and the runtime represents all of them the same way.
SEXPs. In C, every R object is reached through a SEXP, a pointer to the object’s header and data. Most of the runtime pages build on this one.
Environments. Environments bind names to values, and variable lookup walks a chain of them.
Closures. Functions capture their defining environment. This is how lexical scoping works at runtime.
Promises and Lazy Evaluation. R delays argument evaluation. The runtime implements this with promise objects.
Garbage Collection. The runtime must reclaim memory. The garbage collector finds unreachable objects and frees them.
Why R Is Difficult to Parallelize. How each of these mechanisms gets in the way once R code runs in parallel.
From here, threaded-r and r-in-rust show two answers: the apartment model inside GNU R, and an interpreter in Rust with no global mutable state in the interpreter.