Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I feel like writing a LISP in a gc'ed language is taking away most of the fun of it.

Try telling Rich Hickey that. There's also Kawa and Armed Bear Common Lisp running on the JVM.

If you write your interpreter in a non-garbage-collected language (e.g. C), you should use an explicitly declared stack for arguments, and have argument-free functions. Also, for functions which might call the garbage collector, you can't store any garbage collectable data in local variables either. It might be possible to have your garbage collector access the C call stack, but I wouldn't recommend that.

Three decades ago, my first attempt at implementing a Lisp interpreter in Pascal fell foul of this problem and occasionally recycled lists which were still in use. I soon figured out what was happening. I decided to replace the interpreter with a virtual machine and a compiler (and also a source-code interpreter for bootstrapping and the REPL), and I still use a descendent of this.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: