Skip to content

Get Mellifera running in the browser with Wasm #2

@ashn-dot-dev

Description

@ashn-dot-dev

At the time of writing, the primary Mellifera interpreter (written in Go) is relatively easy to build and install on Linux and macOS. However, since Mellifera is intended to cater toward first-time programmers, there is a barrier to entry for new developers who may not have access to a Unix desktop machine (e.g. student using a locked down Chromebook).

Produce a version of the Go interpreter that can be embedded in a web page using WebAssembly. Ideally serving this page using a local server such as with python -m http.server should provide a web interface that allows users to enter the input text of their program in a <textarea> with line numbers, run that program with a nice button that says run (or similar), and then view the standard output and standard error from that program in either the JS console or dedicated stdout and stderr textarea elements on the same page.

As a stretch goal, it would be nice if multiple input-output textareas could be on the same page, so that a single webpage could show multiple runnable Mellfiera programs (e.g. for a tutorial or blog post). This would require using unique identifiers (probably HTML id attributes) for different programs on the same page.

Note that we specifically want to embed the Go interpreter locally in the page, so running a Mellifera program in the browser should not make a request to an external server that then runs the Mellifera interpreter and sends back the results.

The Go wiki has some information related to WebAssembly here.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions