Sébastien Doeraene @sjrdoeraene
ScalaDays 2014, June 18
LAMP, lamp.epfl.ch
École polytechnique fédérale de Lausanne
Thanks to @lihaoyi for these data
So what's new in Scala.js 0.5?
For example, Int = signed 32-bit integer
(Division by 0 is still undefined behavior.)
val x = 1000000000
val y = 3 * x // -1294967296
val z = y - x // 2000000000
var x = 1000000000;
var y = Math.imul(3, x); // -1294967296
var z = (y - x) | 0; // 2000000000
Primitive Scala types really are primitive JavaScript types
Scala types | JavaScript types |
---|---|
Float, Double | number |
Byte, Short, Int | number (restricted range) |
String | string |
Null | null |
Unit | undefined |
_ <: js.Any | itself |
anything else | opaque, except @JSExport 'ed members |
through sbt plugin
run
and test
* use RhinofastOptStage::run
and fastOptStage::test
use Node.js
requiresDOM := true
, use PhantomJS~fastOptStage::test
fullOptStage::
* and testOnly
and testQuick
_sjs0.5_2.11
suffix%%%
to depend on cross-cross-published libraries
libraryDependencies +=
"org.scala-lang.modules.scalajs" %%%
"scalajs-dom" % "0.6"
ScalaJSKeys.jsDependencies +=
"org.webjars" % "jquery" % "1.10.2" / "jquery.js"
run
or test
skip in ScalaJSKeys.packageJSDependencies := false
How is Scala.js used?
by @lihaoyi
Double-cross {JVM,JS} x {2.10,2.11} unit testing library
by @lihaoyi
Very much in a proof-of-concept state
Shapeless and Parboiled2
No changes to the source code (only build files)
Scala.js port by @alexander-myltsev
Scala-esque statically typed interface to Facebook's React
by @kanterov
Pure Scala/Scala.js library for data binding
by @antonkulaga
Scala parsing library using an incremental parsing approach
Web demo with UI in JavaScript talking to the Scala.js library
And other cool stuff ...
How stable is it?
Can I use it?
Official answer: it is still experimental, still an 0.x version
-Xexperimental
and withoutfastOptStage
and fullOptStage
packageStage
)fastOptStage
and fullOptStage
You can help with all of these!