When comparing Parenscript vs Haskell (via GHCJS), the Slant community recommends Haskell (via GHCJS) for most people. In the question“What are the best languages that compile to JavaScript? ” Haskell (via GHCJS) is ranked 28th while Parenscript is ranked 35th. The most important reason people chose Haskell (via GHCJS) is:
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.
Ranked in these QuestionsQuestion Ranking
Pros
Pro It is Common Lisp
Lisps are easy languages to learn (once you get past the parens) and Common Lisp is a very practical dialect.
Pro Run almost identically on both the browser and server
Parenscript code can run almost identically on both the browser (as JavaScript) and server (as Common Lisp).
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 The syntax may be hard to learn
Being an implementation of Lisp, Parenscript's syntax may seem cryptic and hard to understand for people not used to it. While Lisp has very little syntax compared to other languages and it's generally considered pretty terse, there's still an initial overhead in learning the language.
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.