Raml
OCaml runtime and FFI bindings directly in Rust
Install / Use
/learn @m4b/RamlREADME
![]()
Raml - Intelligent OCaml FFI in Rust
Direct OCaml bindings without ever leaving Rust - no C stubs!
(you still have to know how the C ffi bindings work; if you do, the macros are almost identical to the C ones in their naming and purpose)
Please see the example in examples for the Rust code in rust for the Rust code that OCaml code will call and the ocaml directory for the OCaml code that calls the Rust code.
Also, please bear with me as I'm trying to add more documentation and examples, but I am very busy; if you see something, don't hesitate to add a PR or issue, thanks :)
A basic example demonstrates their usage:
caml!(ml_beef, |parameter|, <local>, {
let i = int_val!(parameter);
let res = 0xbeef * i;
println!("about to return 0x{:x} to OCaml runtime", res);
local = val_int!(res);
} -> local);
The macro takes care of automatically declaring CAMLparam et. al, as well as CAMLlocal and CAMLreturn.
If you need more fine grained control, caml_body! and others are available.
Documentation
https://docs.rs/raml/
Usage
raml should work with a recent rustc (I test on 1.16), and does not require nightly.
Add to your Cargo.toml
[dependencies]
raml = "0.1.0"
Related Skills
himalaya
338.0kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
338.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
coding-agent
338.0kDelegate coding tasks to Codex, Claude Code, or Pi agents via background process
