Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Lisp bytecode compiler

Name: Anonymous 2012-06-22 19:25

Am I missing any special forms?
lambda if setq let quote

I know let isn't really needed because it can be implemented in terms of lambda, but recognizing ((lambda ...) ...) sounds more confusing than just using let.

Name: Anonymous 2012-06-23 1:19

>>12
A LISP program is just a program, and any chunk of machine code that represents a program equivalent to the LISP program can be a potential output of the compiler. One method could be to take a regular lisp interpreter, iterate through all bit sequences, run the bit sequence against all possible inputs to the program, and compare the output to the LISP program running in a slow interpreter. Keep the binary sequences that scores the highest in terms of some desired combination of memory usage, speed, and code size. And there you go. An optimal LISP compiler. The only draw back that there might be is maybe LISP as a language is just too expressive, and any trivial LISP program ends up being able to elegantly handle too many inputs, and forces the compiler to handle more meaningful input cases and decrease overall efficiency.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List