good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Assembly languageby shmem (Chancellor) |
on Dec 22, 2019 at 00:53 UTC ( [id://11110497]=note: print w/replies, xml ) | Need Help?? |
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'
In Section
Seekers of Perl Wisdom
|
|