Lambda Calculus (interpreters)

LA home
Computing
 Algorithms
 Bioinformatics
 FP,  λ
 Logic,  π
 MML
 Prog.Langs

FP
 Lambda
  Syntax
  Introduction
  λ-Examples

Also see:
 PFL (|| λ)
 Prolog
Semantics

λ 2

There are lazy and strict versions of the toy lambda-calculus interpreter. They both share the same input syntax and can be used on the same example lambda-calculus programs, although some programs will not work (i.e. will loop) when using the strict interpreter of course.

  Lazy Interpreter Strict Interpreter
main programs Lazy.p Strict.p
declarations define values lazy.type.P <--
interpreters proper lazy.exec.P strict.exec.P
output lazy.show.P
(evaluation is print driven)
strict.show.P
expressions lazy.eval.p
(by-need evaluation)
strict.eval.P
(strict evaluation)
apply functions lazy.apply.P strict.apply.P
process declarations lazy.D.P strict.D.P
binary operators lazy.O.P <--
unary operators lazy.U.P strict.U.P
manipulate environments lazy.env.P strict.env.P
form basic values lazy.mkval.P <--
It is a useful exercise to compare the strict and lazy versions of the above files, particularly the two *.eval.P files.
  • General routines common to both interpreters:
lexical syntax
Neither interpreter is a production system. They are as small and simple as possible, written to illustrate evaluation strategies. Notably omitted: type checker, garbage collector. The lazy interpreter can be run through this form:

There is more on [λ-calculus here] and additional [λ examples here].

window on the wide world:

Computer Science Education Week

Linux
 Ubuntu
free op. sys.
OpenOffice
free office suite,
ver 3.4+

The GIMP
~ free photoshop
Firefox
web browser
FlashBlock
like it says!

© L. Allison   http://www.allisons.org/ll/   (or as otherwise indicated),
Faculty of Information Technology (Clayton), Monash University, Australia 3800 (6/'05 was School of Computer Science and Software Engineering, Fac. Info. Tech., Monash University,
was Department of Computer Science, Fac. Comp. & Info. Tech., '89 was Department of Computer Science, Fac. Sci., '68-'71 was Department of Information Science, Fac. Sci.)
Created with "vi (Linux + Solaris)",  charset=iso-8859-1,  fetched Wednesday, 23-Apr-2014 21:46:58 EST.