Kibo¶
Kibo is the code generator. It reads a DSM model plus a
Kibo template and emits source code — typed C++, Python and TypeScript
surfaces wired for the Viper runtime when used with kibo-template-viper.
Kibo is the second step of the code-generation pipeline: DSM → Kibo → kibo-template-viper. Kibo itself
is template-agnostic — change the template and you change the target
language and runtime. This section covers Kibo’s command line, the
Template Model a template reads, and kibo-project, which drives the
generation of a whole project. The catalogue of templated features it
produces in the Viper world lives in kibo-template-viper.
This is kibo 2: it exposes Template Model 2 and generates over the 1.2 runtime.
Place in the ecosystem¶
Depends on — DSM models (
.dsm.jsonfiles), a Kibo template pack.Consumed by — developers, through kibo-project and a project’s
kibo.toml, or directly by running the JAR.Source repositories — digital-substrate/kibo, a Java tool bridging DSM and StringTemplate, and digital-substrate/kibo-project.
Distribution — a single JAR (
kibo-2.0.0.jar) and thekibo_project.pyscript.
Quickstart¶
A project states its generation once, in a kibo.toml:
[project]
definitions = "definitions"
infrastructure = "myapp"
[generator]
templates = "2"
[target.python]
features = ["Base", "Wheel"]
output = "python/generated"
[target.cpp]
features = ["Base", "DatabaseAttachments"]
output = "cpp/generated"
python3 kibo_project.py generate kibo.toml
The Python result is a typed package, import myapp, ready to be used
through dsviper; the C++ result is .hpp and .cpp files that
link against the Viper C++ runtime. Calling the JAR directly is
covered in Command-line usage.