Kai (会 in Japanese) is an experimental interpreter that provides a highly extensible runtime environment and explicit control over the compilation process.
Programs are defined using nested symbolic expressions, which are all parsed into first-class values with minimal intrinsic semantics. Kai can generate optimised code at run-time (using Low Level Virtual Machine) in order to exploit the nature of the underlying hardware and to integrate with external software libraries. It is a unique exploration into world of dynamic code compilation, and the interaction between high level and low level semantics.
You can try the online demo. Source code is available at GitHub.
The Moment of Kai
The Japanese character 会 generally translates into 'meeting'. There are many ways in which this is significant. In this particular instance its usage can be considered in terms of 弓道, which roughly translates into 'Way of the Bow' (Archery). The highest goals in 弓道 are truth 真, goodness 善 and beauty 美. Truth is the pursuit of the correct technique and to grasp the truth of things; Goodness represents inner calm and balance; beauty is to maintain a clear structure and composition. There are many formal steps in 弓道; Kai 会 is the moment before the arrow is released, when the energy of the bow and the body of the archer are in balance.
- Fast and reliable execution.
- Easy to embed and extend.
- Simple semantics using fexprs.
- Dynamic compilation using LLVM.
- Syntactic enhancements to improve usability.
- Kai - Software Overview — High level overview of usage and implementation.
- Kai - A Dynamic Compiler — Extensive research report and performance analysis.
I developed Kai over several years to learn more about computer programming. Thanks to Tadao Takaoka for his supervision and support.