Real Languages

Of course MUS and NOTE are just a toy example for demonstration purposes. Remember that MUS represents a high-level language while NOTE represents a lower-level language. JavaScript represents the lowest level machine code. The lower-level language NOTE above machine code is usually called a bytecode language.

Here are some examples of programming languages that use the patterns we just saw.

Interpret MUS Directly - In the wider world of programming, an example of a pure interpreter is the original 1960 LISP. Steve Russell wrote an implementation of eval for LISP, and so created the first interpreter for a high level language. It directly interpreted LISP abstract syntax trees (s-expressions).

Precompile MUS to NOTE, interpret NOTE - An example of a language that uses this strategy is UCSD Pascal. The Pascal program is precompiled into p-code, which is then interpreted on the target machine.

Online compile MUS to NOTE, interpret NOTE - Lua uses this strategy. Source code is parsed and compiled into bytecode as needed, then the bytecode is interpreted on the target.

The point of all this is to demonstrate that there are lots of permutations and ways to link things together. It's not just a question of "interpreter or compiler". The other interesting point is that if the compilers and interpreters are written in JavaScript, we have the option of putting them on our webpages. That's incredibly exciting.

Prev Next