Saturday, March 18, 2006

 

Simple lambda evaluator

I've just written a simple lambda calculus parser/evaluator in python - it has been rather fun! You can download it from laurasia. The code is rather raw, but comes with a money back guarantee ;-)

Updated: 28/March
An improved evaluator is now available. Note that the name of the evaluator code file has been changed from lambda.py to leval.py. This change was required since lambda is a reserved word in Python. I have also written a simple Lisp-ish front-end for the lambda evaluator - I'm calling this language elle. So far I've been able to calculate 3! (factorial) - all done using the Y combinator (of course!).

I gave a talk on Monday about the lambda calculus, and have put the powerpoint slides online. The talk went well. The main point that I wanted to get across was that there are alternative approaches for programming beyond the world of C, C++, and Java. But the audience wasn't too interested in the λ-calculus formalism, and maybe it would have been better to give a more practical talk focusing on a real functional programming language.






<< Home

This page is powered by Blogger. Isn't yours?