Oxeon
A Rust-like scripting language for modding Bevy games.
Mods are written in a subset of Rust, compiled to WebAssembly and run sandboxed in Wasmtime. They use Bevy's own ECS and reflection, so a mod's systems and components look like ordinary Bevy code:
// mods/regen.ox
// In the game
;
new
.add_plugins
.add_plugins
. // mods see the game's real types
.
.run;
Status: early development. Mods run in Bevy: systems that take
Res/ResMutof the game's resources,Commands,MessageReader/MessageWriter, andQuerys over the game's components and their own (withEntity,With,Without,ChangedandAdded) run inStartupandUpdate, with fuel limits and hot reloading. The compiler handles numbers, structs, enums and tuples by value,matchand patterns, control flow and methods; generics, closures,OptionandResultwith?and their methods; traits come next. See docs/ROADMAP.md.
Features (planned)
- Rust semantics: ownership, borrowing, lifetimes, traits, generics, enums, pattern matching, closures,
Resultand? - A sandbox that is safe for untrusted mods: fuel limits, per-mod capabilities, and a trapped mod never crashes the game
- Hot reloading, with mod state carried across reloads through reflection
- Bindings generated from the game's Bevy
TypeRegistry async/.awaitdriven by the host's executor- Procedural macros that run sandboxed, and compile-time evaluation
- Inline WAT inside
unsafeblocks
The decisions behind these are in docs/DESIGN.md.
Workspace
| Crate | Purpose |
|---|---|
oxeon |
The Bevy plugin, which is the crate games depend on |
oxeon-shim |
The mod API implemented natively in Rust |
oxeon-cli |
The oxeon command-line tool |
oxeon-lsp |
Language server |
editors/vscode |
VS Code extension |
oxeon-compiler |
Compiler pipeline driver |
oxeon-syntax, oxeon-types, oxeon-mir, oxeon-codegen |
Compiler stages |
oxeon-runtime |
Sandboxed Wasmtime runtime |
oxeon-diagnostics |
Spans and error reporting |
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.