Skip to content

naproche/web-naproche

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webport of Naproche-SAD

How to build

  1. Install try-reflex to get nix with all the dependencies: https://github.com/reflex-frp/reflex-platform/blob/develop/docs/project-development.rst

    (If mmorph can't be build on your system, you may need to use v0.6.2.0 , see this issue) (Also, see this issue if you get an error "cannot coerce null to a string")

  2. Copy Naproche-SAD into frontend/Naproche-SAD (or tell me how to get submodules to run without larger problems).

  3. Delete frontend/Naproche-SAD/Naproche-SAD.cabal. (This needs to be done only if you encounter an error ".. .cabal was built with a newer hpack, please upgrade".)

  4. Delete in frontend/Naproche-SAD/package.yaml everything after the library definition. This is important, because otherwise the auto-generated default.nix (which we can't override) will demand the Isabelle library. The Isabelle library depends on network and can't be included here.

  5. cd into this projects root directory and run nix-build -o frontend-result -A ghcjs.frontend.

  6. Delete the last line of frontend-result/bin/frontend.jsexe/all.js and add this code

var closure = "start";

onmessage = function(msg) {
    if(closure === "start") {
        closure = null;
        h$main(h$mainZCZCMainzimain);
    } else {
        if(closure !== null) {
            var cl = closure
            closure = null;
            cl(msg.data);
        } else {
            console.log("Unhandled by Naproche Worker: ");
            console.log(msg.data);
        }
    }
};

var requestMessage = function(msg, c) {
    postMessage(msg);
    closure = c;
};

var writeMessage = function(msg, c) {
    postMessage(msg);
};
  1. Now you can include all.js as a webworker and communicate with it :)
  2. Change, rebuilt by going to step 5 and open a PR :)