https://github.com/tmattio/js-bindings
High-quality JavaScript bindings for OCaml
https://github.com/tmattio/js-bindings
Last synced: 6 months ago
JSON representation
High-quality JavaScript bindings for OCaml
- Host: GitHub
- URL: https://github.com/tmattio/js-bindings
- Owner: tmattio
- License: mit
- Created: 2021-04-12T18:17:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-29T12:31:37.000Z (over 4 years ago)
- Last Synced: 2025-07-13T07:02:10.902Z (6 months ago)
- Language: OCaml
- Homepage:
- Size: 7.98 MB
- Stars: 30
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - js-bindings - quality JavaScript bindings for OCaml | tmattio | 28 | (OCaml)
README
# OCaml JavaScript bindings
[](https://github.com/tmattio/js-bindings/actions)
High-quality JavaScript bindings for OCaml.
Want bindings for a library? Open an [issue](https://github.com/tmattio/js-bindings/issues)!
The bindings have been generated using `ts2ocaml` from the TypeScript type definitions found in [https://github.com/Microsoft/TypeScript/tree/master/lib](https://github.com/Microsoft/TypeScript/tree/master/lib).
The generated bindings have then been manually modified to improve the API. Notably the bindings differ from the underlying implementation in the following ways:
- No `ArrayLike`, `ArrayBufferLike`, `PromiseLike` and co. OCaml does not have implicits (yet), so we just replace all of these with their counterparts (`ArrayLike` is replaced by `Array`)
- We don't include Symbols accessors. `gen_js_api` does not support this, and it really does not seem useful anyways
The bindings don't depend on any PPX (and in particular, they don't depend on `gen_js_api`). Instead, the generated bindings are promoted and the installable libraries copies the promoted files.
## To do
- [ ] Replace `cast` with `include module type of`
- [ ] Create the `on` functions
- [ ] investigate long function variants (`'''''`)
- [ ] Add builder for VSCode