How is chaiscript evaluated


How is chaiscript executing scripts. I just wanto understand its internals.


That’s a big question, honestly.

The short answer is that it builds an AST of script elements to execute. It then optimizes that AST to eliminate unnecessary operations and combine operations. Then finally, when a script is executed, it directly calls that AST.

The actual implementation is here: