3 ms·
Why are they very different? They port the language over to another platform and need to interop with it. For example scala.js can call js libraries through fa
by tutanchamun 8y ago
Why are they very different? They port the language over to another platform and need to interop with it.
For example scala.js can call js libraries through facades (similar to typescript typing files) but can also be called from javascript.
Scala.native can call c libraries (I have no idea about the other way around).
- bunderbunder 8y agoTargeting native because it's fundamentally a less thorny issue. To an approximation, all you do is take the JIT compilation pipeline and use it to do an AOT compilation instead. Targeting JavaScript because people expect different things out of it. The goal there is to transpile some portion of your code to run on the browser. There's not the same expectation that you'll be able to truck Spring or Akka along with you. The expectation is that the transpiled code is mostly only going to interact with the DOM and other JavaScript libraries, plus maybe whatever subset of your business objects you feel the need to have on both the client and server side. By contrast, the only real use case I can see for porting Scala to .NET is so that you can bring a bunch of pre-existing Scala libraries with you and then interface them with some pre-existing .NET codebase. If you're not looking for that, you'd probably be willing to satisfy yourself with either F# or the JVM.