0xCaml From a System Engineer's Point of View
summary
Compares building the odiff image‑diff library across Zig, OCaml V4 and OCaml V5, finding Zig produces much smaller faster binaries (50 KB vs 1 MB) and that lack of SIMD and cross‑compilation in OCaml causes big slowdowns (70–150% slower on hot loops). Shows OCaml V5 features — stack allocation hints, raw float/hash types, capsules for race‑free parallelism — that cut allocations dramatically, but observes SIMD support is only intrinsics and portability is limited; an AVX‑512 rewrite even beats previous fastest implementations (AVX‑512 rewrite).
AI-written summary · about
chapters (18)
- 0:00Introduction and project
- 2:02Mobile support challenges
- 3:31Why switch to Zig
- 5:15Performance comparison
- 7:02Understanding OxCaml
- 8:09Stack allocations
- 10:39Compiler validations
- 12:25Memory layout optimization
- 14:24Nullable pointers
- 15:50Adopting OxCaml
- 17:19Performance metrics
- 18:55SIMD implementation
- 20:59Portable SIMD discussion
- 22:29Cross-platform SIMD
- 24:09VxDiff project
- 25:06Portability and tools
- 26:39Concurrency and safety
- 29:03Future and Q&A
related talks
26mAn Invitation to OCaml
15mDuplo: A Framework for OCaml Post-Link Optimisation
15mAmalgamating Different JIT Compilations in a Meta-tracing JIT Compiler Framework
20mAnalysis for Code Size Opportunities in RISC V
15mEfficient Compilation of Algebraic Effect Handlers
19mCode Size Reduction Deep Dive: Zc Extensions and Dictionary Compression Custom Instruction
17mRecent Developments in Optimizing Compilers for RISC-V
22mEfficient OCaml compilation with Flambda 2
