finds.dev

jordwalke/flex

Reason CSS Flexbox implementation

View on GitHub

★ 389ReasonNOASSERTIONupdated Mar 2024

// the take

A native Reason port of Facebook's Yoga flexbox layout engine, targeting OCaml's native compiler and JS via js_of_ocaml. The benchmark story is the real pitch: native Reason beats C at the same algorithm, which is a genuine data point for anyone evaluating OCaml/Reason for performance-sensitive work. Useful if you're building a native UI toolkit or embedding layout in a non-browser context.

The cross-runtime benchmark suite is thorough and honest — same algorithm, different targets, apples-to-apples numbers. Native Reason outperforming C at 0.26ms vs 0.33ms per test is surprising and the methodology is sound enough to trust. The gentest tooling that generates test cases from real browser layout is a smart way to stay spec-compliant without handwriting hundreds of test cases. The C stub/FFI integration path means you can call into this from any language that speaks C ABI.

Last meaningful commit was 2024 but the codebase is effectively frozen — it's a port of a specific Yoga revision, and Yoga itself has moved significantly since. The build tooling is a graveyard of half-migrated systems: jbuilder files sitting next to dune files, npm scripts wrapping esy, a package.json in an OCaml project. Switching between fixed-point and float encodings requires manually editing source files and package.json, which is a sign this was never finished. The README buries actual usage behind benchmarking docs — there's no API reference and no example of integrating this into an actual application.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
389
Forks
25
Language
Reason
License
NOASSERTION
Last commit
12 Mar 2024

// nearby

If flex isn't quite it.

All repos →