{"id":28615610,"url":"https://github.com/ocamlpro/wasocaml","last_synced_at":"2025-06-12T02:09:32.262Z","repository":{"id":148298259,"uuid":"577362009","full_name":"OCamlPro/wasocaml","owner":"OCamlPro","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-27T13:06:26.000Z","size":207556,"stargazers_count":54,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-27T23:49:48.636Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCamlPro.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-12T15:12:43.000Z","updated_at":"2024-10-27T13:06:30.000Z","dependencies_parsed_at":"2024-10-26T20:20:05.708Z","dependency_job_id":null,"html_url":"https://github.com/OCamlPro/wasocaml","commit_stats":null,"previous_names":["ocaml-wasm/flambda-to-wasmgc","ocaml-wasm/wasocaml","ocamlpro/wasocaml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OCamlPro/wasocaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fwasocaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fwasocaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fwasocaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fwasocaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCamlPro","download_url":"https://codeload.github.com/OCamlPro/wasocaml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fwasocaml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259382323,"owners_count":22848843,"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":"2025-06-12T02:09:29.098Z","updated_at":"2025-06-12T02:09:32.236Z","avatar_url":"https://github.com/OCamlPro.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wasocaml\n\n*Wasocaml* is an [OCaml] compiler to [Wasm].\n\nIt uses the Flambda IR of the compiler as a source language and targets [Wasm-GC].\n\n## Quickstart\n\n### Install\n\n#### Binaryen\n\nYou need the `wasm-merge` binary in your path. You can get it from the main branch of [Binaryen].\n\n```shell-session\n$ git clone https://github.com/WebAssembly/binaryen.git\n$ cd binaryen\n$ git submodule init\n$ git submodule update\n$ cmake . \u0026\u0026 make\n$ sudo make install\n```\n\n#### Wasocaml\n\nYou can now build and install Wasocaml. You can either build the compiler locally or install a switch with the Wasocaml compiler.\n\n##### Locally\n\n```shell-session\n$ ./configure --enable-flambda\n$ make\n$ sudo make install\n```\n\n##### Opam switch\n\n```shell-session\n$ opam switch create wasocaml --repos default,wasocaml=git+https://github.com/ocamlpro/wasocaml-opam.git ocaml-variants.4.14.1+wasocaml\n```\n\n### Usage\n\nRunning the compiler will produce two files: `a.out.wasm` (the Wasm binary) and `a.out.wat` (the Wast text format).\n\n```shell-session\n$ /usr/local/bin/ocamlopt file.ml\n$ ls\na.out a.out.wasm a.out.wat\n```\n\nFor a complete example using the compiler installed as an opam switch, see [wasocaml-demo].\n\n### Publications \u0026 talks\n\n#### Publications\n\n- [Wasocaml: compiling OCaml to WebAssembly]\n\n#### Talks\n\n- [Wasm GC meeting] - January 2023 - Online\n- [Foundations of WebAssembly (Dagstuhl Seminar 23101)] - March 2023 - Dagstuhl (Germany)\n- [IFL'23] - August 2023 - Braga (Portugal)\n- [ICFP ML track] - September 2023 - Seattle (U.S.)\n- [Wasm Research Day] - October 2023 - Munich (Germany) (accepted but we retracted to let the wasm\\_of\\_ocaml people present their work)\n\n[Binaryen]: https://github.com/WebAssembly/binaryen\n[Foundations of WebAssembly (Dagstuhl Seminar 23101)]: https://drops.dagstuhl.de/storage/04dagstuhl-reports/volume13/issue03/DagRep.13.3/DagRep.13.3.pdf#subsection.3.2\n[ICFP ML track]: https://invidious.zapashcanon.fr/watch?v=i8PQXQ6a22Q\n[IFL'23]: https://ifl23.github.io/accepted_papers.html\n[OCaml]: https://ocaml.org\n[Wasm]: https://webassembly.org\n[Wasm-GC]: https://github.com/WebAssembly/gc\n[Wasm GC meeting]: https://github.com/WebAssembly/meetings/blob/main/gc/2023/GC-01-10.md\n[Wasm Research Day]: https://www.cs.cmu.edu/wrc/wrc-events\n[Wasocaml: compiling OCaml to WebAssembly]: https://inria.hal.science/hal-04311345\n[wasocaml-demo]: https://github.com/ocamlpro/wasocaml-demo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fwasocaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focamlpro%2Fwasocaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fwasocaml/lists"}