Hacker News new | past | comments | ask | show | jobs | submit login
Scheme from Scratch - Bootstrap v0.1 - Integers (michaux.ca)
29 points by mnemonik on Jan 6, 2010 | hide | past | favorite | 3 comments

Resonant for me:

"I remember a time when I thought only super-humans could implement an interpreter but a naive interpreter like this one is really just a matter of putting one foot in front of the next."

I too thought interpreters were arcane and mystical, until a year or so ago I just tried writing one. Mine was also for Scheme, although I cheated because my implementation language was Common Lisp (I was learning it and wanted a toy project to work on). By the end of a plane flight from the UK to Australia I had a minimal working Scheme, with functions, recursion, lexical scope and closures.

I didn't go on to turn it into a bytecode interpreter or a compiler - I didn't even get tail calls working right - but I'm confident that if I'd wanted to, they would also have turned out not to be as hard as I previously thought. I scratched the itch, and it was easy and fun.

I don't think this pattern is unique to programming, and there's probably a lesson to learn. Something you want to do - but don't because you think it's hard - probably isn't hard, so why not try it?

I'm no C programmer, but I love how clean the code is. Good work!

What is with the weird Music comment at th end of scheme.c?

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