How is chaiscript evaluated


#1

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


#2

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: https://github.com/ChaiScript/ChaiScript/blob/develop/include/chaiscript/language/chaiscript_eval.hpp

-Jason