This is a TypeScript implementation of the Lox language tree-walking interpreter from the book Crafting Interpreters by Bob Nystrom.
I wrote this project while following Part II of the book, which covers the implementation of the Lox interpreter in Java. I picked TypeScript because I have a good knowledge of it and I wanted to focus more on the interpreter itself rather than learning Java.
To run the code, you need to have Node.js installed. You can download it from here.
To build the interpreter, run:
pnpm build # or npm run build or yarn build
To run the REPL, run:
node ./dist/bin.js
To run a Lox script, run:
node ./dist/bin.js <path-to-script>