Bonsai: Janestreet's UI Library

261 points92 comments13 hours ago
flufluflufluffy

> And because Bonsai is written in OCaml, it becomes possible to use the same language and types on both the backend and frontend.

Finally! I was waiting for this to become possible!

show comments
bsmith89

There's a great Signals and Threads (Jane Street's Podcast) episode about this work: https://signalsandthreads.com/building-a-ui-framework/

show comments
chrischen

Curious how this compares to Melange which is used by Ocaml shops as well to double up on Ocaml for both front and backend (ahrefs being the major user and sponsor). Does this mean giving up a lot of the JS ecosystem (React, graphql, etc)?

show comments
rw2

I am sure it's very performant, but to me it's extremely ugly; Surely someone can fix margins and still have it be performant.

show comments
cachius

What does JaneStreet do besides sponsoring nerdy Youtube channels and writing UI libraries?

show comments
user2342

Interesting! What are Bonsai's dependencies? I use OCaml but - so far - none of Janestreets libraries etc.

show comments
Schlagbohrer

Can someone who understands web UI programming tell me if this would be good for my local agent to use to produce HTML based reports and outputs for me? Or for TUI outputs?

show comments
xvilka

Looks like it's Web-only, no mention of the native UI support (terminal UI excluded).

show comments
ubercore

Not sure why, but reminds me of Fog Creek's Wasabi.

hahahaa

Oh it needs a userland trampoline!

> JSOO does not have tail call optimization

show comments
adastra22

The “The thinking in bonsai” link 404s.

This says it is based on Elm. So it has the same clean immutable state structure?

simonask

I really want to like OCaml. One day I'll get around to learning it.

kubb

I wish there were more OCaml shops out there

MrBuddyCasino

This is great. It focuses on utility and information density over design. It looks like someone took a terminal UI and transplanted it to the web, Bloomberg terminal style.

I'm pretty sure you can build tools with this that are fast and pleasant to use.

bobjansen

This would of been cool back in 2014.

show comments
Traster

The "Why Bonsai?" I found really funny.

Let me re-write that section for you:

Why Bonsai?

At Jane Street we're super excited by Functional programming and by CAML in particular, so when we need low latency software, we use OCAML, when we need hardware, we write out own langauge - HardCAML, and when we need a Web UI, we build a Web UI framework in CAML. Because we fucking love CAML.

show comments
nbevans

It looks like a nice little library; but oh boy must this be so limiting for the product teams that are forced to use. Everything looks like it's straight out of the 1990s.

Onavo

Considering how ridiculously verbose their library is compared to React/Vue it's a good thing we have LLMs to deal with the boilerplate now.

gigatexal

All your money and retirement funds are safe; I’m too dumb to work at JaneStreet; every time I see OCAML I feel less than and confused.

tecoholic

Why does this library get posted here, what feels like every month? I remember it seeing at least twice before.

show comments
yuanBuilds

It might be a very performant UI framework in OCaml, but all the UI elements look extremely unpolished to me, like what a really smart high-school kid would build the GUI for his side project on Windows in 90s.

Thanks, I can use JS as a functional programming language.

show comments