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

B B blackbox.dev.ml at gmail.com
Wed Jul 3 15:13:37 CEST 2013


>
>
>> I think GHCJS should be able to compile all Haskell code in GHC, but we
> haven't tested this yet. The tricky bit is probably getting foreign code
> work, and creating a working installation that includes all other things,
> like libraries and a package database. Usually, GHCi loads object files for
> the libraries when running Haskell code. Obviously you can't run machine
> code with JavaScript, so you'd have to find a way around it. GHCJS includes
> an IO layer, which can be used to set up a virtual filesystem [2], but the
> API is far from finished.
>
Nice to hear that - we are concidering using GHCJS heavly in our project.
We dont have many people and this is free-time "driven" project for now,
but we would love to cooperate with you - help with GHCJS development and
work together to make it suitable for the project we are working on.



> Ah it's much easier if the code can be compiled on the server. This is
> more or less what Daniil Frumin is doing for his Google Summer of Code
> project [3]. We are using GHC on the server for non-interactive things, and
> GHCJS to compile interactive code that is run on the client. Our main goal
> is to get interactive graphics with the diagrams [4] library working.
>
Currently he is working on building a good sandbox for the compiler on the
> server (With SELinux, rlimits and cgroups) so that we can compile code, and
> run Template Haskell safely. I'm working on improving the GHCJS linker, so
> that we can support incremental code loading more easily (so users can
> download just the code for the new function they wrote, instead of the
> whole program every time)
>

That's very interesting. We want to use GHCJS EXACTLY for this - we want to
compile the code on the server and run it in the users browesr BUT we dont
want to load the whole program everytime a function is changed - only this
particular function.
Additional (which is NOT the same) - while writing a function - we want to
interactively execute it's "body" on the client side - but this requires
something like interpreter on the user client (please see below for
explanation). But we are thinking right now about it and its architecture,
so we will be in touch in this topic with you :)


I have a very crude example of this type here:
>
> http://hdiff.luite.com/reduce/
>

This is not exactly the kind of thing I'm talking about.
Think about something like matlab simulink or labview - functions are
representaed by "nodes" (rectangles) connected with other functions by
lines. Lines are "sending data" between these nodes.
So user is connecting these blocks - each block is like a function
application on data - so adding a block is like adding a new line in
Haskell .hs file. We want user to be able to interactively add such nodes
(apply further functions on already processed and cached data - every
"node" caches processed data) and process the data further - If I didn't
explained this simple enought, I will try harder. Such thing needs
something like client side interpreter I think ...


> When we have the SELinux sandbox working, I plan to work on this again, so
> that users can enter/compile their own code.
>
>
When do you plan roughtly to release it? We are strongly interested in
testing and using it :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130703/7d7d8964/attachment.htm>


More information about the Haskell-Cafe mailing list