You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/tool_pages/platform/2ct_03_wasm.md
+7-10Lines changed: 7 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,34 +34,31 @@ wasm_of_ocaml is ideal when you want to leverage existing OCaml code with WebAss
34
34
35
35
Visit the [wasm_of_ocaml documentation](https://github.com/ocsigen/js_of_ocaml/blob/master/README_wasm_of_ocaml.md) in the Js_of_ocaml repository to learn how to install and set up wasm_of_ocaml, compile OCaml programs to WebAssembly, interact with JavaScript APIs from WASM, and deploy WASM modules in web applications.
36
36
37
-
### Wasocaml
37
+
### Wasocaml (Experimental)
38
38
39
-
[Wasocaml](https://github.com/OCamlPro/wasocaml) is an OCaml compiler that targets WebAssembly GC (WASM-GC). Developed by OCamlPro, it provides:
39
+
[Wasocaml](https://github.com/OCamlPro/wasocaml) is an experimental OCaml compiler developed by OCamlPro that targets WebAssembly GC (WASM-GC). As a research project exploring direct compilation to WASM-GC, it provides:
40
40
- Direct compilation from OCaml's Flambda intermediate representation to WASM-GC
41
41
- Native WebAssembly garbage collection support
42
42
- Optimized performance through the Flambda optimizer
43
43
- Support for functional programming language features in WebAssembly
44
-
- First real-world functional language compiler targeting WASM-GC
45
44
-**31-bit integers** (similar to traditional OCaml bytecode on 32-bit systems)
46
45
47
-
**Note:** Wasocaml is based on OCaml 4.14 and does not currently support OCaml 5 effects or multicore features.
46
+
**Important limitations:** Wasocaml is based on OCaml 4.14 and does not currently support OCaml 5 effects or multicore features. As an experimental project, it should be considered for research and experimentation rather than production use.
48
47
49
-
Wasocaml is ideal when you need direct compilation to WebAssembly with garbage collection support and want to benefit from Flambda optimizations.
50
-
51
-
Visit the [Wasocaml repository](https://github.com/OCamlPro/wasocaml) and [OCamlPro's blog posts](https://ocamlpro.com/blog/2022_12_14_wasm_and_ocaml/) to learn how to install the Wasocaml compiler switch, compile OCaml programs to WASM-GC, understand the compilation process and optimizations, and deploy to WebAssembly runtimes.
48
+
Visit the [Wasocaml repository](https://github.com/OCamlPro/wasocaml) to learn how to install the Wasocaml compiler switch and explore its experimental features.
52
49
53
50
## Choosing a Tool
54
51
55
-
**Use wasm_of_ocaml**when you want to run existing OCaml bytecode in WebAssembly environments, need compatibility with Js_of_ocaml web bindings, or want a mature toolchain similar to Js_of_ocaml.
52
+
**Use wasm_of_ocaml**for most WebAssembly projects. It provides a mature toolchain for running existing OCaml bytecode in WebAssembly environments, with compatibility with Js_of_ocaml web bindings and OCaml 5 support.
56
53
57
-
**Use Wasocaml**when you need direct compilation with Flambda optimizations, want to target the WebAssembly GC proposal, or are building performance-critical applications.
54
+
**Explore Wasocaml**if you're interested in experimental approaches to WebAssembly compilation or researching direct compilation to WASM-GC, keeping in mind its current limitations and experimental status.
58
55
59
56
## Learn More
60
57
58
+
-[Dune Manual: Executable Linking Modes](https://dune.readthedocs.io/en/stable/reference/dune/executable.html#linking-modes) - How to specify native, bytecode, or other compilation modes in Dune
61
59
-[ocaml-wasm Organization](https://github.com/ocaml-wasm) - Coordination hub for OCaml WebAssembly efforts
62
60
-[WebAssembly.org](https://webassembly.org/) - WebAssembly specification and documentation
63
61
-[WASM-GC Proposal](https://github.com/WebAssembly/gc) - Garbage Collection proposal for WebAssembly
64
-
-[OCamlPro WASM Blog Posts](https://ocamlpro.com/blog/tags/wasm/) - Technical deep dives on Wasocaml
0 commit comments