ocaml 0.5.0

OCaml bindings for Rust
docs.rs failed to build ocaml-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: ocaml-1.0.0-beta.5

ocaml-rs - OCaml extensions in Rust

Note: ocaml-rs is still experimental, please report any issues on github

ocaml-rs allows for OCaml extensions to be written directly in Rust with no C stubs. It was forked from raml with the goal of creating a safer, high-level interface.

#[macro_use]
use ocaml;
use ocaml::ToValue;

caml!(ml_beef, |parameter|, <local>, {
    let i = parameter.val_int();
    let res = 0xbeef * i;
    println!("about to return  0x{:x} to OCaml runtime", res);
    local = res.to_value();
} -> local);

This will take care of all the OCaml garbage collector related bookkeeping (CAMLparam, CAMLlocal and CAMLreturn)

For a working example see ocaml-vec or ./examples/rust and ./examples/ocaml

Documentation

https://docs.rs/ocaml/