Scala.js

Alessandro Lacava, Janek Bogucki, Aliaksandr Bedrytski, Matthew de Detrich, Benjamin Neil · 2016

Scala.js is a Scala compiler that is it takes scala files, and compiles them to an intermediate bytecode specifically designed for JavaScript (.sjsir) files. The usage of Scala source files means that Scala.js combined with SBT provides a module system, which is exactly the same module system that is used for using Scala normally with the JVM. This chapter discusses the basics of how Scala.js works. It shows an example that uses cross compilation technique (using SBT's aggregate), and explains how to separate and share SBT settings. The chapter also shows how to run the program (both in JVM and JavaScript), as well as how to generate the .js file. It covers Webjars, which are Maven packages with installed resources. Using Webjars, plus the powerful interoperability features that Scala.js provides, provides us with a compelling and fresh way to tackle the highly complex area of web programming.

Read the paper · More papers on PaperTik