4 ms·
Question is why? What’s better about PureScript that would make other FP programmers (eg; Elm) choose over it?
by jaequery 7y ago
Question is why? What’s better about PureScript that would make other FP programmers (eg; Elm) choose over it?
- eweise 7y agoMore powerful abstractions that reduce the amount boilerplate compared to Elm.
- ff_ 7y agoOne of the biggest reasons for me is that you can run it on the backend too (on NodeJS, or Erlang, or some other VM - yes, there are several backends available)
- _bxg1 7y agoAnything that targets JS, including Elm, can in theory be run on Node.
- ff_ 7y agoAFAIK it's strongly discouraged: https://github.com/elm/projects/blob/master/roadmap.md#can-i-use-elm-on-servers https://github.com/elm/projects/blob/master/roadmap.md#can-i...
- tutfbhuf 7y agoCan I run PureScript on node practically? If so, examples please.
- ff_ 7y agoHere's a wrapper for express: https://github.com/nkly/purescript-express https://github.com/nkly/purescript-express Examples: https://github.com/nkly/purescript-express/tree/master/examples https://github.com/nkly/purescript-express/tree/master/examp...
- _bxg1 7y agoThis is my question every time I see a new language pop up here. If there's nothing obviously novel about its design, its platform, or its community, I don't see the point of further fragmenting what people are using (unless it's just an experimental/learning-experience/for-fun language that isn't intended for production).
- the_duke 7y agoElm is also inspired by Haskell, but has a (intentionally) very simplistic type system. It lacks essential abstractions such as type classes, resulting in very boilerplate-heavy code. Maybe this trade-off has helped it gain adoption and is the right choice for a simple language that purpose built for UI generation. For me it is way too limiting.
- bcheung 7y agoElm requires the use of the Elm architecture. PS does not. PureScript can work server-side. Elm is pretty much browser only. PS has a richer type system. Elm's type system is extremely limited and makes it much harder to model domains because you can't do it generically and often need to write lots of boilerplate. PS has a higher level of abstraction and expressiveness. Elm's niche is frontend developers wanting to learn more about FP and get a gentle introduction to the Haskell like syntax. Elm definitely has the better ecosystem and tooling. It's much easier to learn as well. But as you learn more about FP and some of the higher level abstractions like monads you will find Elm very limiting.