https://github.com/agentcooper/notjs
Naive attempt at a JavaScript interpreter
https://github.com/agentcooper/notjs
interpreter
Last synced: about 1 month ago
JSON representation
Naive attempt at a JavaScript interpreter
- Host: GitHub
- URL: https://github.com/agentcooper/notjs
- Owner: agentcooper
- Created: 2020-04-13T14:10:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-02T21:49:22.000Z (about 6 years ago)
- Last Synced: 2025-03-02T18:29:04.716Z (over 1 year ago)
- Topics: interpreter
- Language: C++
- Homepage:
- Size: 29.3 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NotJS
Very naive attempt to do a JS engine in C++17. Doing this for learning purposes.
## To-Do
1. [x] Passing parameters to a function
2. [x] Recursion
3. [x] Booleans, comparision operators
4. [x] Ternary expression
5. [x] Let
6. [x] Closures
7. [ ] Parser
8. [ ] Explore JIT and inline caching techniques
## Notes
- I'm intentionally keeping everything in one file for now.
- For naming and AST structure I'm referring to the [TypeScript AST](https://ts-ast-viewer.com/).
## Compile and run
```
g++ -std=c++17 -O3 -Wall -I ./notjs ./notjs/main.cpp && time ./a.out
```