| Crates.io | ngrs |
| lib.rs | ngrs |
| version | 0.1.3 |
| created_at | 2025-11-30 12:10:52.851277+00 |
| updated_at | 2025-12-28 08:13:34.744224+00 |
| description | A New Rust bindings for GNU Guile Scheme |
| homepage | https://github.com/minkieyume/ngrs |
| repository | https://github.com/minkieyume/ngrs |
| max_upload_size | |
| id | 1958162 |
| size | 105,811 |
| English | 中文 |
NGRS is a New Rust bindings for GNU Guile Scheme.
`ngrs` provides both low-level raw bindings and high-level safe abstractions for embedding GNU Guile Scheme in Rust applications. This project enables seamless integration of Scheme scripting capabilities into Rust programs with a focus on memory safety and ergonomic APIs.
ngrs - High-level safe Rust wrappers with idiomatic interfaces, Contains raw.
raw - Low-level FFI bindings to Guile's C API
Make bindings and convert for base values.
Implement eval(evalexpr), evalstring, evalfile(load), apply(applyscm), apply(call0~n), define
Create safe type wrappers for composite values List, Vector, HashMap and special base values procedure, Symbol, Keywords (or at least provide a method to convert them to Rust types)
Add module operations to facilitate writing interactive modules for Guile in Rust.
Write bindings to convert Rust structs into Guile foreign types
Add this to your Cargo.toml .
[dependencies]
ngrs = "0.1"
use ngrs::{Runtime, with_guile};
fn main() {
// Initialize Guile
Runtime::initialize();
with_guile(|vm:Runtime| {
// Your Code Here
println!("Hello guile from Rust!");
let args = vec!["Test Guile".to_string(),];
vm.shell(args);
});
}
Before using any Guile functionality, you must initialize the Guile environment:
use ngrs::Runtime
fn main() {
// Initialize Guile
Runtime::initialize();
// Your code here
}
This way has Less platforms support.
use ngrs::Runtime;
fn main() {
Runtime::initialize();
let runtime = Runtime::new();
// Your Guile-dependent code here
}
For more control over the Guile context:
use ngrs::with_guile;
fn main() {
Runtime::initialize();
with_guile(|vm:Runtime| {
// Your Guile-dependent code here
});
}