JScala 0.2 release - a Scala macro that produces JavaScript from Scala code

Showing 1-1 of 1 messages
JScala 0.2 release - a Scala macro that produces JavaScript from Scala code Alexander Nemish 8/16/13 2:32 AM
Good news everyone!

I'm pleased to announce JScala 0.2 - a Scala macro that produces JavaScript from Scala code.

Now with Tetris included :) Simply run tetris in jscala sbt shell and play some Tetris in your browser!

Twitter: @atlanter


Supported Features:
  • Variable definitions, basic unary and binary operations
  • Named and anonymous functions
  • Scala Arrays/Seq as JavaScript Array literals
  • Scala Map and anonymous classes as JavaScript object
  • if, while, for..in and for statements
  • Scala if as an expression (e.g. val a = if (true) 1 else 2)
  • Scala match as JavaScript switch
  • Basic Scala class definition to JavaScript object definition translation
  • Global JavaScript functions (parseInt etc)
  • Basic Browser objects (window, history, location etc)
  • Basic HTML DOM objects (Document, Element, Attribute, Node, NodeList etc)
  • Raw JavaScript inclusion
  • Values and function call injections from your Scala code
  • Generated JavaScript eval using Java ScriptEngine
  • Pretty printing and compression using YUI compressor

Planned features:
  • Traits support
  • JavaScript frameworks support: jQuery, Angular.js etc
  • Web frameworks support: Play, Lift

What's New:
  • Added switch and try/catch/finally support.
  • Added Scala values injections via inject/JsLazy.
  • Basic Class defs support.
  • Added if/match as expressions support in var/val definitions
  • JsDynamic class for dynamic stuff (e.g. val $ = new JsDynamic; $("#id").val())
  • Bug fixes

Cheers,
Alexander Nemish