Wikipedia:Reference desk/Archives/Computing/2016 August 10
Computing desk | ||
---|---|---|
< August 9 | << Jul | August | Sep >> | August 11 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
August 10
editSuccinct LISP implementation?
editIs it true that LISP can be implemented or defined in two pages? If yes, where can I find these two pages?Hofhof (talk) 00:08, 10 August 2016 (UTC)
- You can implement a tiny dialect with enough features to write nontrivial programs: here's one in a couple of pages of Python. You can't implement or define a standard dialect (Common Lisp or Scheme) in that space, except with very tiny type or maybe with a meta-circular evaluator that delegates most functionality to another implementation. -- BenRG (talk) 03:57, 10 August 2016 (UTC)
- Little Schemer had a toy meta-circular evaluator. Actually, every lisp book discusses one, and this is what the "one or two pages" refers to. Lisp is very homoiconic, that is, a lisp program is just another sexp. A lisp evaluator just reads in lists, looks up atoms and applies functions (the car of the list) to arguments (the rest.) This doesn't mean a serious implementation, especially in something like C, can't be hundreds of thousands of lines of code. Whatsmore, due to stuff like reader macros where the program can actually re-program the reader itself, lisp is not context-free and only a full lisp implementation can parse arbitrary lisp. Asmrulz (talk) 05:24, 10 August 2016 (UTC)