Bonsai: Janestreet's UI Library

github.com

258 points by KolmogorovComp 12 hours ago


flufluflufluffy - 11 hours ago

> 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!

bsmith89 - 4 hours ago

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

chrischen - 9 hours ago

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)?

rw2 - 9 hours ago

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.

cachius - 6 hours ago

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

user2342 - 7 hours ago

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

Schlagbohrer - 8 hours ago

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?

xvilka - 12 hours ago

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

ubercore - 9 hours ago

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

hahahaa - 11 hours ago

Oh it needs a userland trampoline!

> JSOO does not have tail call optimization

adastra22 - 9 hours ago

The “The thinking in bonsai” link 404s.

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

simonask - 7 hours ago

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

kubb - 11 hours ago

I wish there were more OCaml shops out there

MrBuddyCasino - 8 hours ago

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 - 11 hours ago

This would of been cool back in 2014.

Traster - 11 hours ago

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.

nbevans - 9 hours ago

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 - 4 hours ago

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.

phplovesong - 6 hours ago

[flagged]

gigatexal - 10 hours ago

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 - 8 hours ago

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

yuanBuilds - 7 hours ago

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.