{"id":21062125,"url":"https://github.com/ahrefs/rust-ocaml-derive","last_synced_at":"2025-05-16T01:31:47.349Z","repository":{"id":57618170,"uuid":"124063232","full_name":"ahrefs/rust-ocaml-derive","owner":"ahrefs","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-12T14:19:59.000Z","size":22,"stargazers_count":61,"open_issues_count":0,"forks_count":5,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-10-14T11:36:04.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahrefs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-06T10:41:01.000Z","updated_at":"2024-03-25T12:53:26.000Z","dependencies_parsed_at":"2022-09-16T00:51:07.748Z","dependency_job_id":null,"html_url":"https://github.com/ahrefs/rust-ocaml-derive","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahrefs%2Frust-ocaml-derive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahrefs%2Frust-ocaml-derive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahrefs%2Frust-ocaml-derive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahrefs%2Frust-ocaml-derive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahrefs","download_url":"https://codeload.github.com/ahrefs/rust-ocaml-derive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225308917,"owners_count":17454081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T17:37:20.119Z","updated_at":"2024-11-19T17:37:20.735Z","avatar_url":"https://github.com/ahrefs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# derive-ocaml - Custom derive and procedural macros for easier ocaml \u003c-\u003e rust FFI\n\n*WARNING* this crate is very experimental\n\nderive-ocaml is based on top of [ocaml-rs](https://github.com/zshipko/ocaml-rs) and adds a custom derive macro for `FromValue` and `ToValue`.\nThe macro supports structs, enums, and unboxed float records.\n\nOn top of that it implements a nightly only procedural macro `ocaml-ffi` to ease the boilerplate of writing stubs functions.\n\n\n```\n#[derive(Debug, Default, ToValue, FromValue)]\n#[ocaml(floats_array)]\npub struct Vec3 {\n    x: f32,\n    y: f32,\n    z: f32,\n}\n\n#[ocaml_ffi]\npub fn rust_add_vecs(l: Vec3, r: Vec3) -\u003e Vec3 {\n    l + r\n}\n```\n\nsee `src/example/src/lib.rs` and `src/example/src/stubs.ml` for example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahrefs%2Frust-ocaml-derive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahrefs%2Frust-ocaml-derive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahrefs%2Frust-ocaml-derive/lists"}