mimas
mimas is a statically typed, embeddable scripting language for Rust. It carries over much of Rust’s syntax and ergonomics, reshaping the rest to deliver what a scripting layer is good for: fast iteration, quick compile times, and runtime flexibility.
Static typing with inference, user-defined types, exhaustive pattern matching, and more of the same features that empower you in Rust.
let area: float? = match my_shape {
Shape::Circle(r) => r * r * std::math::PI,
Shape::Rectangle(w, h) => w * h,
_ => null,
};
Rigorous, not rigid. Flexibility shouldn’t cost you safety. Inference writes your types, compiles stay fast, and errors point you toward the fix instead of just turning you away — so writing it stays quick, iterative, and intuitive.
let nums = [5, 3, 8, 1];
let big = for n in nums { if n > 4 collect n; };
print(f"found {big.len()}: {big}"); // -> found 2: [5, 8]
Share your Rust types and functions with the mimas macro, all while maintaining type safety. The macro alone is all you need for mimas to find it.
// rust
#[mimas]
struct User(String);
impl User {
fn greet(self) {
println!("Hello, {}!", self.0);
}
}
// mimas
let user = User("mimas");
user.greet(); // Hello, mimas!
- Don’t Panic — mimas treats any panic, compiler or VM, as a bug.
- Tested top to bottom — over 1,000 tests cover every corner of the codebase. Even the tests are tested, thanks to cargo mutants.
- Helpful diagnostics — bugs are caught at their source with clear, illustrative reports powered by miette:
error: non-exhaustive match ╭─[tools/src/main.mim:3:1] 2 │ 3 │ ╭─▶ match Color::random() { 4 │ │ Color::Red => print("Red!"), 5 │ │ Color::Blue => print("Blue!"), 6 │ ├─▶ } · ╰──── missing pattern `Color::Green` 7 │ ╰──── ╰─▶ advice: `Color::Green` defined here ╭─[tools/src/color.mim:6:5] 5 │ Blue, 6 │ Green, · ──┬── · ╰── this variant has no matching arm 7 │ } ╰────