So, what is the solution?
Besides Java, some of the other languages which have such transpilers are Scala (Scalajs), Clojure (Clojurescript), C#, Haskell (Haste, Ghcjs, Fay) to name just a few.
With Haskell, you have at least 3 choices:
can use all of Haskell. Can use all libraries (except those that have underlying native code dependencies)
A subset of Haskell. Size of generated Javscript is smaller than Ghcjs though this is a moving target.
A subset of Haskell.
A standard metric for showing off the capability of these transpilers is to write a “TODO” web app in as few lines as possible.
Todo MVC (In Java, Scala, Clojure and Haskell)
- Java (gwt)
- Scala/scalajs (react)
This is by no means an exhaustive list.
My favorite languages are Haskell and F#. In addition to Java (GWT), I have used Haskell (ghcjs) to write webapps. More on that in a future article.