3 ms·
Am I correct in my inference that Scala in the browser cannot import Java classes? Meaning this isn't some backdoor to a Java-to-JavaScript compiler?
by tootie 12y ago
Am I correct in my inference that Scala in the browser cannot import Java classes? Meaning this isn't some backdoor to a Java-to-JavaScript compiler?
- sjrd 12y agoYou are correct. Scala.js compiles Scala code to JS, not bytecode. A number of core Java classes have been ported to Scala.js so they can be used anyway, though. (see http://lihaoyi.github.io/hands-on-scala-js/#JavaAPIs http://lihaoyi.github.io/hands-on-scala-js/#JavaAPIs for a mostly exhaustive list so far)
- bad_user 12y agoTo add to what @sjrd said, while you cannot import Java classes, porting Java code to Scala.js is way easier than porting to Javascript ;-)
- bad_user 12y agoTo add to what @sjrd said, while you cannot import Java classes, porting Java code to Scala.js is way easier than porting to Javascript ;-)