Following #69, scripting was implemented into the engine using ChaiScript.
Chai was chosen mostly for its ease of integration and urgent need to be able to script out things, however it is not a permanent choice and displays some major issues, including, but not limited to:
High binary size. The build external/RadixEngine/external/chaiScript directory can range anywhere from 400 to 700 MiB in a debug build. A stripped debug glportal binary is ~3.2 MiB, 1 of which is due to Chai alone (nm --print-size --size-sort --radix=d glportal | grep -i chai | cut -d ' ' -f 2 | awk '{s+=$0} END {print s}')
Longer build times. Since Chai heavily uses templates and places 90% of its logic in header files, any translation unit that directly or indirectly includes Chai's headers takes minutes to compile, from seconds in the past. Compiler memory usage also drastically increased, reaching up to 2 GiB per GCC instance.
Abysmal performance as a scripting language. According to the Scriptorium benchmark as well as Chai issue 189, Chai is very slow compared to similar languages.
Memory usage. Although not a concern for modern hardware, Chai uses ~5 MiB on VM startup. This is ridiculously big for a scripting language that doesn't display advanced features like JIT.
Many scripting languages are available and have syntax similar to C/C++. Ones of particular interest are AngelScript and Wren.
An incomplete comparison table is available here and will be completed over time.
Check out 505ecedb011906b5f5da637d87856d3434be9142, where I replaced Chai with AngelScript. This is the work of a single hour of work so may not be perfect, but it works.
Following #69, scripting was implemented into the engine using ChaiScript.
Chai was chosen mostly for its ease of integration and urgent need to be able to script out things, however it is not a permanent choice and displays some major issues, including, but not limited to:
external/RadixEngine/external/chaiScript
directory can range anywhere from 400 to 700 MiB in a debug build. A stripped debugglportal
binary is ~3.2 MiB, 1 of which is due to Chai alone (nm --print-size --size-sort --radix=d glportal | grep -i chai | cut -d ' ' -f 2 | awk '{s+=$0} END {print s}'
)Many scripting languages are available and have syntax similar to C/C++. Ones of particular interest are AngelScript and Wren.
An incomplete comparison table is available here and will be completed over time.