| Crates.io | roblox-rs-core |
| lib.rs | roblox-rs-core |
| version | 0.1.0 |
| created_at | 2025-05-01 19:07:16.678169+00 |
| updated_at | 2025-05-01 19:07:16.678169+00 |
| description | Core compiler for translating Rust code to Luau for the Roblox platform |
| homepage | |
| repository | https://github.com/DunnoConz/roblox-rs |
| max_upload_size | |
| id | 1656761 |
| size | 813,471 |
Core library for the roblox-rs compiler.
roblox-rs-core is the engine behind the roblox-rs compiler, responsible for parsing Rust source code, transforming it to Luau AST, and generating optimized Luau code for the Roblox platform.
synWhile this library is primarily used by the roblox-rs-cli package, you can also use it directly in your Rust code:
use roblox_rs_core::{compile, CompileOptions};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rust_source = r#"
fn add(a: i32, b: i32) -> i32 {
a + b
}
"#;
let options = CompileOptions {
optimize: true,
target_dir: "out".into(),
..Default::default()
};
let luau_output = compile(rust_source, options)?;
println!("Generated Luau: {}", luau_output);
Ok(())
}
The compilation process occurs in several stages:
synDetailed API documentation is coming soon. For now, see the examples directory for sample usage.
roblox-rs-cli: Command-line interface using this libraryroblox-rs: The main project repositoryThis project is licensed under the MIT License - see the LICENSE file for details.