Re:'Dynamic' assembler with GC
by pmjordan on Friday August 21, 2009 @10:02AM
(#777524)
I have often wondered what it would be like to have an "all-levels" Lisp-like language. Start with a bootstrapping reader that attaches to a minimal assembler that generates bytecode from the S-expressions. Then build progressively higher levels onto that until you have a "proper" lisp system, except you can drop to a lower level anytime and hack the depths of it when you need to.
[ Parent
| on HN ]
Re:'Dynamic' assembler with GC
by silentbicycle on Friday August 21, 2009 @11:09AM
(#777665)
Have you ever looked at Forth? It's postfix and stack-based, but is exactly what you want from the standpoint of bootstrapping from next-to-nothing and getting a high-level language.
Here's thoroughly documented source for a Forth interpreter (http://www.annexia.org/forth) in i386 assembly.
Check this out:
http://piumarta.com/software/cola/
Brilliant, thanks. I'll have to have a play with that.
While you're at it, check out http://piumarta.com/ ;)
Indeed. The peg parser generator is quite nice:
http://piumarta.com/software/peg/
I recently used it to implement an s-expression reader: http://zwizwa.be/darcs/libprim/ex/sexp.leg
(It's incomplete, but it illustrates the principle: peg parsing is very nice for quick & dirty parsing work.)