-
-
Notifications
You must be signed in to change notification settings - Fork 20
InkCPP Compiler
Ink's Inkelcate compiles written ink code into a JSON format used by their C# runtime. This JSON format is almost like an "assembly", where complex ink structures and commands are expressed in many simple instructions that push and pop data to a stack or the output stream.
Parsing and traversing JSON requires numerous on the fly allocations and data conversions (notably a lot of parsing strings as numbers) which go against InkCPP's goals of no dependencies and no dynamic allocations (except in exceptional cases). As such, InkCPP has its own compiler which converts this JSON into a flat, binary format.
All the compiler code is organized into the inkcpp_compiler project which compiles into a static library which can be included in your build pipeline. The inkcpp_cl executable can also run it using the command line inkcpp_cl -o output.bin myInkFile.ink
.
The compiler depends on json.hpp which is included in the project as a standalone .hpp file. This dependency is not included in the runtime, as the runtime only needs the final binary file outputted by the compiler.