What you have is a javascript framework which emulates the behavior of Java to the degree that javascript permits, but can't really implement it.
I'm not saying it isn't a useful tool, or that the javascript it generates isn't far, far superior to anything I could roll on my own - but...
>Things like multi threading which aren't possible in javascript aren't supported
...it isn't Java.
You know where else none of that exists? In the machine code on which the JVM rests and to which Java code can be JIT compiled by the JVM before execution.
So, if you can't have it compiling to JS, you never could have it on the JVM, either.
You are not coding in javascript. You are coding in java, and the code is then converted into highly efficient javascript by a compiler.
> What you have is a javascript framework which emulates the behavior of Java to the degree that javascript permits, but can't really implement it.
Absolutely not. You are actually coding in java, and its then compiled to javascript. Have you ever used GWT?
You may be coding java, but none of the tangible benefits of java over javascript actually translate, because you're actually writing javascript, with all of the warts and limitations and weirdness therein.
The javascript exported will not be truly type safe, because javascript is not, and cannot be. It may appear to act like it, within the context of the code when run as predicted, but this isn't the same thing as an actual strict language in a runtime which expects and enforces those rules. Highly efficient? Doubtless. Optimized to avoid as many pitfalls of the language as possible? Certainly. But anything more capable than bog-standard javascript? No. Because it can't be.
You are writing java and barring some features like multi-threading, you CAN write anything you want. How to translate that to JS is the compiler's job, you need not care.
Edit: what would you say to this - http://www.scala-js.org ?
Javascript is not the equivalent of assembly. Javascript is, itself, a higher-level language. You're talking about translating from one high-level language to another, and expecting the interpreter for the latter to care anything about the rules of the former.
>What a load of crap and the op is down voted!!!
The entire thread is downvoted. It's annoying but it doesn't prove anything.
Haskell is type safe, but the runtime doesn't enforce the rules, the compiler does -- the runtime, AFAIK, is no more typesafe than JS, all the typesafety comes from compilation that rejects code that isn't well typed.
So I don't see why something with a compiler that emits JS can't be just as typesafe.