Skip to content

oliveira-caio/schempy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

schempy

toy interpreter for the Scheme language written in Python.

the interpreter works like this: when you run your program using, eg, python main.py, it enters an infinite loop to simulate an interpreter. then, you type one-liners basic expressions in Scheme and the program will do the following, in that order: get the tokens using Python's split function, construct a syntax tree of the expression to see the order of execution, evaluate the expression. the first two steps are called parsing. this interpreter also has tail-call recursion implemented in a very sketchy way with an infinite loop inside the evaluate function. the available tools of the interpreter are described inside the evaluate docstring, but you can basically declare and mutate variables (only integers and floats), use if statements and declare and call functions/procedures. this interpreter is based on these two posts by Peter Norvig: 1 and 2.

About

toy interpreter for the programming language scheme.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages