Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Runtime Formats

Select a runtime format per codegen target:

[codegen.rust]
runtime_format = "sora"

Runtime formats are the formats generated code can load. They correspond to export formats:

Codegen runtime_formatRequired Export
sorabinary
jsonjson
cborcbor
sora-protobufsora-protobuf

This setting does not change Excel, CSV, TOML, JSON, YAML, or schema files. It only changes the loader generated for the target language. The selected runtime format must have a matching export in the project build.

Support Matrix

Targetsorajsoncborsora-protobuf
Rustself-containedmanaged dependencymanaged dependencymanaged dependency
Kotlinself-containedmanaged dependencymanaged dependencymanaged dependency
C#self-containedmanaged dependencymanaged dependencymanaged dependency
Javaself-containedmanaged dependencymanaged dependencymanaged dependency
Scalaself-containedmanaged dependencymanaged dependencymanaged dependency
Goself-containedmanaged dependencymanaged dependencymanaged dependency
TypeScriptself-containedmanaged dependencymanaged dependencymanaged dependency
JavaScriptself-containedmanaged dependencymanaged dependencymanaged dependency
Pythonself-containedmanaged dependencymanaged dependencymanaged dependency
Dartnot supportedstandard libraryuser adapteruser adapter
Godotnot supportedstandard librarynot supportednot supported
Cself-containednot supportednot supportednot supported
C++self-containednot supportednot supportednot supported
Erlangself-containeduser adapteruser adapteruser adapter
Luaself-containeduser adapteruser adapteruser adapter

Dependency meanings:

KindMeaning
self-containedGenerated runtime includes the decoder.
standard libraryGenerated runtime uses the language standard library.
managed dependencyGenerated runtime expects normal package dependencies for that ecosystem.
user adapterGenerated runtime exposes an adapter hook and the application supplies the concrete decoder.

Choosing a Format

Use sora when you want the native Sora binary bundle and the target supports it.

Use json when inspectability, tooling, or platform simplicity matters more than compactness.

Use cbor when you want a compact general-purpose binary value format and your runtime already has a CBOR dependency.

Use sora-protobuf when your environment prefers Protobuf transport but you still want Sora’s schema-driven value model.

The CI runtime matrix generates every supported combination in this table and syntax-checks languages where the check is lightweight.

Godot JSON and Generated Types

Godot codegen targets Godot 4.3 by default. Set the target version when the generated project uses a newer Godot release:

[codegen.godot]
runtime_format = "json"
godot_version = "4.4"

Generated GDScript uses concrete table key and index parameter types, typed row arrays, and one class per discriminated-union variant. Godot 4.4 and newer additionally use typed dictionaries; Godot 4.3 keeps dictionaries untyped because that syntax is unavailable there. Nested typed collections fall back to Array or Dictionary where GDScript does not allow a typed collection as another typed collection’s element type.

The generated JSON loader preserves i64, duration, and datetime integer values outside JSON’s interoperable safe-integer range. It quotes those number tokens internally before calling Godot’s JSON parser, then decodes their decimal strings back to exact 64-bit integers. The exported JSON format itself does not change.

Optional primitive values remain Variant because GDScript has no nullable primitive type. Optional generated records, unions, and text keys retain their concrete object type and use null as the empty value.