[Haskell-cafe] ghci & ghc -> JS (Emscripten)

B B blackbox.dev.ml at gmail.com
Tue Jul 2 16:38:51 CEST 2013

Thank you for all the replies.
Luite Stegeman - I was thinking that the LLVM IR code is optimized already
or you can run LLVM IR optimization passes to get rid of such things. I
think compiling with ghc -fllvm generates LLVM bitcode and then you can
simply run emscripten on it to get Javascript - and it should work as

We are creating an online graphics (HTML5 canvas, webgl) processing tool -
we want to use Haskell as our processing language and we want allow users
to interactively process graphics in a functional, lazy manner. We want
GHCI to be run inside browser, to allow for smooth work.
So what about compiling GHC to JS - please look at: http://repl.it/languages

There are a lot of interpreters (like python or ruby) compiled to
javascript using emscripten.

Would it be possible to compile the GHCI (written in haskell?) with GHC
-fllvm to IR bitcode and then to javascript to get the online GHCI
interpreter? (not such "online" tools like "Try Haskell", which under the
hood compute everything on server)

2013/6/28 Tikhon Jelvis <tikhon at jelv.is>

> My understanding is that Try Haskell actually runs the submitted code on a
> server with mueval rather than compiling it to JavaScript and running it in
> the client. This is different from some of the other "try" websites (like
> try.ocamlpro.com), so it's easy to get confused.
> On Fri, Jun 28, 2013 at 11:24 AM, Henk-Jan van Tuyl <hjgtuyl at chello.nl>wrote:
>> On Fri, 28 Jun 2013 15:25:59 +0200, B B <blackbox.dev.ml at gmail.com>
>> wrote:
>>  Hi!
>>> Does anybody tried, or is there anywhere a project, of online ghc or ghci
>>> (compiled to JavaScript with Emscripten)?
>> There is Try Haskell![0], source code can be found on GitHub[1]
>> Regards,
>> Henk-Jan van Tuyl
>> [0] http://tryhaskell.org/
>> [1] https://github.com/chrisdone/**tryhaskell<https://github.com/chrisdone/tryhaskell>
>> --
>> Folding at home
>> What if you could share your unused computer power to help find a cure?
>> In just 5 minutes you can join the world's biggest networked computer and
>> get us closer sooner. Watch the video.
>> http://folding.stanford.edu/
>> http://Van.Tuyl.eu/
>> http://members.chello.nl/**hjgtuyl/tourdemonad.html<http://members.chello.nl/hjgtuyl/tourdemonad.html>
>> Haskell programming
>> --
>> ______________________________**_________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/**mailman/listinfo/haskell-cafe<http://www.haskell.org/mailman/listinfo/haskell-cafe>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130702/970e7e55/attachment.htm>

More information about the Haskell-Cafe mailing list