Scala.js is a safer way to build robust front-end web applications


  Odersky Martin

Scala.js is a safer way to build robust front-end web applications. It comes with four main advantages: correctness, high-quality performance, interoperability, and excellent editor support.

Strong typing guarantees your code is free of silly mistakes. Avoid mixing up strings or numbers, forgetting what keys an object has, or worrying about typos in your method names. Scala.js takes care of all this tedious book-keeping for you, letting you focus on the actual, more interesting problem your application is trying to solve.

In terms of performance, Scala.js optimizes your Scala code into highly efficient JavaScript. Incremental compilation guarantees speedy (1-2s) turnaround times when your code changes. The generated JavaScript is both fast and small, starting from 45kB gzipped for a full application.

Scala.js offers interoperability because it allows you to use any JavaScript library right from your Scala.js code, either in a statically or dynamically typed way.

Scala.js has outstanding built-in editor support. It improves typos and catches errors, displaying them in your editor without necessitating code compilation. You can refactor any field or method easily with the confidence that if you mess it up, the editor will tell you immediately. There is no need for you to flip back and forth between your editor and MDN because your editor will display the available methods and what arguments they take, what they return, and even their documentation, right in-line with your code.

For more information, visit