JScala
Write 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 impo...
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

...
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:...
Upcoming SlideShare
Loading in …5
×

JScala. Write your JavaScript in Scala

1,142 views
891 views

Published on

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.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,142
On SlideShare
0
From Embeds
0
Number of Embeds
28
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

JScala. Write your JavaScript in Scala

  1. 1. JScala Write you JavaScript in Scala. Let it be type safe! Alexander Nemish @atlanter
  2. 2. What is JScala? • JavaScript AST • Scala macros • JavaScript pretty printer • Macro annotations • Typescript import
  3. 3. Why JScala? • Type safety • IDE support • Modularity • Single language • No boilerplate
  4. 4. Example
  5. 5. Example
  6. 6. Features • Variables, functions, lambdas • if, for, for..in, while, match, try/throw • classes, traits, inheritance • Array/Traversable, Map • JsDynamic • Injection
  7. 7. Manual AST
  8. 8. Macro example
  9. 9. Generated JavaScript
  10. 10. Show Tetris
  11. 11. Server code
  12. 12. Client code
  13. 13. Generated JavaScript
  14. 14. Show AES web app
  15. 15. @Typescripted
  16. 16. JScala Cons • Subset of Scala • Covers only basic parts of the library • Uses experimental Scala features
  17. 17. 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: anemish@gmail.com

×