<div dir="ltr"><div>Here are some points I&#39;d like to emphasize in addition to the threads above, with the disclaimer that I&#39;m the maintainer of Fay.</div><div><br></div><div>Fay tries to be very simple, the code base is small (~4800 LoC). This really lowers the entry barrier for contributions which I think is very important for open source projects. GHCJS is much more complicated since it tries to do so much. For GHCJS I&#39;d be afraid that the developers might eventually abandon the project and then it&#39;d be pretty hard to take over development. Much easier for someone to take over Fay development. I think you can safely expect to find bugs in all compilers, and if you do and you are in a hurry you might have to fix it yourself. Fay has very simple output that is close to both Haskell and JavaScript so it&#39;s pretty easy to just add a breakpoint and start debugging.</div>
<div><br></div><div>Even if GHCJS can successfully compile most of hackage, would we want to have these as dependencies in web projects? An output size of 1MiB is nothing when compiling a binary, but for a public website 1MiB can still be quite a lot, add some transitive dependencies and output will explode. Most people don&#39;t optimize their packages to have few dependencies, which makes sense since the abstraction usually heavily outweighs code size. So either way you would probably want to write some specific light-weight versions of libraries you want to use, that&#39;s one reason both GHCJS and Fay have their own base packages.</div>
<div><br></div><div>One place I think GHCJS can shine is for non standard web applications such as WEBGL games. Nothing stopping you from using Fay for this, but I expect you can really start to leverage GHCJS&#39;s threaded runtime here.</div>
<div><br></div><div>I&#39;m not sure if GHCJS or Haste have any out of the box solutions for doing client&lt;-&gt;server communication. In Fay you can just serialize any data type automatically on the front and backend to a json format and then deserialize it automatically again on the other end. You can also leverage phantom types (<a href="https://github.com/fpco/yesod-fay/blob/master/Language/Fay/Yesod.hs#L41">https://github.com/fpco/yesod-fay/blob/master/Language/Fay/Yesod.hs#L41</a>) to typecheck this communication.</div>
<div><br></div><div>It&#39;s hard to know how well GHCJS performs in a real web application. FP Complete uses Fay for their IDE and School of Haskell so it has been battle tested, so if you want something that definitely works today I think Fay is the more reliable option.</div>
<div><br></div><div>It is possible that GHCJS will eventually supercede Fay. But if you want something that&#39;s easy to use today you can always write Fay, and then convert it to GHCJS later since Fay is a subset of Haskell.</div>
<div><br></div><div>I think GHCJS needs more time to prove itself. I know the developers are hard at work and I hope they will focus on a lot of learning materials. Once you can `cabal install ghcjs` and just get started I think they will see a lot more interest coming their way.</div>
<div><br></div><div>Let me know if you have more questions. If you decide to use Fay in your tutorial I&#39;d be happy to help out, just send me an e-mail!</div><div><br></div><div>- Adam</div><div><br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 2:46 PM, Adam Bergmark <span dir="ltr">&lt;<a href="mailto:adam@edea.se" target="_blank">adam@edea.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">You might be interested in these two comment threads (and maybe the rest of the comments as well):<div>
<div>
<a href="http://www.reddit.com/r/haskell/comments/1ldqav/thoughts_on_uhc_vs_haste_vs_fay/cbyrhwz" target="_blank">http://www.reddit.com/r/haskell/comments/1ldqav/thoughts_on_uhc_vs_haste_vs_fay/cbyrhwz</a></div>
<div><a href="http://www.reddit.com/r/haskell/comments/1htqi2/announce_haste_the_haskell_to_js_compiler_is_now/cay79g9?context=1" target="_blank">http://www.reddit.com/r/haskell/comments/1htqi2/announce_haste_the_haskell_to_js_compiler_is_now/cay79g9?context=1</a></div>


</div><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 12:36 PM, Nathan Hüsken <span dir="ltr">&lt;<a href="mailto:nathan.huesken@posteo.de" target="_blank">nathan.huesken@posteo.de</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>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).<br>
      <br>
      It is a little bit more &quot;direct&quot; than ghcjs, in the sense that it
      does not need such a big rts written in js.<br>
      <br>
      I like haste :).<br>
      <br>
      What I wonder is how the outputs of these 3 compilers compare
      speed wise.<div><div><br>
      <br>
      On 09/04/2013 11:11 AM, Alejandro Serrano Mena wrote:<br>
    </div></div></div><div><div>
    <blockquote type="cite">
      <div dir="ltr">I haven&#39;t looked at Haste too much, I&#39;ll give it a
        try.
        <div><br>
        </div>
        <div>My main problem is that I would like to find a solution
          that will continue working in years (somehow, that will became
          &quot;the&quot; solution for generating JS from Haskell code). That&#39;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.</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2013/9/4 Niklas Hambüchen <span dir="ltr">&lt;<a href="mailto:mail@nh2.me" target="_blank">mail@nh2.me</a>&gt;</span><br>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
            Hi, I&#39;m also interested in that.<br>
            <br>
            Have you already evaluated haste?<br>
            <br>
            It does not seem to have any of your cons, but maybe others.<br>
            <br>
            What I particularly miss from all solutions is the ability
            to simply<br>
            call parts written in Haskell from Javascript, e.g. to write
            `fib` and<br>
            then integrate it into an existing Javascript application
            (they are all<br>
            more interested in doing the other direction).<br>
            <div>
              <div><br>
                On Wed 04 Sep 2013 17:14:55 JST, Alejandro Serrano Mena
                wrote:<br>
                &gt; Hi,<br>
                &gt; I&#39;m currently writing a tutorial on web
                applications using Haskell. I<br>
                &gt; know the pros and cons of each server-side library
                (Yesod, Snap,<br>
                &gt; Scotty, Warp, Happstack), but I&#39;m looking for the
                right choice for<br>
                &gt; client-side programming that converts Haskell to
                JavaScript. I&#39;ve<br>
                &gt; finally come to Fay vs. GHCJS, and would like your
                opinion on what&#39;s<br>
                &gt; the best to tackle. My current list of pros and
                cons is:<br>
                &gt;<br>
                &gt; Fay<br>
                &gt; ===<br>
                &gt; Pros:<br>
                &gt; - Does not need GHC 7.8<br>
                &gt; - Easy FFI with JS<br>
                &gt; - Has libraries for integration with Yesod and Snap<br>
                &gt;<br>
                &gt; Cons:<br>
                &gt; - Only supports a subset of GHC (in particular, no
                type classes)<br>
                &gt;<br>
                &gt;<br>
                &gt; GHCJS<br>
                &gt; ======<br>
                &gt; Pros:<br>
                &gt; - Supports full GHC<br>
                &gt; - Easy FFI with JS<br>
                &gt; - Highly opinionated point: will stay longer than
                Fay (but it&#39;s very<br>
                &gt; important for not having a tutorial that is old in
                few months)<br>
                &gt;<br>
                &gt; Cons:<br>
                &gt; - Needs GHC 7.8 (but provides a Vagrant image)<br>
                &gt;<br>
                &gt;<br>
              </div>
            </div>
            &gt; _______________________________________________<br>
            &gt; Haskell-Cafe mailing list<br>
            &gt; <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
            &gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Haskell-Cafe mailing list
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>