Hacker News new | past | comments | ask | show | jobs | submit login
Writing a language in 15 minutes (jcoglan.com)
28 points by ionfish on June 1, 2009 | hide | past | favorite | 4 comments



I didn't actually watch the whole video but eh do we really need to keep re-inventing the wheel so that there can be yet another [insert language] interpreter?

Scheme has a natural tree structure to exploit anyhow, show me a C++ interpreter in 15 minutes and I'll be impressed ;)


eh do we really need to keep re-inventing the wheel so that there can be yet another [insert language] interpreter?

As an exercise, yes! If you've tinkered with the insides of something, it often makes you a better user of it. If you've written a compiler for a language with arrays, you'll understand what's going on with things like a[5] and 5[a] in C. You'll understand calling conventions and have a good feel for what it costs for language X to call language Y. You'll see how stacks are used to implement things like lexical scoping.

Maybe I'm preaching to the choir. But if I am, then let other people have the fun too! They should be congratulated.


I agree. As (the genius) Richard Feynmann stated, "What I cannot create, I do not understand". Reinventing the wheel can be a very illuminating thing,if you choose carefully what wheels to reinvent.


Lisp (and Scheme) has no syntax. Lisp code is Abstract Syntax Tree, which is written in text form. AST is intermediate form used by compilers or interpreters.

You can use XML or JSON to represent AST. You can write interpreter for AST representations in these formats very fast too. But somebody else need to write parser from language with real syntax into AST.

JavaScript is example of Scheme implementation with Java-like syntax. Write interpreter for this language in 15 minutes.




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

Search: