I got stucked at building Environment object needed for functions and closures. Currently Roc does not support recursive types, which makes it impossible to implement this feature.
I might come back to this in the future when Roc supports recursive types.
- Writing Interpreter in Go / Writing Compiler in Go's Monkey Language but in Roc
- Marmoset is a small monkey, sometimes called Pug Monkey, and I do like pugs 🙈
First you need to install Roc, check either:
asdf plugin add roc https://github.com/dkuku/asdf-roc.git
asdf install roc nightlyThen you can clone this repository and run the following commands:
git clone git@github.com:zlw/marmoset.gitfaster compilation, slower runtime performance
make buildslower compilation, faster runtime performance
make releasemake unit- Lexer
- Parser
- Evaluator
- Compiler
| Feature | Interpreter | Compiler |
|---|---|---|
| Bindings | ❌ | ❌ |
| Conditionals | ❌ | ❌ |
| Strings | ❌ | ❌ |
| Integers | ❌ | ❌ |
| Arithmetic +-/* | ❌ | ❌ |
| Arrays | ❌ | ❌ |
| Indexing | ❌ | ❌ |
| Dictionaries | ❌ | ❌ |
| Functions | ❌ | ❌ |
| First class functions | ❌ | ❌ |
| Higher order functions | ❌ | ❌ |
| Closures | ❌ | ❌ |
| Recursion | ❌ | ❌ |
| Built-In Functions | ❌ | ❌ |
| Loops | ❌ | ❌ |
| Floats | ❌ | ❌ |
| Macros | ❌ | ❌ |
- Propagate Paring errors instead of crashing
- Return
Result-
parseIdentifier -
parseIntegerLiteral -
parsePrefixExpression -
parseInfixExpression -
parseBoolean -
parseGroupedExpression -
parseIfExpression -
parseBlockStatement -
parseFunctionLiteral -
parseFunctionParameters -
parseCallExpression -
parseCallArguments
-
- Return