This is a port/rewrite of the MIT CScheme interpreter in C#. It can load and run both the MIT Scheme source code or the syntaxed "bin" files of MIT Scheme. Although it is far from complete, it can cold load MIT Scheme, get to a prompt and start evaluating expressions. Rather that using a huge switch statement like CScheme, this interpreter uses virtual method dispatch to direct evaluation. Tail recursion is achieved via a trampoline. Memory is managed by the CLR runtime.
Why did I do this? I wanted to find out a few things.
- Is virtual method dispatch fast enough to base an interpreter on?
- Is the CLR really unsuitable for dynamic languages, or is that a myth?
- Can MIT Scheme benefit from a more sophisticated GC like in the CLR?
- What tricks and techniques can we use to improve the performance of the interpreter itself?