pub fn compile_source_to_binary(
source: &str,
options: &CompileOptions,
) -> Result<PathBuf>Expand description
Compile Ruchy source code to a standalone binary
§Examples
use ruchy::backend::{compile_source_to_binary, CompileOptions};
use std::path::PathBuf;
let source = r#"
fun main() {
println("Hello, World!");
}
"#;
let options = CompileOptions::default();
let result = compile_source_to_binary(source, &options);§Errors
Returns an error if:
- The source code fails to parse
- The transpilation fails
- The working directory cannot be created
- The rustc compilation fails