Upload
alexander-nemish
View
572
Download
1
Tags:
Embed Size (px)
DESCRIPTION
JScala library allows you to translate your Scala code to JavaScript. You can express your data and logic as Scala code and reuse it on both server and client sides. It uses Scala macros and macro annotations features, yet experimental but very powerful technics. Even though JScala is a young project you already can implement quite complex logic.
Citation preview
JScalaWrite you JavaScript in Scala.
Let it be type safe!
Alexander Nemish @atlanter
What is JScala?
• JavaScript AST
• Scala macros
• JavaScript pretty printer
• Macro annotations
• Typescript import
Why JScala?
• Type safety
• IDE support
• Modularity
• Single language
• No boilerplate
Example
Example
Features• Variables, functions, lambdas
• if, for, for..in, while, match, try/throw
• classes, traits, inheritance
• Array/Traversable, Map
• JsDynamic
• Injection
Manual AST
Macro example
Generated JavaScript
Show Tetris
Server code
Client code
Generated JavaScript
Show AES web app
@Typescripted
JScala Cons
• Subset of Scala
• Covers only basic parts of the library
• Uses experimental Scala features
Thank you!• http://jscala.org
• https://github.com/nau/jscala
• https://github.com/apezel/ts2scala
• Google Group: jscala-user
• Follow me on twitter: @atlanter
• Email: [email protected]