Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/j14159/mci-definterp-scala
Learning about stuff, simple meta-circular interpreter in Scala.
https://github.com/j14159/mci-definterp-scala
Last synced: 25 days ago
JSON representation
Learning about stuff, simple meta-circular interpreter in Scala.
- Host: GitHub
- URL: https://github.com/j14159/mci-definterp-scala
- Owner: j14159
- Created: 2014-03-08T17:16:19.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-08T17:16:35.000Z (almost 11 years ago)
- Last Synced: 2024-10-29T21:14:26.527Z (2 months ago)
- Language: Scala
- Size: 102 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Meta-Circular Definitional Interpreter In Scala
===============================================Just me trying to learn more.
# What
This is an attempt to build a meta-circular interpreter roughly equivalent to the first one shown in the paper [Definitional Interpreters for Higher-Order Programming Languages](http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.110.5892) (Reynolds, 1972). I came across mention of it in the original Scheme paper ([AI Memo 349](http://dspace.mit.edu/bitstream/handle/1721.1/5794/AIM-349.pdf)) when it talked about "environments", amongst other things.This is basically two source files, one for the types making up the [AST](http://en.wikipedia.org/wiki/Abstract_syntax_tree) and one for the simple interpreter itself. It was interesting to work through how to handle the equality function via currying (that one took me an embarassingly long time) and simple environment extension, both of which were far simpler than I realized at first.
# How
Two tests exist, SimpleTests to run through basic functionality and AdditionProgram that defines an addition function and applies it. Probably crazy easy to nuke the stack with big numbers. To run, make sure you have sbt installed and then:sbt test