Now, having seen the talk at Scala days here are a few notes/thoughts:
This is currently the result of 4 months worth of work, and Sébastien Doeraene, the author of the slides and the code there-in, is going to be working on it at EPFL for the next 4 years or so for his doctorate.
This is being done by replacing the backend portions of the Scala compiler that emit java bytecode with ones that emit javascript.
When the slide showing that it is 16MB came up everyone laughed and the author acknowledged how large a number this is. It is the result of having to bring in the entire the Scala standard lib. He is planning to work on ways of cutting this number down.
At the end of talk Martin Odersky commented from the audience that this is an attempt by the EPFL at making Scala useable for large webapp development. If it proves successful more resources will put towards supporting it.
I plan to try this out for internal sites used by my company. Currently we split and then have to duplicate a lot of our code between Scala / Javascript. Scala for the server software, Javascript for frontends which are webapps. I haven't had time since I got back to do much more than clone the git repo.
"How to scale to Rich Internet Applications?"
Good question. They didn't answer it. Is the Scala code going to be much more compact? And what problems scaling JS to rich applications were they thinking of, exactly? They don't say.
The slides shown there are, well, slides. They are meant to support a talk, and that talk addressed your comments, at least partly. It is also worth noting that it was Scala Days, and as such I took it for (almost) granted that the audience is converted to Scala.
The problem is that JavaScript, with its scripting nature, has never been designed to support programming in the large. The lack of type safety is often mentioned as one of the major difficulties of JavaScript. That is why there are other languages targeting JavaScript.
We scale to Rich Internet Applications by using the language Scala, which is a scalable language. I won't try and make a whole point here. Some people have moved from Java to Scala for that very reason.
And, yes, the 16 MB are for the standard library. But minifying was only the first step towards reducing that size. I have at least 4 ideas, which I believe will each divide that size by ~2. That should bring it down under 1 MB.
Seeing the presentation, I'm thinking more of using it with something like node-webkit[1] though. Didn't LightTable use clojure-script or something? But then, why don't just use one of JVM's GUI framework?
Also I just want to mention that Clojurescript compiles to javascript that's compatible with Google's Closure compiler, which can do dead code elimination and will remove the parts of the standard library that you don't use.
1.) increase difficulty debugging (compiled js -> scala) 2.) decrease productivity, see #1
Why not just write javascript? Though that's my argument against any of these compile to js kits (coffee script being the big one). So maybe I'm just trolling (sorry).
Again, super cool. The author is waaay smarter than I for implementing this, but... The real world.
Quick comment from the author: #1 has already been addressed by emitting Source Maps. With a supporting browser, you can debug your Scala.js application easily. You get positions in the original source code, breakpoints in the original source code, stack traces in the original source code, etc.
For work and anything I would want to put on a web site it is more practical to write javascript and when I've had time for my own projects I've enjoyed scala.
For me this is a great direction. The idea that I'd suddenly replace my javascript is silly. But being able to pull in things I'm familiar with from both into the same prototype (and at the same layer) of something and debug it all in the debugger I'm most familiar with (and with correct code line references!) is awesome.
Similarly, for someone who is learning scala and doesn't have/want java+IDE experience, this could lead to learning scala as a language with much less overhead and/or while learning a more useful combination of debugger and editor.
I think the overly negative comments come from those who view javascript as the "problem" that every new way to integrate languages with it must have been designed to tackle. Since every language has trade-offs, there is always ample criticism available from that vantage point...
For Android development, install Scala runtime into rooted phone, so you don't need to "minify" your code (faster roundtrip). For Scala.js, maybe use Chrome Extension?
For production, ProGuard (removes unused code in Scala) and Closure Compiler (optimizes JS).
How much of this is (b)?
That said- it's not a superior language, just a different paradigm. With Scala you get very strong typing, functional constructs (so incredibly powerful), matching, options, very clean closure syntax, etc.. You'll eventually fall in-love with _, too.
I haven't used scala.js yet, but here are some downsides to Scala proper: * slow the compile * tooling isn't great (this true of anything jvm to some degree though)
Well, you have plenty of very decent tools to inspect a running JVM state, and that's priceless. Eclipse is alright if you manage to set it up once with the tools you need and don't fiddle with the setup afterwards. Although slow, it packs a lot more features out of the box than Visual Studio. The debugger is pretty good too (including remote debugging).
If you compare it to state-of-the-art tooling for more fringe languages like Python or Haskell, it's lightyears better, really.
If you compare Scala.js to similar languages (CoffeeScript, TypeScript, ClojureScript to name a few), it definitely helps to have the same language both on server and client, especially if logic must be replicated on both sides. So in that sense, there is some (a) too.
But that is only my opinion. Any developer or team can make up her own mind on the matter.