Online playground
The online playground is available at https://xmlang.ggorg.xyz.
It automatically saves your code in the browser's local storage, so you don't lose it.
Loading code from GitHub
Note: This will replace the code you saved in the browser's local storage.
Gist
The playground supports loading code from GitHub Gist.
The Gist has to contain a single XML file with your code. If it contains multiple files, the first one will be used.
To load a Gist, get its ID (the part after your username in the URL) and append it to the playground URL like this:
https://xmlang.ggorg.xyz/?gist=8da581666cbfd662d6d5fbbe8fce3ca7
The above URL will load the code from this Gist.
Repository
The playground also supports loading code from a file in a GitHub repository.
To load a file, append the repository owner, name, branch and the path to the file to the playground URL like this:
https://xmlang.ggorg.xyz/?owner=GGORG0&repo=xmlang&branch=master&file=examples/hello.xml
The above URL will load the code from this file.
Stack
- WebAssembly (via Wasmer.js) - allows running the XMLang interpreter in the browser inside a full WASI environment with a virtual filesystem.
- CodeMirror - code editor
- Xterm.js - terminal emulator
- Vite - build tool
Building
-
Install the following dependencies:
-
Clone the repository:
git clone https://github.com/GGORG0/xmlang.git
-
Change to the project directory:
cd xmlang
-
Build the WebAssembly module (optional - this will be done automatically by Vite during the build):
cargo build --release --target wasm32-wasip1
-
Build the documentation (optional):
mdbook build
The documentation will be built in the
book
directory. -
Change to the
playground
directory:cd playground
-
Install the dependencies:
pnpm install
-
Build the project:
pnpm build
Or start the development server:
pnpm dev