When comparing Amber vs Haskell (via GHCJS), the Slant community recommends Amber for most people. In the question“What are the best languages that compile to JavaScript? ” Amber is ranked 11th while Haskell (via GHCJS) is ranked 28th. The most important reason people chose Amber is:
Amber includes an integrated development environment with a class browser, workspace, transcript, object inspector and debugger.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Includes an IDE
Amber includes an integrated development environment with a class browser, workspace, transcript, object inspector and debugger.
Pro Smalltalk is a simple, elegant, and powerful language
Pro One-to-one JS equivalent
Amber is written in itself, including the parser and compiler, and compiles into efficient JavaScript, mapping one-to-one with the JS equivalent.
Pro Terse
Haskell is a very terse language, particularly due to its type inference. This means there's nothing to distract from the intent of the code, making it very readable. This is in sharp contrast to languages like Java, where skimming code requires learning which details can be ignored. Haskell's terseness also lends itself to very clear inline examples in textbooks, and makes it a pleasure to read through code even on a cellphone screen.
Pro Quick Feedback
It's often said that, in Haskell, if it compiles, it works. This short feedback loop can speed up learning process, by making it clear exactly when and where mistakes are made.
Pro All of Haskell, with the same tools you're used to
No need to learn new syntax or semantics, and no need to install and learn a bunch of new tools - it's just GHC.
Pro Provides seamless concurrency, without the need for promises or callbacks
Pro Built-in REPL which lets you interact with your GHCJS compiled web page
Cons
Con Very few learning resources
There are very little learning resources for Amber outside the official documentation. Which may not be enough for beginners, especially people that don't have much experience in programming.
Con The generated code can be difficult to debug
It should be mentioned that since the execution model of Haskell is very different from common imperative languages (lazy evaluation), the generated code doesn't resemble the source code at all, so it can be very difficult to debug.
Con Large runtime
GHCJS supports the entire Haskell runtime, the Javascript it outputs tends to be quite large. This is in contrast to options such as Fay, which save some overhead by not supporting some features such as multi-threading.