| ▲ | Bonsai: Janestreet's UI Library(github.com) |
| 105 points by KolmogorovComp 5 hours ago | 41 comments |
| |
|
| ▲ | flufluflufluffy 3 hours ago | parent | next [-] |
| > 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! |
| |
| ▲ | deciduously 9 minutes ago | parent | next [-] | | There's also Fable for F# but I believe this commenter is being sarcastic. Javascript is a common backend language. | | | |
| ▲ | philipwhiuk 2 hours ago | parent | prev [-] | | 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. | | |
| ▲ | raphinou 2 hours ago | parent | next [-] | | Such attempts are quite common. Some I remember: 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) | | |
| ▲ | vintermann 15 minutes ago | parent [-] | | I took this as a joke in reference to the popularity of JavaScript on the backend for the last two decades. | | |
| |
| ▲ | lbourdages 2 hours ago | parent | prev | next [-] | | 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. | | |
| ▲ | danielheath an hour ago | parent [-] | | > 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. |
| |
| ▲ | nobleach 40 minutes ago | parent | prev [-] | | Yup, and Clojure/ClojureScript! |
|
|
|
| ▲ | rw2 an hour ago | parent | prev | next [-] |
| 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. |
| |
| ▲ | pgwhalen an hour ago | parent [-] | | I’m no UI expert - what’s wrong with the margins? | | |
| ▲ | LooseEquipment 36 minutes ago | parent [-] | | inconsistent and maybe too tight, but I would think those are issues with the sample UIs and not this library | | |
| ▲ | pgwhalen 6 minutes ago | parent | next [-] | | From experience I can say that traders prefer extraordinarily little whitespace in their UIs. | |
| ▲ | ctxc 16 minutes ago | parent | prev [-] | | Probably because they skew towards higher information density |
|
|
|
|
| ▲ | chrischen 2 hours ago | parent | prev | next [-] |
| 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)? |
|
| ▲ | Schlagbohrer an hour ago | parent | prev | next [-] |
| 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? |
| |
| ▲ | antonvs 20 minutes ago | parent [-] | | Probably not, because your agent won’t have much info about this tool in its training set. |
|
|
| ▲ | tecoholic an hour ago | parent | prev | next [-] |
| Why does this library get posted here, what feels like every month? I remember it seeing at least twice before. |
| |
|
| ▲ | adastra22 an hour ago | parent | prev | next [-] |
| The “The thinking in bonsai” link 404s. This says it is based on Elm. So it has the same clean immutable state structure? |
|
| ▲ | ubercore 2 hours ago | parent | prev | next [-] |
| Not sure why, but reminds me of Fog Creek's Wasabi. |
|
| ▲ | xvilka 4 hours ago | parent | prev | next [-] |
| Looks like it's Web-only, no mention of the native UI support (terminal UI excluded). |
| |
|
| ▲ | MrBuddyCasino 29 minutes ago | parent | prev | next [-] |
| 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 3 hours ago | parent | prev | next [-] |
| This would of been cool back in 2014. |
|
| ▲ | nbevans an hour ago | parent | prev | next [-] |
| 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. |
|
| ▲ | hahahaa 4 hours ago | parent | prev | next [-] |
| Oh it needs a userland trampoline! > JSOO does not have tail call optimization |
|
| ▲ | kubb 3 hours ago | parent | prev | next [-] |
| I wish there were more OCaml shops out there |
|
| ▲ | gigatexal 2 hours ago | parent | prev | next [-] |
| 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 4 hours ago | parent | prev [-] |
| 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. |
| |
| ▲ | troupo an hour ago | parent | next [-] | | 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. | |
| ▲ | bofeiw 3 hours ago | parent | prev [-] | | Agreed, looks like it's reinventing the wheels. Frameworks does not really matter today, AI agents write the code anyway. | | |
| ▲ | KolmogorovComp 3 hours ago | parent | next [-] | | 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 3 hours ago | parent [-] | | 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 2 hours ago | parent [-] | | 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 2 hours ago | parent | prev | next [-] | | AI certainly writes Internet comments so that the flock does not have a single minute to get independent thoughts. | |
| ▲ | ForHackernews 3 hours ago | parent | prev [-] | | Better frameworks will still help AIs avoid silly mistakes. A smarter framework means you can be productive with a dumber/cheaper AI. |
|
|