[Haskell-beginners] Javascript with Haskell

Heinrich Apfelmus apfelmus
Wed Oct 9 13:29:35 UTC 2013


Franco wrote:
> Hello mailing list,
> 
>     I am developing a small text adventure game, which now runs nicely on a
> Linux terminal. I was going to ask a friend of mine to compile it on Windows,
> but then I thought: "Wouldn't it be awesome if people could run that in their
> browser?"
> 
> I searched a bit and found this little example game [1]. As you can see it
> was written in Haskell but you can play it in your browser.
> 
> Now, to the problem: it seems to me that the code requires UHC (Utrecht
> Haskell Compiler), which I don't have (I use GHC).
> What are the alternatives (if any)? As stated above, I am not going to code
> anything complex graphic wise, so the simpler the merrier!

Well, a compiler like GHC turns Haskell code into machine code. You need 
a different compiler if you want to target JavaScript: GHCJS, haste or 
uhc are the currently available options.


I myself am currently working on a GUI library called threepenny-gui [1] 
which uses the web browser as a display. However, while it does use the 
browser, it is currently not meant to be used over the internet, only 
locally. But maybe that would already be good enough for your purposes.

   [1]: http://www.haskell.org/haskellwiki/Threepenny-gui


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com




More information about the Beginners mailing list