DSM¶
The Digital Substrate Model (DSM) is a small declarative language for describing data models — namespaces, concepts, structures, attachments, function pools. It is the modeling layer of the dsviper ecosystem and the entry point of the code-generation pipeline.
DSM is standalone: authoring a .dsm file does not require Kibo, the
Viper C++ runtime, or dsviper. You can use it as a typed contract between teams,
or feed it into code generation when typed code is needed. See
Value Chains for where DSM sits in the broader picture.
Place in the ecosystem¶
Depends on — DSM is the root of the toolchain value chain.
Source repository — digital-substrate/dsm. Carries the ANTLR4 grammar (
DSM.g4) and the canonical JSON wire format — producer-neutral, implemented by Viper C++, Kibo, and the IDE plugins.Related repositories —
digital-substrate/dsm-samples — reference DSM models (
Tuto,Ge,Re).digital-substrate/dsm-vscode — VS Code plugin.
digital-substrate/dsm-jetbrains — JetBrains plugin.
Install instructions: see IDE Integration.
Quickstart¶
A minimal DSM file, exercising the five fundamental notions (namespace, concept, key, document, attachment):
namespace Tuto {f529bc42-0618-4f54-a3fb-d55f95c5ad03} {
concept User;
struct Login {
string nickname;
string password;
};
attachment<User, Login> login;
};
Validate the syntax:
python3 tools/dsm_util.py check model.dsm
Generate a typed package with Kibo: a kibo.toml beside the model states
the generation once, and kibo-project renders
it with the kibo-template-viper pack:
[project]
definitions = "model.dsm"
infrastructure = "model"
[generator]
templates = "2"
[target.python]
features = ["Base"]
output = "."
python3 kibo_project.py generate
The same file declares C++ or TypeScript targets for the Viper C++ runtime and the Node binding. See Templated Features for the features of each target, and Using your generated SDK for the generated surface.
To use a model without code generation — load it through dsviper’s dynamic API at runtime — see DSM Processing.
Topics¶
Status¶
Part of DevKit 1.2.x (LTS, feature-locked).