Rendered at 11:45:43 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
chrischen 7 minutes 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)?
flufluflufluffy 2 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!
philipwhiuk 46 minutes ago [-]
Similar attempts include Scalajs.
The general challenge becomes integrating the fractional front-end code written in your backend-language that compiles to JS with the rest of the JS ecosystem.
JaneStreet have a love of writing their own stuff from scratch so it doesn't apply to them but it might to you.
Hence most people end up with frontend-as-backend rather than backend-as-frontend.
Couldn't WASM solve that problem once and for all? Is there some limitation that WASM has that JS doesn't?
Disclaimer: I am very inexperienced at front-end development.
ubercore 32 minutes ago [-]
Not sure why, but reminds me of Fog Creek's Wasabi.
xvilka 3 hours ago [-]
Looks like it's Web-only, no mention of the native UI support (terminal UI excluded).
avsm 2 hours ago [-]
There's a full terminal implementation of Bonsai as well. I actually use it in my personal workflow these days to manage my contacts database! https://anil.recoil.org/notes/aoah-2025-9
aquariusDue 32 minutes ago [-]
Unrelated but what do you use to manage your personal website? I love how everything is interconnected.
kubb 2 hours ago [-]
I wish there were more OCaml shops out there
hahahaa 2 hours ago [-]
Oh it needs a userland trampoline!
> JSOO does not have tail call optimization
bobjansen 2 hours ago [-]
This would of been cool back in 2014.
gigatexal 46 minutes 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.
Traster 2 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.
bofeiw 2 hours ago [-]
Agreed, looks like it's reinventing the wheels. Frameworks does not really matter today, AI agents write the code anyway.
KolmogorovComp 2 hours ago [-]
But AI do benefit a lot from a strict compiler, and having a simple language improve a lot on type-safety, so I don't think it is to throw, even today.
rmzs0711 2 hours ago [-]
But what about compilation speed? Hot reload? Maintainability? What is the bus factor for these kind of technologies?
Yea, its cool to have strict type safety, but what's the point of it doesn't have all the benefits from other Frameworks that took years to polish
OtherShrezzing 42 minutes ago [-]
JaneStreet has enough free cash to not worry about those issues. If one of their key persons dies in service, they can go out and contract the worlds leading expert in that domain, and their annualised rate isn’t even a rounding error on their bottom line.
shAIster 32 minutes ago [-]
AI certainly writes Internet comments so that the flock does not have a single minute to get independent thoughts.
ForHackernews 2 hours ago [-]
Better frameworks will still help AIs avoid silly mistakes. A smarter framework means you can be productive with a dumber/cheaper AI.
Finally! I was waiting for this to become possible!
The general challenge becomes integrating the fractional front-end code written in your backend-language that compiles to JS with the rest of the JS ecosystem.
JaneStreet have a love of writing their own stuff from scratch so it doesn't apply to them but it might to you.
Hence most people end up with frontend-as-backend rather than backend-as-frontend.
https://ocsigen.org/ in Ocaml too
https://websharper.com/ for fsharp and csharp. Really good when I used in in fsharp
Maybe https://melange.re/v7.0.1/ too? (Not sure)
Disclaimer: I am very inexperienced at front-end development.
> JSOO does not have tail call optimization
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.
Yea, its cool to have strict type safety, but what's the point of it doesn't have all the benefits from other Frameworks that took years to polish