A compact configuration language for physical systems, with typed units, readable defaults, and Rust integration.
sensor {
distance = 25cm
timeout = 500ms
}
backend = CPURatslang supports namespaces, includes, references, arrays, ranges, and physical quantities. Comments can describe settings and declare constraints. Ratslang also provides serde integration, source-preserving edits, a configuration CLI, and an LSP.
[dependencies]
ratslang = "0.5.0"let config = ratslang::compile_code("sensor.distance = 25cm\n")?;
let distance = config.vars.resolve("sensor.distance")?;See getting started for serde configuration and defaults. The core compiler requires Rust 1.85.1 or newer. The LSP requires Rust 1.95 or newer.
| Guide | Covers |
|---|---|
| Language | Values, assignments, arrays, ranges, and references |
| Units | Time, length, mass, angle, frequency, velocity, and acceleration |
| Schemas | Enums, bounds, required settings, and deprecations |
| Serde | Derived Rust config types and typed uom quantities |
| Editing | Preserve comments, includes, and original source |
| Compiler | Resolved values, macros, and provenance |
| API reference | Published Rust APIs |
Documentation source · Website · Build the documentation
The LSP uses local or HTTPS defaults for completion, hover docs, diagnostics, definitions, and fixes. See the editor guide.
cargo install ratslang-lsp --lockedEnsure ~/.cargo/bin is on the editor's PATH.
Follow the Helix setup for LSP and tree-sitter.
Follow the Neovim 0.11+ setup for the native client.
Follow the VS Code setup to install the extension.
cargo install ratslang-cli --lockedUse check, fmt, explain, generate, minimize, and migrate to inspect and
edit configuration. See the CLI guide.
MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.