4 ms·
Thanks! Yes, we use JavaScript as the most popular language, however the code should be easily portable to any other language. The multi-paradigm nature of JS,
by DmitrySoshnikov 7y ago
Thanks! Yes, we use JavaScript as the most popular language, however the code should be easily portable to any other language.
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.
- hadcomplained 7y agoIMHO what is essential as a language feature for writing interpreters/compilers is algebraic data types and pattern matching on them, because they make things much easier when manipulating ASTs, which is a frequent task in implementing these programs. 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.
- DmitrySoshnikov 7y agoYes, good point on pattern matching and algebraic data types (initially I was actually considering Rust for implementation, but not OCaml). The visitor pattern is a classic though, and is transferable knowledge further, to process different kinds of graphs, trees, etc. BTW, JavaScript will likely be getting pattern matching soon as well.