Skip to content

Follow-up of Robert Nystrom, "Crafting Interpreters", using typescript

Notifications You must be signed in to change notification settings

paulsohn/crafting-interpreters-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crafting-interpreters-ts

Follow-up of Robert Nystrom, "Crafting Interpreters", part II, using typescript (and yarn berry for package manager)

How did I set up the environment

yarn init

# somehow yarn set version berry didn't work
yarn set version canary

yarn add typescript @types/node
yarn add -D ts-node

# to use vscode 
yarn dlx @yarnpkg/sdks vscode

# initialize tsconfig.json
yarn tsc --init

I don't feel it necessary, but I added below line into .yarnrc.yml manually:

nodeLinker: pnp

in tsconfig.json:

"lib": ["es6", "dom"]
"rootDir": "src"
"outDir": "dst"
(...)

How to use

After installing dependencies(via yarn), run

yarn direct <filename(optional)>

The Lox interpreter will read the file and execute the code within it. If no filename is provided, the interpreter will enter into prompt mode and execute your input line by line. Ctrl+D to exit.

About

Follow-up of Robert Nystrom, "Crafting Interpreters", using typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published