It took a while, but finally I got working on my little Nintendo DS lisp dialect. At the end of the summer I read through all but the last few chapters of the excellent Lisp in Small Pieces and the Scheme compiling chapters of PAIP. Then I made the mistake of coding with the PAIP stuff still fresh in my mind. I ended up with the part which compiles lisp expressions to intermediate representation/pseudo opcode looking to much like the one in the aforementioned book.
Much more fun was going from that pseudo opcode to something that computes your results. I figured i'd first write an interpreter to get to grips with whats involved and then do the DS backend in assembler.
The interpreter is quite straightforward if you don't go into simulating an actual computer to much. I had to fight that urge though. A bit into converting types to 32 bit words I thought it was getting ridiculous. So I broke off and left it by the wayside, while coding on to the desired goal.
And then... The magic moment... It doesn't just happen at once of course, but at one point you realize your implementation has got enough power to define (tail) recursive functions and properly behaving closures. With red cheeks of excitement I hobbled to my girl to tell her the exiting news. Five minutes of explaining later, the mounting frustration had cooled the excitement considerably. But a glimmer of pride remained. You can't break me that easily.
That would do for now on the interpreter front. Next goal: compiling into Arm opcode. Figured it would be best to start with the type system, however that would look like. Then, while writing my first bits of Arm code, I realized that I don't know how to program in assembly. Some months ago I actually coded the assemblER code to translate assembly statements into opcode, but now it's all gone. Out of the brain. Also I found out that that's not the same as knowing how to write assemblY code. I dunno, I'll figure it out.
Andrew Lentvorski has ported Gambit-C to the Nintendo DS; you may be interested.
The only information I have is on the Gambit mail list archives from October 2006 to January 2007:
Thanks. Yes i got tipped a few months ago about that one. Read you should be able to do some remote coding using a web interface. Interesting.
Never tried it though.
I've been considering writing a Lisp interpreter for ColdFire processors. I'm still trying to decide if I want an interpreter or a compiler. I keep leaning on interpreter.
I am currently considering trying to port Guile to an OSless system and using that as the interpreter.
Any thoughts? Feel free to ignore this, but your project interests me and I would like your opinion. =)
/jve (jev25 (A) calvin (dot) edu)
John, I sent you a mail,.. but I guess you know that by now. If not send me a mail and I'll send you a mail