This is mainly due to the fact that the Scala compiler uses too many parts of the JDK that have not been ported to Scala.js (yet). Some of these parts, especially those related to reading files (in the path to classes and source files), which cannot be implemented in JavaScript as such (although they can be implemented for one specific platform, for example Node.js).
There is also a dependency on ASM, a Java bytecode manipulation library written in Java. Despite the fact that Scala.js is compiled in JavaScript, Java bytecode is still used for separate compilation (searching for a character in previously compiled parts such as libraries).
So, despite the fact that specific parts of Scala.js are written in a platform-independent way (for example, we check that the Scala.js optimizer can optimize itself), there are many parts in scalac that donβt work out of the box in Scala.js.
source share