logoalt Hacker News

flufluflufluffytoday at 10:00 AM5 repliesview on HN

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


Replies

kccqzytoday at 7:34 PM

Why wait? It’s been possible since forever. I wrote UI in OCaml eight years ago. https://github.com/kccqzy/drawing-guessing/blob/master/clien...

deciduouslytoday at 1:06 PM

There's also Fable for F# but I believe this commenter is being sarcastic. Javascript is a common backend language.

show 1 reply
rhgraysoniitoday at 3:19 PM

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.

philipwhiuktoday at 10:59 AM

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.

show 3 replies
TacticalCodertoday at 1:53 PM

> Finally! I was waiting for this to become possible!

Sarcasm?

Do you want to have a talk as to why JaneStreet wasn't built on JavaScript?