Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

  1. Install the following dependencies:

    • Node.js
    • Pnpm (corepack enable)
    • Rust (with the wasm32-wasip1 target: rustup target add wasm32-wasip1) - to build the WebAssembly module
    • mdBook (optional) - to build the documentation
  2. Clone the repository:

    git clone https://github.com/GGORG0/xmlang.git
    
  3. Change to the project directory:

    cd xmlang
    
  4. Build the WebAssembly module (optional - this will be done automatically by Vite during the build):

    cargo build --release --target wasm32-wasip1
    
  5. Build the documentation (optional):

    mdbook build
    

    The documentation will be built in the book directory.

  6. Change to the playground directory:

    cd playground
    
  7. Install the dependencies:

    pnpm install
    
  8. Build the project:

    pnpm build
    

    Or start the development server:

    pnpm dev