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_00_native.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,9 @@ The native-code compiler is available only on 64-bit systems (OCaml 5.0+):
33
33
-**ARM64 (AArch64)** - Linux, macOS (including Apple Silicon)
34
34
-**RISC-V** - Linux
35
35
-**IBM Z (s390x)** - Linux (OCaml 5.1+)
36
+
-**PowerPC (PPC64)** - Linux
37
+
38
+
All native code platforms use **63-bit integers** (with 1 bit reserved for the garbage collector tag).
36
39
37
40
**Windows:** Native compilation is supported via MSVC, MinGW, or Cygwin toolchains. See [OCaml on Windows](https://ocaml.org/docs/ocaml-on-windows) for setup details.
Copy file name to clipboardExpand all lines: data/tool_pages/platform/2ct_01_bytecode.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,8 @@ Bytecode provides several advantages over native compilation:
23
23
- Predictable and consistent execution behavior
24
24
- Easier debugging with built-in tools
25
25
26
+
The bytecode compiler can be built in either 32-bit or 64-bit mode, resulting in **31-bit or 63-bit integers**, respectively (with 1 bit reserved for the garbage collector tag).
27
+
26
28
## When to Use Bytecode
27
29
28
30
**Use bytecode** when you want fast compilation during development, need maximum portability, or are targeting platforms without a native code compiler.
Copy file name to clipboardExpand all lines: data/tool_pages/platform/2ct_03_wasm.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,16 +18,19 @@ WebAssembly is a binary instruction format designed as a portable compilation ta
18
18
## Available Tools
19
19
20
20
### wasm_of_ocaml
21
-
[wasm_of_ocaml](https://github.com/ocaml-wasm/wasm_of_ocaml) compiles OCaml bytecode to WebAssembly. It provides:
22
-
- Full OCaml language support, including the standard library
21
+
[wasm_of_ocaml](https://github.com/ocsigen/js_of_ocaml/blob/master/README_wasm_of_ocaml.md) compiles OCaml bytecode to WebAssembly. It provides:
22
+
- Full OCaml language support, including the standard library and OCaml 5 effects
23
23
- Compatibility with existing OCaml libraries
24
24
- Integration with JavaScript through Js_of_ocaml-style bindings
25
25
- Ability to run OCaml code in browsers and WASM runtimes
26
26
- Shared infrastructure with Js_of_ocaml for web development
27
+
-**31-bit integers** (similar to traditional OCaml bytecode on 32-bit systems)
28
+
29
+
**Note:** While wasm_of_ocaml supports OCaml 5 effects, it has limited support for Domains (multicore parallelism).
27
30
28
31
wasm_of_ocaml is ideal when you want to leverage existing OCaml code with WebAssembly's performance characteristics while maintaining compatibility with the OCaml ecosystem.
29
32
30
-
Visit the [wasm_of_ocaml repository](https://github.com/ocaml-wasm/wasm_of_ocaml) 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.
33
+
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.
31
34
32
35
### Wasocaml
33
36
[Wasocaml](https://github.com/OCamlPro/wasocaml) is an OCaml compiler that targets WebAssembly GC (WASM-GC). Developed by OCamlPro, it provides:
@@ -36,6 +39,9 @@ Visit the [wasm_of_ocaml repository](https://github.com/ocaml-wasm/wasm_of_ocaml
36
39
- Optimized performance through the Flambda optimizer
37
40
- Support for functional programming language features in WebAssembly
38
41
- First real-world functional language compiler targeting WASM-GC
42
+
-**31-bit integers** (similar to traditional OCaml bytecode on 32-bit systems)
43
+
44
+
**Note:** Wasocaml is based on OCaml 4.14 and does not currently support OCaml 5 effects or multicore features.
39
45
40
46
Wasocaml is ideal when you need direct compilation to WebAssembly with garbage collection support and want to benefit from Flambda optimizations.
Copy file name to clipboardExpand all lines: data/tool_pages/platform/2ct_04_unikernels.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: "Compile OCaml to specialized unikernel targets using MirageOS. Cre
6
6
category: "Compilation Targets"
7
7
---
8
8
9
-
OCaml can compile to specialized unikernel targets through [MirageOS](https://mirage.io), a library operating system that creates secure, high-performance single-purpose applications.
9
+
OCaml can compile to specialized unikernel targets through [MirageOS](https://mirage.io), a library operating system that creates secure, single-purpose applications.
10
10
11
11
## What are Unikernels?
12
12
@@ -27,15 +27,18 @@ MirageOS supports compilation to several unikernel backends:
27
27
28
28
[Solo5](https://github.com/Solo5/solo5) is a sandboxed execution environment that provides multiple deployment options:
29
29
30
-
-**hvt** (Hardware Virtualized Tender) - Runs on KVM/Linux and bhyve/FreeBSD with minimal overhead
30
+
-**hvt** (Hardware Virtualized Tender) - Runs on KVM/Linux, bhyve/FreeBSD, and vmm/OpenBSD with minimal overhead
31
31
-**spt** (Sandboxed Process Tender) - Runs as a regular Unix process with seccomp sandboxing on Linux
32
32
-**virtio** - Runs on standard virtio-based hypervisors including QEMU/KVM, Google Compute Engine, and OpenStack
33
33
-**muen** - Runs on the Muen Separation Kernel
34
-
-**genode** - Runs on the Genode OS framework
34
+
-**xen** - Runs on the Xen hypervisor as a paravirtualized guest (PVHv2 mode)
35
35
36
-
### Xen
36
+
### Unikraft Targets
37
37
38
-
-**xen** - Runs on the Xen hypervisor as a paravirtualized guest (PVHv2 mode)
38
+
[Unikraft](https://unikraft.org) is a general Unikernel Development Kit that can be used as a MirageOS backend:
39
+
40
+
-**unikraft-qemu** - Runs on the [QEMU](https://www.qemu.org/) virtual machine monitor
41
+
-**unikraft-firecracker** - Runs on the [Firecracker](https://firecracker-microvm.github.io/) virtual machine monitor
39
42
40
43
### Unix
41
44
@@ -45,14 +48,16 @@ MirageOS supports compilation to several unikernel backends:
45
48
46
49
**Use Unix** when you're developing and testing your unikernel locally.
47
50
48
-
**Use hvt** when you want lightweight virtualization on Linuxor FreeBSD with KVMor bhyve.
51
+
**Use hvt** when you want lightweight virtualization on Linux, FreeBSD, or OpenBSD with KVM, bhyve, or vmm.
49
52
50
53
**Use virtio** when deploying to cloud providers like Google Compute Engine, or standard KVM/QEMU setups.
51
54
52
55
**Use spt** when you want process-level isolation on Linux without full virtualization.
53
56
54
57
**Use Xen** when deploying to Xen-based infrastructure or cloud providers that support Xen.
55
58
59
+
**Use Unikraft targets** when you want to use the Unikraft unikernel framework with QEMU or Firecracker.
60
+
56
61
## Getting Started
57
62
58
63
To start building unikernels with OCaml, visit the [MirageOS Getting Started Guide](https://mirage.io/docs/). The guide walks you through:
0 commit comments