Re:Gleam, Coming from Erlang
by ameliaquining on Friday February 28, 2025 @12:15PM
(#43207963)
DOM APIs are only available in JavaScript, so doing things in the browser in a non-JavaScript language requires FFI—and it's a general truism of programming that FFI tends to be a pain point. Languages that target client-side app development try to compensate for this by offering language-native DOM abstractions of higher or lower quality, but usually you end up having to do something that these abstractions didn't anticipate, and/or incorporate a third-party library from npm, which forces you back into FFI. On the server it's much rarer for some critical piece of functionality to be available only in one language, because the server environment itself is language-agnostic.
[ Parent
| on HN ]
Re:Gleam, Coming from Erlang
by greener_grass on Friday February 28, 2025 @12:47PM
(#43208354)
F# allows you to use React pretty much directly, but it has still been only a modest success.
I think F# suffers from being a second class citizen to C# inside of Microsoft. If it ran on a different VM or got more attention it may be more popular. It seems quite nice.
Re:Gleam, Coming from Erlang
by greener_grass on Monday March 03, 2025 @04:37AM
(#43240032)
Without access to the .NET ecosystem it would be dead in the water
As another comment said, you can write client side code in F# which gets transpiled to JS, just like Typescript or CoffeeScript. This approach allows you to use JSX components directly from your F# code. It's very cool. Other FP languages have something similar.
https://www.compositional-it.com/news-blog/fsharp-react-seri...
Re:Gleam, Coming from Erlang
by AlchemistCamp on Friday February 28, 2025 @07:02PM
(#43213670)
I suspect a lot of people who might otherwise go to F# are using ReScript for React.