Skip to content

Improve the ArkEmscripten playground #631

@SuperFola

Description

@SuperFola

Is your feature request related to a problem?

The current playground is pretty bare, and the current method of capturing what's printed is not that good (though I have no clue how to make it better):

log = console.log;
var can_capture = false;

window.console.log = (message) => {
    log(message);
    if (can_capture)
        document.getElementById("output").value += message + "\n";
};

var Module = {
    onRuntimeInitialized: function () {
        document.getElementById("run").addEventListener("click", () => {
            document.getElementById("output").value = "";
            const code = document.getElementById("code").value;
            try {
                can_capture = true;
                Module.run(code);
            } catch (e) {
                document.getElementById("output").value = e;
            }
            can_capture = false;
        });
    }
};

Playground:
Wasm Playground

Describe the solution you would like

  1. Improve the UI/UX of the playground (without having to add Vue, React or other huge libraries)
  2. Add more utils / builtins to ArkEmscripten to play with DOM and JavaScript values / functions
  3. Find a better way to get ArkScript output
  4. Add more tests (currently not tested in the CI, only the compilation is tested)

Is it a big modification to the language? Leave it if you don't know

  • Breaking change
  • Compiler/syntax modifications
  • Runtime modifications (standard library, modules, packages...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions