Continuation from the interpreter-rust
The rust borrow checker made the way of making the interpreter feel like hell
I will still be following Crafting Interpreters
hopefulon my own this time
Check out the working model at https://tushyagupta81.github.io/interpreter-zig
The backend might take 1-2 min to turn back on
- How to read a file
- Using the gpa allocator
- REPL mode working
- Tokens
- Scanner
- Challenge
- Multiline comments
- Challenge
- Parser
- Temp hack - Using arena allocator to help memory release
- Challenge
- Implement Comma operator from C and C++
- Ternary operator
- Detect a Binary operation with a missing left hand operator
- Interpreter
- Challenge
- compare numbers and string(Don't know what it should really do?)
- and numbers to string
- divide by 0 check
- Challenge
- Statements
- Parts
- Exprs
- variables(without scope)
- variables(with scope)
- conditionals
- and or operators
- loops
- Challenge
- REPL to auto detect a expr vs a statement and execute them accordingly
- Give runtime error for variable that are declared but not initialized
- branching statements?
- break statement
- Parts
- Functions
- Return
- Local functions(
can't really figure it outmoved all environments to the heap) - Challenge
- Checking number of args at runtime hits preformance
- Anonymous functions
- Resolver
- Coping the env at the time of creation of the function
- For the one from the book to work need to make it so that I can HashMap Expr itself and not there pointers
- Got the tedious HashMap defination from tusharhero
- Also needed a globals list(pointed the init env 2 times)
- Resolve time errors
- Challenge
- Extend resolver to detect unused local variables
- Look up variable using a index array instead of a hashmap
- By sending the index and distance from the resolver
- ...
- interpreter.zig
- evaluvate_binary -> string concat size limit of 4096
- token.zig
- LiteralValue
- to_string methods size limit of 4096
- LiteralValue
- enironment.zig
- get -> string concat size limit of 4096