Skip to content

banqinghe/monkey-interpreter-ts

Repository files navigation

monkey-interpreter-ts

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!

Quick Start

Just try executing npx monkey-parser in the shell, there will be a fully functional repl.

Run

Node.js >= 18

pnpm install

# execute all tests
pnpm test

# start the repl
pnpm repl # try `.load ./example/sum.mky` in repl

About

Monkey Programming Language interpreter written in TypeScript

Topics

Resources

Stars

Watchers

Forks