A library for building dynamic webapps, using Js_of_ocaml
Browse cluster: OCaml incremental computation and PPX tooling →Bonsai is a UI library for building performant, reactive web applications in OCaml using Js_of_ocaml, created and used at Jane Street. The library implements components as purely functional state machines with incremental rendering, allowing only relevant parts of the state to be recomputed when they change. Beyond web UIs, Bonsai is a general-purpose framework for building incremental, composable state machines, with specialized variants like Bonsai_web for browser-based interfaces and Bonsai_term for terminal-based UIs, along with associated testing, component, and preprocessor libraries. The repository also includes ppx_bonsai, a preprocessor rewriter that provides syntax extensions like `let%sub`, `match%sub`, and `let%arr` for more ergonomic state and computation management, and Trampoline, a monad designed to prevent stack overflow issues in deeply recursive Js_of_ocaml programs by avoiding the lack of tail call optimization.