When comparing ECMAScript 6 vs Utrecht Haskell Compiler, the Slant community recommends Utrecht Haskell Compiler for most people. In the question“What are the best solutions to "The JavaScript Problem"?” Utrecht Haskell Compiler is ranked 18th while ECMAScript 6 is ranked 37th. The most important reason people chose Utrecht Haskell Compiler is:
No need to learn any new semantics, it's just a switch to a different compiler.
Ranked in these QuestionsQuestion Ranking
Pros
Pro New features make JavaScript a bit less painful to use
Pro It's just Haskell
No need to learn any new semantics, it's just a switch to a different compiler.
Pro Flexible FFI
UHC uses a printf-like syntax for its FFI, which is flexible enough to minimize the need for wrapper functions, when, e.g., calling methods on objects. It also supports %*
, for working with functions that take arbitrary parameters, such as concat
.
UHC also has support for wrapper imports and dynamic imports, for passing Haskell functions as callbacks to Javascript, or dealing with curried Javascript functions, respectively.
Cons
Con Undefined
JavaScript's fundamental flaw. ECMAScript still has it. Instead of crashing at or near the problem with a helpful error message like any sane dynamically-typed language, it just returns a garbage undefined
value until it finally crashes in some other unhelpful location. Or worse, it doesn't crash at all and just doesn't work.
Con Even more complicated
One of JavaScript's primary problems is that it's too complicated. Adding even more features is not going to fix that.
Con No support for Language Extensions
No support for things like Arrow Syntax - this is particularly a disadvantage when compared to options like Elm (which was designed around good syntax for Arrowized FRP), if you're looking to do Functional Reactive front-end development.