A really great place to reach for this is Elixir/Phoenix now that the set theoretic type system is in place with LiveView. I have been doing some pretty large/complex codebases gradually working towards fully integrating working this way for the past 5 years and it has been great.
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.
> Is there some limitation that WASM has that JS doesn't?
You need a JS trampoline to call your WASM and make browser primitives available to it, and IIRC calls into browser code incur some extra overhead, but those are pretty manageable.
Additionally: for high level languages, source code is _much_ smaller than compiled binaries. If your initial needs are simple, your users are likely downloading more than 10x as much code.
WASM does not (yet) have access to the DOM or web APIs, meaning every direct interaction with the browser must first go through JS interop anyways, with a resulting performance penalty. There are proposals, and maybe we'll see it happen by 2035, but as of now WASM is best suited for heavier workloads where the edge in application performance outweighs the cost of JS interop with the browser rather than being a universal solution.
A framing from that podcast that helped me better understand the role of Bonsai is that it's really a framework for building incremental distributed state machines.
This framing is also in the post. From the readme:
> Bonsai itself -- this library -- is actually more generic than the above makes it sound. It allows you to build general-purpose incremental, composable state machines. Bonsai_web builds on top of that core library, specializing it for interactive browser-based UIs, but we also have Bonsai_term for building interactive terminal-based UIs.
FWIW if you listen to Signals and Threads (the Jane Street podcast) they talk about this.
They have dedicated UX designers who do relatively little code but focus entirely on making the UX as optimal for the traders as possible and one of them was on an episode.
They talked about how most of the normal UX rules for SW go out the window because quants and traders have such different needs than "normal software".
This matters. Beyond performance (a universal good), the definition of "good" UX is strictly dependent on the user. Fintech platforms for traders who open a multi-window thick client application(s) and spend hours in it every day have little in common with consumer mobile apps designed to hold your attention for maybe a minute. It's mind-bogglingly lazy to choose something like MUI (Material UI) as if it were some kind of reasonable foundation irrespective of context.
Is there any professional software that wouldn't benefit from high information density? Most software design is optimized for the non-users who have to approve it.
"non-users" are also big targets for software. If you run a software business, chances are you want people who've never used your software to start using your software. In that case, discoverability trumps high information density.
It only adds discoverability for the things that fit the screen. In other words, you have to make it simple. I.e. the lazy way to make something "user-friendly", do as little as possible and force the user to adapt to your ways instead.
this - most of the internal software at my job that's actually important is very dense, with keyboard navigation and shortcuts. The ones that somebody makes to sell themselves to upper management while angling for a promotion look very pretty, and never get used.
And yet, we make such beautiful and vacant software ourselves for our clients, because again, its b2b, so you aren't selling to the people who actually have to use the software. Im glad at least we arent forced that often to use specific internal tools, the better ones just get adopted organically
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)?
They're a trading firm that hires really clever people to use math to trade. Their strategies are, presumably, very complicated and ever changing, and secrecy about them is the point - you get bigger margins for longer if people don't learn about your 'one weird trick' (that and also that there is presumably another side to your trades losing out on upside, and they might not be best pleased to learn about it.
This doesn't seem quite as clear-cut as you're making out.
The Securities and Exchange Board of India (SEBI) have accused Jane Street (JS) of market manipulation, JS claims it was legitimate arbitrage, and the case is still ongoing [1].
As I understand it, the ban only applied to Indian securities (not Asian markets as a whole), and was lifted back in July 2025 after JS paid ~$560 million (the alleged ill-gotten gains) into an escrow fund. They don't appear to have resumed trading, though [2].
The above might be too far-fetched as it only applied to India? They did pay a fine to the regulator and resumed trading (might not be the same strategy though)
To OP’s original question, they made $20B last year and have a niche in several financial products
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?
The main thing that Bonsai gets you is a nice programming model for making your UIs interactive. If you're mostly producing static reports (with maybe some basic interactive visualization widgets or something), it will not get you much over generating some variant on HTML + JS.
It makes more sense for applications where you have complex interactive logic in the UI, with a lot of different components that need to control and display some shared state.
There was this submission two months ago: https://news.ycombinator.com/item?id=48365904 . Basically they have a TUI frontend for the same thing. And the blog post says: "Bonsai_term would feel familiar to anyone who’d ever done web development here, and it had the huge advantage of being especially amenable to AI assistance. It was actually somewhat of a mystery to us how good the models were at writing Bonsai_term code, given how relatively obscure it is [...]"
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
Custom infrastructure; I use my site as a playground for various things over the years. It ran as the first MirageOS unikernel for many years, and recently it's been running on a zero-allocation OxCaml webserver https://anil.recoil.org/notes/oxcaml-httpz to help me get to grips with the new extensions.
Jsoo supports self-recursive and mutually recursive tail calls, but for general tail calls it would need to trampoline every single call, since the only major browser with proper tail calls is Safari.
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.
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.
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.
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.
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.
Janestreet was banned from asian markets for market manipulation. They took in billions and fisted the average-joe investor. As a high profile ocaml user that casts a big shadow on ocaml too, as many involved in janestreet are also part of ocaml core team in some way.
I wont buy ignorance, as devs clearly know whats going on, so staying silent is pretty much being just as guilty.
If you read up on it that was basically India protecting its corrupt cronies. Janestreet showed severe problems with some Indian companies and instead of fixing that and creating a healthier and more transparent market they decided to go after the messenger.
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.
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.
Disclaimer: I am very inexperienced at front-end development.
You need a JS trampoline to call your WASM and make browser primitives available to it, and IIRC calls into browser code incur some extra overhead, but those are pretty manageable.
Additionally: for high level languages, source code is _much_ smaller than compiled binaries. If your initial needs are simple, your users are likely downloading more than 10x as much code.
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)
Sarcasm?
Do you want to have a talk as to why JaneStreet wasn't built on JavaScript?
> Bonsai itself -- this library -- is actually more generic than the above makes it sound. It allows you to build general-purpose incremental, composable state machines. Bonsai_web builds on top of that core library, specializing it for interactive browser-based UIs, but we also have Bonsai_term for building interactive terminal-based UIs.
They have dedicated UX designers who do relatively little code but focus entirely on making the UX as optimal for the traders as possible and one of them was on an episode.
They talked about how most of the normal UX rules for SW go out the window because quants and traders have such different needs than "normal software".
And yet, we make such beautiful and vacant software ourselves for our clients, because again, its b2b, so you aren't selling to the people who actually have to use the software. Im glad at least we arent forced that often to use specific internal tools, the better ones just get adopted organically
We are at a point when TUIs from 1990s running in 12" screens with at best a 480x240 resolution display more info than almost anything we have now.
[0]: https://github.com/janestreet/bonsai/blob/f31661450eb133fe89...
Sam Bankman-Fried and his League of Legend rankings would like a word
EDIT.
Janestreet PR team is downvoting. Like always, radio silence and just downvotes.
I had expected more from janestreet.
The Securities and Exchange Board of India (SEBI) have accused Jane Street (JS) of market manipulation, JS claims it was legitimate arbitrage, and the case is still ongoing [1].
As I understand it, the ban only applied to Indian securities (not Asian markets as a whole), and was lifted back in July 2025 after JS paid ~$560 million (the alleged ill-gotten gains) into an escrow fund. They don't appear to have resumed trading, though [2].
[1]: https://www.reuters.com/legal/government/us-trading-firm-jan...
[2]: https://www.reuters.com/sustainability/boards-policy-regulat...
To OP’s original question, they made $20B last year and have a niche in several financial products
You're being downvoted for having a needlessly confrontational underinformed hot take on a quant trading firm that is essentially a market maker.
It makes more sense for applications where you have complex interactive logic in the UI, with a lot of different components that need to control and display some shared state.
This says it is based on Elm. So it has the same clean immutable state structure?
> JSOO does not have tail call optimization
Presumably this has learned some lessons from it, so it's probably better.
I'm pretty sure you can build tools with this that are fast and pleasant to use.
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.
See also LiveView and Hologram for Elixir.
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
Janestreet was banned from asian markets for market manipulation. They took in billions and fisted the average-joe investor. As a high profile ocaml user that casts a big shadow on ocaml too, as many involved in janestreet are also part of ocaml core team in some way.
I wont buy ignorance, as devs clearly know whats going on, so staying silent is pretty much being just as guilty.
Thanks, I can use JS as a functional programming language.