Python: Writing a Compiler and Interpreter in 160 lines of code

Python: Writing a Compiler and Interpreter in 160 lines of code

I started experimenting with Python a few weeks ago. As a learning project I set myself the task of writing a compiler and interpreter for a simple ‘while’ language. I was very please with the result. Writing Python is like a dream. The work flow goes like this: think of the problem you want to solve, try a solution in the top level eval loop, if doesn’t work, try something else, if it works, put it in your module. With the built in lists, tuples, and dictionaries, thought turns into code with a minimum of friction. All I can say is WOW!

Read More:

http://www.jroller.com/languages/entry/python_writing_a_compiler_and 

Thanks

Leave a Reply

You must be logged in to post a comment.