3 ms·
There are several paths: 1. JS as an assembly language. This is what emscripten[0], a LLVM bytecode-to-JS does, by following the asm.js specification[1]. This
by bru 12y ago
There are several paths:
1. JS as an assembly language. This is what emscripten[0], a LLVM bytecode-to-JS does, by following the asm.js specification[1]. This is for CPU-intensive tasks, not DOM manipulation. You can use any language that has a LLVM frontend.
2. JS as a target language, from a specific, new language. Those include cleaner variants that keep the same semantics (CoffeeScript, TypeScript, maybe Dart, ...) or more innovative ones, such as Elm[2], which is written in Haskell too. I'd say that a big innovation that makes the life easier is FRP (which is at the heart of Elm or React.js).
I fail yet to see what advantages PureScript brings compared to Elm.
0: https://github.com/kripken/emscripten https://github.com/kripken/emscripten
1: http://asmjs.org http://asmjs.org
2: http://elm-lang.org/ http://elm-lang.org/
- paf31 12y ago> I fail yet to see what advantages PureScript brings compared to Elm. I think they fit different use cases. Elm is excellent at interactive web apps using FRP. PureScript is a little more general purpose and has a few type system features which Elm currently does not (type classes and rank N polymorphism). Also, PureScript's generated code is a bit simpler and doesn't need a runtime library.