Judges, please see the README and start at this puzzling introduction.


Capability:

Enter "demo" to enter demo.

Otherwise choose an unguessable string and keep it in a safe place.

Welcome!

  1. Click Run to compile and run the sample program

  2. Click Load and try other programs. Some expect input.

  3. Build a canister from source right now! Follow the instructions beneath the download button.

Demo mode limitations: users may stomp over each other’s files when saving, though not over the preset examples because unless already present, curly braces will be placed around a program name, for example: {hello}.

For exclusive access to your own programs and arbitrary names, log out then come back with a string only you know.

Saved programs persist forever, or until I take down this canister. (Seriously, this is just a contest entry, and may disappear without warning. Store your important stuff elsewhere!)


[+] Show modules







    [-] Hide instructions for deploying canister.wasm

    Turn your code into an IC canister!

    Load enigma and click the download button above. Then in the same directory as canister.wasm:

    $ cat > dfx.json << EOF
    {"canisters":{"enigma":{
    "type":"custom","candid":"did.not","wasm":"canister.wasm","build":""}}}
    EOF
    $ touch did.not
    $ dfx deploy
    $ dfx canister call enigma go \
      --type raw `echo ATTACK AT DAWN | xxd -p` \
      --output raw | xxd -r -p

    (For longer inputs, pipe the output of xxd -p through tr -d '\n' to avoid confusing dfx with newlines.)

    Thus we turn programs into canisters simply by declaring "canister_query" and "canister_update" foreign exports.

    [+] Show language caveats

    This version of Haskell is primitive:

    • No unary minus. Write (0 - x) instead.

    • No qualified identifiers. We dumps all imported symbols into a single global namespace. Work around this with names such as mlookup instead of Map.lookup.

    • Type declarations and fixity declarations can only appear at the top level.

    • No superclasses.

    • No seq or bang patterns.

    • Fails to escape unprintable chars when showing them.

    • Many missing checks.

    • Awful error handling and reporting.

    • Foreign imports are restricted to those in the System module. For arbitrary imports, use the C backend of my compiler, then build a wasm binary with Clang or similar.

    There are a few niceties:

    • An n-tuples desugars to nested pairs, for example, (0, 1, 2) becomes (0, (1, 2)), so defining instances for pairs can automatically generalize to n-tuples.

    • Top-level fixity declarations can appear anywhere.

    • The concatenation of multiple modules is valid input.

    • Raw strings: write almost anything between [r| and |].

    There is no implicit Prelude, but since most programs need Base and System, we provide a checkbox to automatically prepend these imports.

    They say let should not be generalized, except perhaps at the top-level, and we follow this advice.

    [+] Show capability

    
    
    💡