This is a TypeScript implementation of the Monkey Programming Language interpreter, as described in the book Writing An Interpreter In Go by Thorsten Ball.
Most of the code for the interpreter itself is directly translated from Go to TypeScript, with some minor adjustments to fit the TypeScript environment. On the other hand, I have made some enhancements to the original interpreter, Monkey now supports comments and big int calculations.
I also created a playground website for this language where you can execute code online and observe the AST. Feel free to check it out!
Just try executing npx monkey-parser
in the shell, there will be a fully functional repl.
Node.js >= 18
pnpm install
# execute all tests
pnpm test
# start the repl
pnpm repl # try `.load ./example/sum.mky` in repl