Live data from Hacker News

Bonsai: Janestreet's UI Library

github.com

21–30 of 165 posts

Re: Bonsai: Janestreet's UI Library

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

Re: Bonsai: Janestreet's UI Library

#24

Earlier quoted context omitted.

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.

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

Re: Bonsai: Janestreet's UI Library

#26
post #4

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.

And there's nothing wrong with that. Many languages attempt to do the same thing. Why bother with 15 different languages if you can leverage one?

See also LiveView and Hologram for Elixir.

Post reply on HN