Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Python: Writing a Compiler and Interpreter in 160 lines of code (jroller.com)
23 points by davatk on June 20, 2008 | hide | past | favorite | 8 comments


Nice code, but that's not a compiler.


Indeed. And, given the "XX in less than YY lines of code" framing of the title, I was actually hoping for something a little more along the lines of clever code. This this is a pretty pedestrian interpreter, honestly. It's not bad code, just ... exactly what I would expect an interpreter for a tiny language to look like.


Agreed. It's a nice college freshman first project.


Hmm, a compiler it may not be, but I doubt many college freshmen could do this as a first project.


The final project for everyone in my intro course was to write a LISP interpreter. Have we fallen so far?


Terrific example for people that want to understand how interpreters work.

Not perfect. But perfect for getting your feet wet.


Wonder why comments are closed for the article?


probably spam




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

Search: