5 releases

1.0.0-beta.4 Oct 24, 2022
1.0.0-beta.3 Aug 7, 2022
1.0.0-beta.2 Aug 2, 2022
1.0.0-beta.1 Jul 29, 2022
1.0.0-beta.0 Jun 6, 2022

#1172 in Procedural macros

Download history 5913/week @ 2023-12-18 1888/week @ 2023-12-25 1989/week @ 2024-01-01 2198/week @ 2024-01-08 1924/week @ 2024-01-15 1833/week @ 2024-01-22 2428/week @ 2024-01-29 547/week @ 2024-02-05 518/week @ 2024-02-12 806/week @ 2024-02-19 178/week @ 2024-02-26 118/week @ 2024-03-04 169/week @ 2024-03-11 86/week @ 2024-03-18 84/week @ 2024-03-25 134/week @ 2024-04-01

481 downloads per month

ISC license

11KB
228 lines

ocaml-build

ocaml-build is used to generate an OCaml file containing signatures from Rust code

For example, if you have this function (annotated with the #[ocaml::sig(...)] macro:

#[ocaml::func]
#[ocaml::sig("int -> bool")]
pub fn greater_than_zero(i: ocaml::Int) -> bool {
  i > 0
}

And the following build script:

fn main() -> std::io::Result<()> {
    ocaml_build::Sigs::new("src/rust.ml").generate()
}

The following code will be generated in src/rust.ml:

external greater_than_zero: int -> bool = "greater_than_zero"

And a matching mli file will be created.

Dependencies

~1–1.4MB
~34K SLoC