Has Typeclasses and RankNTypes
Ranked in these QuestionsQuestion Ranking
Pro Implements a mature language
In contrast to other options, Scala.js is a compiler plugin for an already existing and mature language: Scala.
As such, it benefits automatically from the existing compiler, from the language design choices made for Scala, which exists and is established in the industry since years.
Pro Immutable values
The immutable values make it perfect for working with concurrency.
Scala supports both Functional and Object Oriented styles of programming. Beginners can learn both paradigms without having to learn a new language, and experts can switch between the two according to what best suits their needs at the time.
Pro Type inference
Scala offers type inference, which, while giving the same safety as Java's type system, allows programmers to focus on the code itself, rather than on updating type annotations.
Pro Extensive standard libraries
Scala.js implements most of the Scala standard library and many parts of the Java one. Among others, it supports Scala's rich collection library.
Pro Dead-code elimination
Scala.js performs dead-code elimination out of the box (when running in the "fullOpts" mode).
Pro The strength of Scala on the server
The strength of Scala (JVM) on the server can not be underestimated, and is probably superior to any other choice listed here (where applicable; many have no server-side equivalent).
Being able to use such a powerful language (and ecosystem) on the server AND on the client, and sharing code between the two, is a big advantage.
Because Scala.js is a plugin to the Scala compiler, the whole power of the Scala language is available at compile-time. Which includes macros. Very expressive things can be done, in a type-safe way, which are difficult or impossible in other languages.
Keeps your client and server sources in sync.
Pro Incremental compilation
Through SBT, Scala.js supports incremental compilation out of the box. That is: SBT automatically picks-up the changes (think "watch" in other tools) and only recompiles what is needed.
This makes the development cycle fast and very pleasant to work with.
Pro Excellent tooling (IDE) support
The same good and mature tooling that can be used for Scala can be used for Scala.js out of the box (code-completion, refactoring, immediate feedback, etc.).
Pro Higher kinded types
Has Typeclasses and RankNTypes
Pro Modules can be compiled to CommonJS
Pro High performance FFI code
Pro Has row polymorphism and extensible effects
Pro Type safety
Compiling should be your first unit test. A tight type system (static and hopefully strong) will catch many logic errors that are often difficult to spot through debugging. In languages like PureScript, if it compiles, it often runs properly.
FFI system is quite good and easy to use. You can import functions curried or not curried. Records and arrays use native JS objects and arrays.
Pro Pure functional language
You cannot have side effects, unless a function is explicitly defined as so.
Pro Awesome web frameworks
Halogen (VDOM, similar to ELM)
And hit these up with Signals, Isolated/(Managed?) Components, powerful functions and FFI
Con Can be intimidating for beginners
Scala is an industrial language. It brings functional programming to the JVM. All books/tutorials cover friendly aspects of Scala, but there are corners of the language that one can wander into that are not friendly to beginners.
Con A complex language with a lot of incidental complexity that results in significant mental overhead
Con Combines OOP and functional programming for a hodge-podge paradigm
Its excellent mix of functional and OOP programming just like Python to use the tool best suited
Con Lots of dependencies needed to get started
Purescript is written in Haskell, but meant to be used with Node.js. As a result, to get started , users must install ghc, cabal, node.js, grunt, and bower. Purescript also has its own compiler, and different semantics form Haskell, and so even after installing, there's still some overhead to getting productive with Purescript.
Con Lack of good IDE/tooling support
Con Restrictive FFI
Con Slow compilation
On large project, for example Halogen