3 ms·
Haste is a great approach to compile Haskell to JS. But I yet have to play with it... I did play with an alternative approach Yesod+Fay; where Yesod is the web
by cies 13y ago
Haste is a great approach to compile Haskell to JS. But I yet have to play with it...
I did play with an alternative approach Yesod+Fay; where Yesod is the webframework and Fay the compiler of Haskell to JS. This approach is a bit more traditional in sense that the server-side app and the client-side app are separate (with some code shared by both).
I wrote a blog on how to get a Yesod+Fay example app setup on a recent Ubuntu:
http://www.hoppinger.com/blog/haskell-in-the-browser-setting-up-yesod-and-fay http://www.hoppinger.com/blog/haskell-in-the-browser-setting...
With Haste the server-side and client-side code live side-by-side in the same files. I "got it" by reading this code:
https://github.com/valderman/haste-compiler/blob/master/examples/sendfile/sendfile.hs https://github.com/valderman/haste-compiler/blob/master/exam...
For what I understand Haste does client-sever communication over websockets and yields webapps that are full-JS (therefore difficult to do SEO).
I often read the people are afraid of debugging with compiled JS; I must say that since I need a lot less debugging when using when compiling Haskell to JS. So far all my debugging needs are fulfilled with simple print/alert/console.log statements.