3 ms·
I'd like to see that or maybe try it myself but that's not quite the same as Forth fitting in a 512 byte boot sector[1] or on a tinyAVR. I bet it can be done bu
by guerrilla 6y ago
I'd like to see that or maybe try it myself but that's not quite the same as Forth fitting in a 512 byte boot sector[1] or on a tinyAVR. I bet it can be done but I suspect it'd require more cleverness than doing the same with Forth.
1. https://news.ycombinator.com/item?id=24604457 https://news.ycombinator.com/item?id=24604457
- pjmlp 6y agoPeople tend to forget that Lisp was originally developed on an IBM 704, written in Assembly, with the traditional size a 1950 machine filling a server room was capable of, which was just a few KB. While not the same thing, you can have a look at http://www.ulisp.com/ http://www.ulisp.com/ for AVR.
- dreamcompiler 6y agoAll the original compilers like Lisp and Fortran were written in assembler. But that doesn't mean it was easy, or that the resulting language was very capable by modern standards. The thing about Forth is that it is easy, and you get a full-featured Forth when you're done. That's not to say it can't be done in Lisp but Lisp needs a lot more runtime support than Forth. If I was going to bootstrap a Lisp, I'd bootstrap a Forth first and then write the garbage collector for Lisp in Forth.
- kazinator 6y agoWriting primitives like cons, car and cdr in assembler, a garbage collector in assembler, and eval in assembler would make a great amount of sense, from a performance and bootstrapping POV. A Lisp compiler in assembler is just about rationally unjustifiable, though.