All Projects → m4b → raml

m4b / raml

Licence: other
OCaml runtime and FFI bindings directly in Rust

Programming Languages

rust
11053 projects
Makefile
30231 projects

Projects that are alternatives of or similar to raml

fsevent-rust
FSEvent bindings for rust.
Stars: ✭ 38 (-49.33%)
Mutual labels:  ffi-bindings
foundationdb-haskell
Haskell FFI bindings to the FoundationDB C API
Stars: ✭ 32 (-57.33%)
Mutual labels:  ffi-bindings
coqffi
Coq to OCaml FFI made easy [maintainer=@lthms]
Stars: ✭ 27 (-64%)
Mutual labels:  ffi-bindings
rust-ffi-examples
FFI examples written in Rust
Stars: ✭ 42 (-44%)
Mutual labels:  ffi-bindings
cuda
Haskell FFI bindings to CUDA
Stars: ✭ 73 (-2.67%)
Mutual labels:  ffi-bindings
ffi-libc
Useful Ruby FFI bindings for libc
Stars: ✭ 32 (-57.33%)
Mutual labels:  ffi-bindings
OCaml-GObject-Introspection
OCaml bindings to GObject-Introspection based on OCaml-Ctypes.
Stars: ✭ 15 (-80%)
Mutual labels:  ffi-bindings
eta-ffi
A command line tool to automate the generation of ffi import code for the bindings of various Java libraries.
Stars: ✭ 19 (-74.67%)
Mutual labels:  ffi-bindings
odbc-rs
Rust ODBC FFI binding
Stars: ✭ 90 (+20%)
Mutual labels:  ffi-bindings
cztop
CZMQ binding for Ruby
Stars: ✭ 30 (-60%)
Mutual labels:  ffi-bindings
cargo-valgrind
A cargo subcommand, that runs valgrind and displays its output in a helpful manner.
Stars: ✭ 66 (-12%)
Mutual labels:  ffi-bindings

goats are actually the best animal ever invented

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"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].