When comparing Scala.js vs Pharo, the Slant community recommends Pharo for most people. In the question“What is the best language to use simultaneously for front and back end?” Pharo is ranked 6th while Scala.js is ranked 10th. The most important reason people chose Pharo is:
In Pharo everything is an object. Compiler - object, network - object, method - also an object. And objects communicate with messages. No operators, no control-flow statements. Just objects and messages. Few things to learn, but you can learn OOP well.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
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 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 Easy, type-safe, interop with JavaScript
The JavaScript-interop of Scala.js is very direct and lightweight.
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.
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 Multiparadigm
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 Crossbuilding
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 Immutable values
The immutable values make it perfect for working with concurrency.
Pro Macros
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.
Pro Simple build system compared to Javascript
While SBT is arguably not as simple as Maven, it beats the chaos of the JavaScript build ecosystem.
Pro Object-Oriented
In Pharo everything is an object. Compiler - object, network - object, method - also an object. And objects communicate with messages. No operators, no control-flow statements. Just objects and messages. Few things to learn, but you can learn OOP well.
Pro Easily learnt
There is good, free documentation including several books written by experts with extensive examples. There is an online MOOC. There are many tutorial videos. Supportive conferences and community. Even a professional support option if desired.
Pro Live updates
The nature of Pharo being a "live" environment allows you to perform live updates to your system without requiring to restart it. You can upgrade/modify classes while serving requests at the same time.
Pro Highly productive
Pro Seaside
The framework for developing sophisticated web applications in Smalltalk is developed in Pharo. Seaside lets you build highly interactive web applications quickly, reusably and maintainably.
Pro Remote debugging
Pro Beautiful coding patterns in your IDE
No need to search google for compact beautiful examples of how to do things, your live environment source is available and you can easily live search, see how it works and copy how the masters would do it (examples most languages still copy too).
Pro Glamorous toolkit & GTInspector
Most languages are still copying the Smalltalk tools of yesterday - GTInspector (written in Glamorous) takes live exploration of code/running objects to a new level. It's really slick, and better yet, you can easily write your own inspectors in 10 lines of code.
Pro Code can be run on rock solid GemStone environment
Pro 64 bit support as of Pharo 7
Use 32 bit or 64 bit versions of Pharo on Windows, Mac & Linux.
Pro Advanced code analysis tools
MOOSE environment provides extensive, easily leveraged and class leading tools for code analysis and improvement.
Pro Can run headless for production
Pro Really simple networking and REST with Zinc
Pro Graphics, graphing and visualisation framework - Roassal
Roassal and Mondrian provide fantastic and easily used frameworks for graphics, graphing and advanced visualisations (comparable to D3.js) but with much less code. Visualisations can be rendered into web friendly graphics (SVG, .png etc.) without additional work.
Cons
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 Small community
But they are very friendly and supportive. Best help comes through the mailing lists so not always easily googlable. There is also a Slack community where help is nearly instantaneous.
Con Odd language
Requires a different mindset. Much harder to apply what you know from popular or conventional languages . Switching over from or between other languages is more difficult.
Con Single threaded
Pharo's VM only ever uses one CPU core. If you want to write code that uses more than one CPU core, you need to jump through hoops such as running multiple VMs and synchronising your data.