|
|
|
|
|
by rs23296008n1
2339 days ago
|
|
Didn't C++ start out as a set of hacks on C? Fairly sure it was originally a preprocess stage ahead of an ordinary c compiler. Raises the question of how usefully far you can make C twist using macros / preprocessor. Candidates like Forth or Lisp seem possible. A few weekends at most. Might need to take a few liberties. Python... Perhaps if you implement a less dynamic subset? Duck typing may trip you up. To what extent? What about Elixir? |
|
Code in the interpreter is directly converted to byte code, e.g. the macro Car generates the virtual machine instruction Car, rather than executing the code for car. The alternative would have been to generate byte code by hand, would have been error-prone. Here's the code for cons and let:
It is actually C, with heavy use of macros. But it can be read as Reverse Polish Lisp. It can also be thought of as a Lispy Forth.