4 ms·
PureScript is a language that compiles to JS which is heavily inspired by Haskell, yet fixes some of it's "flaws". Namely it (1) has better record syntax, (2)
by cies 10y ago
PureScript is a language that compiles to JS which is heavily inspired by Haskell, yet fixes some of it's "flaws".
Namely it (1) has better record syntax, (2) is employs strict-evaluation instead of lazy-evaluation by default, (3) has a better class hierarchy for "numbers", (4) has a better class hierarchy for control classes[1] (like Monad, Applicative, Functor, etc.). There are more, but to me they are the main improvements.
Compared to Haskell, PureScript fixes some of the "flaws". These flaws are mostly different from the flaws mentioned in the article. Maybe one day PureScript can be compiled to native ...<searching internet>... which is already being worked on[2].
[1] https://github.com/purescript/purescript-prelude/tree/master/src/Control https://github.com/purescript/purescript-prelude/tree/master...
[2] https://github.com/andyarvanitis/purescript-native https://github.com/andyarvanitis/purescript-native
- misja111 10y agoIs Haskell's default lazy evaluation really a flaw that needs to be fixed? I personally like it, I find that most of the time lazy evaluation is what I need instead of strict.
- cies 10y agoI like Haskell's laziness by default myself. But it turns out that it is hard to reason about for those new to the language, and hard to efficiently cross-compile to a non-lazy language. Perhaps I should rectify that I do not think laziness is a flaw, yet probably a large hurdle to adoption.
- DanWaterworth 10y agoIf you'd like strictness by default, there's a pragma for that https://ghc.haskell.org/trac/ghc/wiki/StrictPragma https://ghc.haskell.org/trac/ghc/wiki/StrictPragma
- taylorfausak 10y agoThis is another flaw that PureScript fixes: No language pragmas.
- DanWaterworth 10y agoI don't think this is a flaw, in fact I think it neatly solves the problem of how to extend the language without committing to a design too eagerly and provides a platform for experimentation. There are pragmas that GHC implements that are now widely held to be problematic, but we wouldn't know this without an implementation, and using pragmas, we are realistically able to deprecate and remove these extensions.
- taylorfausak 10y agoVery few extensions have been deprecated: http://hackage.haskell.org/package/Cabal-1.24.0.0/docs/src/Language.Haskell.Extension.html#deprecatedExtensions http://hackage.haskell.org/package/Cabal-1.24.0.0/docs/src/L... Convenient, widely-used extensions that have been around for a long time aren't yet part of the language standard: https://prime.haskell.org/ticket/67 https://prime.haskell.org/ticket/67
- DanWaterworth 10y agoThat's not anywhere near a complete list of deprecated extensions and there are others that have been completely removed from the language [1]. It's unfortunate that ScopedTypeVariables hasn't been standardised, but there hasn't been a new standard since 2010, so it's not hugely surprising. https://ghc.haskell.org/trac/ghc/wiki/LanguagePragmaHistory https://ghc.haskell.org/trac/ghc/wiki/LanguagePragmaHistory
- taylorfausak 10y agoThanks for that link! I haven't seen that wiki page before. Even so, only 4 extensions have been removed. I know others are de facto deprecated, like Rank2Types. I picked scoped type variables as an example because it's been in GHC since version 6.4. That was released in March 2005, so it had plenty of time to make it into the Haskell2010 language standard.
- tome 10y agoThat doesn't stop other people's code being lazy and such laziness not being reflected in the type.
- jjnoakes 10y agoPureScript also compiles to readable C++. I haven't used it, but it is compelling. https://github.com/andyarvanitis/purescript-native https://github.com/andyarvanitis/purescript-native