[Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

Chris Smith cdsmith at gmail.com
Wed Sep 4 21:37:56 CEST 2013


I second the recommendation to look at Haste.  It's what I would pick for a
project like this today.

In the big picture, Haste and GHCJS are fairly similar.  But when it comes
to the ugly details of the runtime system, GHCJS adopts the perspective
that it's basically an emulator, where compatibility is the number one
goal.  Haste goes for a more native approach; while the evaluation
semantics and such are completely faithful to Haskell, it doesn't go out of
the way to emulate the gritty details of GHC's runtime system.
On Sep 4, 2013 3:38 AM, "Nathan Hüsken" <nathan.huesken at posteo.de> wrote:

>  In my opinion haste is somewhere between Fay and ghcjs. It supports more
> than Fay, but in difference to ghcjs some PrimOps are not supported (weak
> pointers for example).
>
> It is a little bit more "direct" than ghcjs, in the sense that it does not
> need such a big rts written in js.
>
> I like haste :).
>
> What I wonder is how the outputs of these 3 compilers compare speed wise.
>
> On 09/04/2013 11:11 AM, Alejandro Serrano Mena wrote:
>
> I haven't looked at Haste too much, I'll give it a try.
>
>  My main problem is that I would like to find a solution that will
> continue working in years (somehow, that will became "the" solution for
> generating JS from Haskell code). That's why I see GHCJS (which just
> includes some patches to mainstream GHC) as the preferred solution, because
> it seems the most probable to continue working when new versions of GHC
> appear.
>
>
> 2013/9/4 Niklas Hambüchen <mail at nh2.me>
>
>> Hi, I'm also interested in that.
>>
>> Have you already evaluated haste?
>>
>> It does not seem to have any of your cons, but maybe others.
>>
>> What I particularly miss from all solutions is the ability to simply
>> call parts written in Haskell from Javascript, e.g. to write `fib` and
>> then integrate it into an existing Javascript application (they are all
>> more interested in doing the other direction).
>>
>> On Wed 04 Sep 2013 17:14:55 JST, Alejandro Serrano Mena wrote:
>> > Hi,
>> > I'm currently writing a tutorial on web applications using Haskell. I
>> > know the pros and cons of each server-side library (Yesod, Snap,
>> > Scotty, Warp, Happstack), but I'm looking for the right choice for
>> > client-side programming that converts Haskell to JavaScript. I've
>> > finally come to Fay vs. GHCJS, and would like your opinion on what's
>> > the best to tackle. My current list of pros and cons is:
>> >
>> > Fay
>> > ===
>> > Pros:
>> > - Does not need GHC 7.8
>> > - Easy FFI with JS
>> > - Has libraries for integration with Yesod and Snap
>> >
>> > Cons:
>> > - Only supports a subset of GHC (in particular, no type classes)
>> >
>> >
>> > GHCJS
>> > ======
>> > Pros:
>> > - Supports full GHC
>> > - Easy FFI with JS
>> > - Highly opinionated point: will stay longer than Fay (but it's very
>> > important for not having a tutorial that is old in few months)
>> >
>> > Cons:
>> > - Needs GHC 7.8 (but provides a Vagrant image)
>> >
>> >
>>  > _______________________________________________
>> > Haskell-Cafe mailing list
>> > Haskell-Cafe at haskell.org
>> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing listHaskell-Cafe at haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130904/ae5d75ad/attachment.htm>


More information about the Haskell-Cafe mailing list