Re:Scala.js no longer experimental
by mercurial on Thursday February 05, 2015 @07:42AM
(#9002903)
I'm curious to know the size of a scala.js hello world program.
[ Parent
| on HN ]
As mentioned upthread, hello world isn't really representative. A more useful metric is probably what I'm doing -- a large, complex single-page business app with lots of specialized gadgetry.
Including the standard Scala.js prelude (100-200k), that currently clocks in at a bit under a megabyte. That's quite reasonable for a program of its complexity, and loads pretty fast. And once that is loaded and in the browser cache, the UI is lightning fast afterwards...
Thanks for the perspective. It seems like a viable option for the frontend of my planned product, which I hope to write in Scala + Play.
Hello worlds are about 100 KB not gzipped, but this is not a good measurement. As your application grows, this doesn't grow as fast. Scala.js is meant for medium to large size applications anyway.
Re:Scala.js no longer experimental
by ArturSoler on Thursday February 05, 2015 @07:52AM
(#9002939)
Simple Scala.js JS "binaries" are quite big (from ~170kb before compression) because they add the part of the Scala standard library that they need.
From there, though, output size does not increase fast.
Traceur (ES6 compiler) itself has a runtime of several hundreds kb. Nothing you can't avoid at some point. There is an overhead for sure. But in most cases, execution time is spent in native calls (Dom rendering especially).
6to5 compiler don't have this disadvantage.