News for hackers. Stuff that matters.
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.
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.

Re:'Dynamic' assembler with GC by doelie_ on Friday August 21, 2009 @10:16AM (#777550)
Re:'Dynamic' assembler with GC by pmjordan on Friday August 21, 2009 @10:19AM (#777555)
Brilliant, thanks. I'll have to have a play with that.
Re:'Dynamic' assembler with GC by andreyf on Friday August 21, 2009 @11:19AM (#777690)
While you're at it, check out http://piumarta.com/ ;)
Re:'Dynamic' assembler with GC by doelie_ on Friday August 21, 2009 @11:52AM (#777752)
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.)