Haste – A Haskell to JS Compiler
hackage.haskell.org
hackage.haskell.org
http://www.reddit.com/r/haskell/comments/1htqi2/announce_has...
That's the place where most intensive discussion on this kind of news usually takes place... (which holds true for this piece of news too)
edit: The reddit discussion contains an well written overview of differences between haste, ghcjs and fay (the 3 main haskell-to-js projects).
I love this trend, but I'd really love to see an asm.js target. GHC uses LLVM, which has such a backend, right?
Edit: previously I said 'Clang' instead of 'LLVM'
I think that the creators of tools like this would consider this an optimization for later iterations. The application/integration of asm.js would be two-fold for them. The (non-trivial) runtime that Haskell uses would need to be rewritten by hand in asm.js and the compiler would need to be reconfigured to emit asm.js.
I want to see asm.js, too. I think these two things create a big bucket of work that the initial creator of the compiler doesn't want to implement up front. I'm a bit interested in contributing to this. Maybe I can learn me some asm.js and see what I can do :-).
edit: okay, I don't always ignore them, but writing code which will need to be maintained is definitely out of the question (anything more complex than tiny toy apps)
[1]: http://www.html5rocks.com/en/tutorials/developertools/source...
Of course, CoffeeScript is probably way closer to the javascript it generates than Haste and ClojureScript are. That may make all the difference. For the 3rd time now, that may just be my naivety :)
I'm not sure the same could be true for Javascript compiled from a language like Haskell.
Why? Is "asm.js" just a mnemonic for "magically fast", or is there something specific you think would be gained by not using the full target language JS as a compiler target?
Let's just wait for GHCi support on both JS and ARM.
foreign import ccall square :: Int -> Int
And use --with-js to link against a JS file: // square.js
function square(x) {
return x * x;
}
Using jQuery would be an interesting challenge. I suppose you could just get the jQuery object and go nuts on it unsafely, or write typesafe(ish) wrapper functions to export. The “ccall” convention is also a bit disingenuous.Source: https://github.com/valderman/haste-compiler/blob/master/doc/...