logoalt Hacker News

Bonsai: Janestreet's UI Library

264 pointsby KolmogorovComptoday at 8:29 AM100 commentsview on HN

Comments

flufluflufluffytoday at 10:00 AM

> 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 1 reply
bsmith89today at 4:23 PM

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

show 1 reply
chrischentoday at 11:38 AM

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 1 reply
rw2today at 11:51 AM

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 2 replies
cachiustoday at 2:28 PM

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

show 5 replies
user2342today at 1:19 PM

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

show 1 reply
Schlagbohrertoday at 12:16 PM

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 3 replies
xvilkatoday at 9:04 AM

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

show 1 reply
ubercoretoday at 11:13 AM

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

hahahaatoday at 9:19 AM

Oh it needs a userland trampoline!

> JSOO does not have tail call optimization

adastra22today at 11:46 AM

The “The thinking in bonsai” link 404s.

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

simonasktoday at 1:34 PM

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

kubbtoday at 9:53 AM

I wish there were more OCaml shops out there

MrBuddyCasinotoday at 12:45 PM

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.

bobjansentoday at 9:55 AM

This would of been cool back in 2014.

Trastertoday at 9:21 AM

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 2 replies
nbevanstoday at 11:46 AM

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.

Onavotoday at 4:29 PM

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.

phplovesongtoday at 2:29 PM

[flagged]

show 2 replies
gigatexaltoday at 11:00 AM

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.

tecoholictoday at 12:21 PM

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

show 2 replies
yuanBuildstoday at 1:36 PM

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 1 reply