Written for educational purposes and with book Crafting interpreters.
I've tried to use safe C++ constructs and data type with OOP. And, of course, without global varaibles.
This is not an exact same replica with clox, but it interprets the same language.
The code is messy and I want to make my own language (well, another replica of JS), so wait for Loop!
They are undone, actually.
- Writing and reading chunks. Undone.
 - Optimization. Only some kind of constant folding.
 - Verifying. When I've added jumps and loops it cracked.
 - Tests. When functions appeared, tests become very hard to write.
 
- Natives have arity
 - GC allocates only objects. Dynamic arrays are implemented with 
std::vector. And so on. - Unimplemented GC when 
StressGCis off. Because GC can't track how many bytes the program uses, but it can track living objects count. - There is only 
Closureobject, noFunction. Upvalueobjects holds anstd::vectorof upvalues.- GC can be switched on or off. Is it a good feature?
 - There are 
PrintFlags. The only use for them is to print string as it is, or with quotes and escaped symbols. - The code heavily relies on macros that use macros. (Link)[]
 
This repository contains three projects:
- Lox VM library 
LoxLib/. It contains two folders:includefor public headers andsrcfor implementation. - Lox VM runner 
LoxInterpreter/(a bad name perhaps). It is the main file that runs REPL or a file. It containssrcdirectory where it is implemented. - Lox tests 
LoxGoogleTests. It contains foldersrc, where the tests lie. There is no main file, so they are intended to run withgtest_main.