Skip to content

A tree-walking interpreter of the Lox language written in TypeScript

Notifications You must be signed in to change notification settings

alesdrobysh/tslox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tslox

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.

Author's repository

Running the code

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>

About

A tree-walking interpreter of the Lox language written in TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published