When I started studying C++ a couple of years ago, a lot of the books and texts I read did a very thorough job of explaining, how the code written would translate into concrete operations in the hardware (like dynamically memory allocation, pointer arithmetics etc.). I found those explanations extremely helpful in order to fully understand the language.
Now I am studying JavaScript and learning about the whole functional programming paradigm, with functions as first class objects and so on. I have read a lot of texts and books about how to use JavaScript, but I have yet to come across a source, that explains the low-level inner workings of the language (like how a function is represented in memory, what excactly happens when a function is called with .apply() and a new context is provided etc.).
I guess you could say, that what I am looking for is the knowledge needed to write a JS compiler/VM..? How the runtime environments handle the different aspects of the language at a low level.
Does anyone know where to find books or text, that goes into the very low level details of the language?
1
Memory representation etc is implementation details specific for each js compiler. There is no right or wrong way to do it, as long as your implementation works as expected.
But what you are looking for is probably the ECMAScript specification, which is detailed enough.
If you’re interested in implementation details, I suggest you check out the various projects, such as Chromes’ V8 engine. It comes with code as well 🙂
There are no books about JavaScript Engines as far as I know.
1