A web-based version of the 1ML compiler and REPL, built using Andreas Rossberg’s original 1ML implementation and compiled to JavaScript with js_of_ocaml.
This web interface provides a simple environment for writing and executing 1ML code:
- Write 1ML code in the editor on the left
- Click "Run" or press Ctrl+Enter to execute.
- View the results in the output panel on the right.
- Use "Clear" to reset the output
Try it out here: https://gldubc.github.io/1ml_web/
The project is organized as follows:
src/
: Contains the source code for the web interfacebuild/
: Contains build artifacts (created during build)docs/
: Contains the deployable web applicationdocs/js/
: Contains the compiled JavaScript (web.js)docs/index.html
: The main HTML file for the web application
1ml/
: The 1ML compilerelixir-modules/
: Elixir modules dependency
- 1ML compiler (included in the 1ml/ directory)
- Elixir modules (included in the elixir-modules/ directory)
- OCaml with js_of_ocaml package
To build the project with the default settings, run:
./build.sh
This will compile the project and generate docs/js/web.js
.
You can also use make directly:
make
To clean the build artifacts:
make clean
The compiled project is deployed to:
docs/js/web.js
: The compiled JavaScriptdocs/index.html
: The main HTML file
The main source file is src/web.ml
. Other source files include:
src/code_execution.ml
: Code execution functionalitysrc/dom_utils.ml
: DOM utilitiessrc/editor_utils.ml
: Editor utilities- And others