Skip to content
digital-substratePublic

About

Code generator for the dsviper ecosystem — bridges DSM and StringTemplate

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

43 Commits

Folders and files

Repository files navigation

kibo

Deprecated. This is the LTS-1.2 branch: kibo 1, which exposes Template Model 1. It is deprecated and receives fixes only, for the life of the LTS-1.2 line. New projects use the kibo 2 line, on main; moving a project is covered by the migration guides.

Code generator for the DSM language ecosystem. Kibo is a thin bridge between DSM and StringTemplate: it reads a DSM definitions file, exposes a Template Model to .stg files, and lets StringTemplate render the output.

Kibo = bridge(.dsm.json)  →  StringTemplate model  →  generated code

Kibo is an implementation of the consumer side of the DSM language contract specified at github.com/digital-substrate/dsm. It accepts the canonical JSON wire format described by that spec.

Kibo does not know what is being generated. It only applies a templated feature (a .stg file) to a model. Targets can be anything StringTemplate can render: C++, Python, Graphviz, SQL, …

Documentation

Full documentation: https://docs.digitalsubstrate.io/kibo/

Part of the DevKit ecosystem.

Build

Requires a JDK 17 (a JRE is not enough). Maven itself is not a prerequisite: the repository carries the Maven Wrapper, which downloads and caches the pinned Maven version on first use. No IDE is involved.

./mvnw clean package     # macOS, Linux
.\mvnw.cmd clean package # Windows

Produces target/kibo-X.Y.Z.jar, an executable jar bundling its dependencies. That is the artifact to ship; target/original-kibo-X.Y.Z.jar alongside it is the pre-bundling jar kept by the shade plugin and carries no dependencies.

The Maven version is pinned in .mvn/wrapper/maven-wrapper.properties; change it there rather than relying on whatever mvn a given machine happens to have.

Synopsis

java -jar target/kibo-X.Y.Z.jar \
    -c [cpp | python] \
    -n [namespace] \
    -d [definitions.dsm.json] \
    -t [template_directory_or_file] \
    -o [output_directory]

For details, see the user-facing documentation:

  • devkit-doc/source/kibo/usage.md — Kibo CLI and its role.
  • devkit-doc/source/kibo/templates.md — templated features as an ecosystem.
  • devkit-doc/source/kibo/template_model.md — how the Template Model is built from .dsm.json.

Public contract

Kibo's public surface is the Template Model API exposed to .stg files: the variables, iterators, and methods consumed by every templated feature, first-party (DS-maintained) and third-party (client-authored). Breaking this API breaks all downstream templated features, including those DS does not own. Treat changes with the same rigour as a public runtime API.

Versioning follows the dsviper ecosystem MAJOR.MINOR API line; see https://docs.digitalsubstrate.io/.

License

This project is licensed under the MIT License — see LICENSE.

About

Code generator for the dsviper ecosystem — bridges DSM and StringTemplate

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages