Essentials of Interpretation
dmitrysoshnikov.com
dmitrysoshnikov.com
So first of all, thank you for creating that course about garbage collection. The videos that I've watched from it so far were interesting and informative to me. (I've completed 71% according to Udemy but I must admit that I sometimes watched videos as I was going to bed and may not have been fully attentive at all times.)
Secondly, a small suggestion for improvement based on the first course: Since each piece is relatively short, it quickly becomes quite tiring that each and every video begins with a ~15 second long intro animation, most of which is just repeating the title of the course. I would skip that all together and make the transition 2 seconds long at most. Just enough to read what the topic of the current video is.
Lots of optimization passes, even, are relatively obvious (not necessarily trivial, but they make sense) - to my eye at least, the Voodoo magic is in the scheduling and code generation
And if you want to just generate byetecode doesn't Truffle on Java do that far better than DLR? Truffle seemed to actually achieve what DLR promised but never really managed - genuine support for dynamic languages on .NET/JVM.
Yes, for the code generation one needs to well understand semantics of the target language. And when it's a low-level language (Assembly), the "voodoo magic" mainly relates to generic understanding of the lower-level architectures. However, there might be compilation to another high-level language (in case of a transpiler), and by itself code generation at this stage is not that hard, simply because a target language is more understood in this case.
Instruction selection topic, and where to place the data -- on the stack, or into registers (and how a register allocator works) also mainly relates to the lower-level.
> until you get into the backend
Yes, and that's why I think it should be a separate class, specifically for higher-level compilation, and a low-level compilation.
We'll be covering this in "Essentials of Compilation".
The multi-paradigm nature of JS, with its first-class functions, closures, static scope semantics, class-based and prototype-based inheritance fits the best to study semantics of programming languages -- and all these concepts we implement in the course.
For low-level bytecode interpreter there will be a C++ implementation.
Unfortunately besides functional programming languages (Haskell, OCaml, etc) or modern languages (such as Rust), there are few having these features, and JavaScript is no exception. Of course you can use a poor man's substitute such as the Visitor pattern, but it's quite a hassle without a direct language support.
While this is undoubtedly strictly true, it seems so high-level that the same could be said of essentially any programming task, with I/O suitably modelled, and so gets awfully close to "the C language is purely functional" (http://conal.net/blog/posts/the-c-language-is-purely-functio...).
People think about compilers as being systems code but it’s the opposite. It’s the web and business code that’s a nest of state and dependencies on systems.
Compilers are just numbers in numbers out.