For a while I tired to go for GHCJS but its slow to compile and pain to setup. This would be easy if you know nix but currently I have lot to learn Haskell. So looking at Haste now the last commit is in 2019. Will it ever be updated ? I curious on how it would evolve.
Just in case you are interested in alternatives: PureScript shares many features with Haskell, has a nice JS FFI and is quite actively maintained (new version just shipped a few weeks back).
I very much like it - in some cases it’s even better than Haskell (I think most would agree the records are at least).
There is also Elm - which is great for getting into FP, has very nice error-messages and a very active and friendly community but lacks quite a few features and it’s development and direction is not very transparent to all but a few insiders so it seems stale at times.
Personally I really like it to onboard new team-members but I feel it’s to constricting in the long run - especially if you come from Haskell.
I love working with PureScript, it feels cleaner in lots of regards and the library ecosystem and import structure is really clean.
Conversely, I recently finished an Obsidian systems Obelisk project. Obelisk is a mighty framework that uses GHCJS and reflex-frp (and it relies on Nix, too, for the build logic). There I used
servant for an API that is kind of guaranteed to be correct, both client-side and server-side, as long as the compiler doesn’t complain.
My main reason to work with obelisk was reflex-frp, though. Unfortunately PureScript doesn’t have that as far as I know.
Very well said.
If you really want or need to tightly share models/api-definition between server and client that is surely the best way to do it (same for doing node.js/js etc.).
Personally I actually like the break - it means you really need the interface to be somewhat stable and well documented between teams/members of your team.
There is a bridge but to be honest I think it’s not really used widely and probably not that well-maintained.
Ultimately I’d love to see Swagger/OpenAPI support for both languages (I know there is something that let’s you generate this from Servant but I think the better way is to start from the OpenAPI Definition and generate clients from there) - maybe some day (or maybe there and I’m ignorant of the fact - if so please let me know )
By the way, and slightly off topic, I love PureScript so much that I would wholeheartedly recommend it to anyone who wants to learn programming. Recommending PureScript over Python might be unorthodox but if it’s about the best learning experience long-term functional programming seems preferable to me. And I would recommend PureScript over Haskell (or other language) for its cleanliness and how easy you can get started.
I can’t answer your question about Haste but I can respond to this:
We are currently working on merging GHCJS’s code generator and runtime system into GHC.
So ultimately it should become as easy to use as normal GHC, be distributed via ghc-up, etc
The latest update about this work is here: GHC April 2022 Update | IOG Engineering
yes for small (demo?) stuff purescript with express on node is actually not bad - not sure if I’d really consider this for production though - there are some Mongo bindings but aside from this you’ll probably have to FFI much of the stuff you’ll usually do in the backend
Thanks for the hint for specular - don’t think I’ve noticed that before