A statically-typed scripting language designed for safe embedding in host applications — games especially.
curl -sSf https://dogma.ws/install.sh | sh
irm https://dogma.ws/install.ps1 | iex
import { push, println } from "dogma:core"
struct Player {
name: String,
health: i32,
}
fn greet(p: Player) -> String {
f"Hello, {p.name}! HP: {p.health}"
}
fn main() {
let mut scores: [i32] = [10, 20, 30]
scores = push(scores, 40)
let total = scores.fold(0, |acc, x| acc + x)
println(f"Total: {total}")
let hero = Player { name: "Aria", health: 100 }
println(greet(hero))
}
let engine = Engine::builder()
.with_capability_functions(
"dogma:core", core_natives())
.with_native_type(
TypeSpec::new("Player")
.with_method(
MethodSpec::new(
"greet", 0,
|args| Ok(Value::Unit))
.returns("String")))
.with_max_operations(100_000)
.build();
engine.run_file(Path::new("script.dg"))?;
Types are checked at compile time. i32, i64, f64, String, Option<T>, Result<T, E> — the type system works for you, not against you.
Functions require explicit import. Types are universally available. Hidden behaviour does not exist in Dogma — every dependency is visible at a glance.
A clean Rust API lets host applications expose functions and types to the script runtime. Deny-by-default sandbox: scripts can only do what the host explicitly allows.
v1.0.0-beta.1 · MIT License · Production beta