
Implementing a Simple Compiler in 25 Lines of JavaScript - mgechev
https://github.com/mgechev/tiny-compiler
======
flavio81
tl;dr: it's a transpiler, not a compiler. The programning "language" only
supports four operations: Add, substract, multiply, and divide. On integers
only. No control flow operators. No parentheses to group expressions. No
possibility to define functions.

If it didn't have such a clickbaity title then it would make for a good,
educational reading.

~~~
ttd
If we're being pedantic, then it is a compiler. It's a compiler that targets
another high-level language instead of a lowered representation. Transpiler is
(in my opinion) a meaningless specialization of the word compiler.

The corresponding blog post ([http://blog.mgechev.com/2017/09/16/developing-
simple-interpr...](http://blog.mgechev.com/2017/09/16/developing-simple-
interpreter-transpiler-compiler-tutorial/)) does seem to be educational.

