From Esolang
Jump to navigation Jump to search

Scan is a toy programming language. I, b_jonas created it in 2003. I published it to the world around 2006.

Scan is dynamically typed, values can be integer, null value, and first-class function. The language has lambda expressions, but lambda expressions cannot take any arguments, so you must pass arguments in global variables. There are a few builtin functions, and these can take arguments. Local variables exist, but lexical closures aren't handled properly, function values don't actually close over anything. The interpreter has other known bugs. Arrays aren't supported.

The interpreter is implemented in old C++ and a tokenizer in flex. The interpreter builds a parse tree and then executes it. The interpreter can be ran in interactive mode, in which case it executes each complete top-level statement as soon as it's read one.

I wrote the interpreter for a university programming course. However, the teacher complained that writing a yacc parser is part of the requirements, so I subsequently wrote a second interpreter called geo to satisfy his request.


Interpreter source code