http://qs321.pair.com?node_id=11110497


in reply to Assembly language

There is an interesting connection between perl and assembly as jcb already noted. Yes, perl is implemented in C, but its runtime makes a syntax tree or execution stack out of the program it runs, which looks like a baroque FORTH engine. This old language also has an interpreter and compiler built in, and is a macro language for assembly (which in turn is a macro language for machine code).

One could say that "perl is to C what FORTH is to assembly". The major difference is that FORTH passes its parameters on the stack, while C makes heavy use of registers - which could also be done by FORTH at compilation of new FORTH words, given its capabilities of introspection.

When I retire, I might (if I have still interest in that sort of stuff, that is) tackle an implementation of perl in FORTH, create a perl CPU and die rich. Hah!

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'