More and more languages have that now (F#, Ceylon, Haxe,...), I wonder how well it works in practice, especially in terms of: - libraries availability - code size and speed - debugging capabilities - ...and interoperability with JS (I recall that F# uses TypeScript definition files, that's a nice approach) Anyone has more experience with it?
- interoperability with JS: Scala.js has its own TypeScript-like definition classes. But you can also interop in a dynamically typed way with the js.Dynamic type. In any case, the interop is very natural. Even the Scala syntax is close to JS syntax so method calls and property access just look the same.
- Code size: not exactly great, but manageable.
- Code speed: Scala.js has a very good optimizer that brings down typical macro benchmarks between 0.7x and 2x the time of the JS version (yes, 0.7x means it's actually faster!)
- Debugging capabilities: because of Source Maps, you basically step through your Scala.js code and step break points right inside your browser. All modern compile-to-JS languages have that.