# janestreet/bonsai

A library for building dynamic webapps, using Js_of_ocaml

Repository: https://github.com/janestreet/bonsai
Canonical: https://ross.abutalabs.com/products/janestreet-bonsai
Language: OCaml
License: MIT
License Family: permissive
Last push: 2026-07-10T16:45:34+00:00

## Health v2 (maintenance only)
Score: 64/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 91, release rhythm 8, longevity 100
- inputs: {"age_days": 2480, "days_push": 54, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1390, forks 57 (observed 2026-08-28T04:04:35.522054+00:00)

## What it is
Bonsai is an OCaml library for building performant, reactive web applications on top of Js_of_ocaml, inspired by Elm. It uses purely functional state-machine components with incremental computation so values are only recomputed when their dependencies change.

## Use cases
- build reactive web apps in OCaml
- create interactive UIs with incremental rendering
- manage stateful UI components without hoisting state to top level
- incrementalize expensive business logic on live-updating data
- build internal tools and dashboards
- compose state and rendering primitives a la carte

## When to choose
- you write OCaml and want to target the web
- you need fine-grained incremental updates beyond just views
- you want Elm-style functional state machines with strong composability
- you're building data-heavy internal tools with live-updating datasets

## When to avoid
- your team doesn't know OCaml or Jane Street's ecosystem
- you need a large ecosystem of ready-made UI components and libraries
- you want mainstream community support, tutorials, and hiring pool
- you're building a simple static site

## Facets
- artifact type: framework
- maturity: active
- function: frontend-framework, state-management, ui-components, web-framework
- domain: web-development, frontend
- platform: browser, cross-platform
- tags: ocaml, js-of-ocaml, reactive-ui, incremental-computation, elm-inspired, web-server

## Member repositories
- janestreet/bonsai (main) score 64

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:35.522054+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:39:39.213162+00:00, confidence not recorded.
  - readme: https://github.com/janestreet/bonsai (fetched 2026-08-28T04:04:35.522054+00:00, sha 0f8e559bb857)
- Data as of 2026-08-30T08:39:29.467469+00:00.
