简体   繁体   中英

Scala to JavaScript compilation effective?

I just read about the java 2 javascript parser and the demo with scala.

Do you have any experience with this framework?

What about performance?

Can i use existing JS code/frameworks?

I appreciate any help.

EDIT

This is a very good scala to javascript cross compiler: https://www.scala-js.org/

I did this more than a year ago. Performance is ok, but code size tends to be big. I would not recommend it for production, but can give away the code if usefull. There are other efforts to run Scala on the browser. Best would be to create a JavaScript backend to an existing Scala compiler.

Here are some other projects to look after:

http://greedy.github.com/scala/

https://github.com/scalagwt

https://github.com/alvaroc1/s2js

https://github.com/kripken/emscripten

http://jscala.org/

I've never found these "language X to JavaScript" tools to be worth using. Debugging, quality of code generation, interfacing and using native JS libraries, etc., etc. mostly get compromised. CoffeeScript is an exception, because it is a new syntax for JavaScript, not an entirely separate and unrelated language.

If you need to use JS (or another language for that matter), embrace it and learn it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM