Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Riddle Playground

An in-browser playground for the Riddle language, powered by the compiler and browser-safe analysis modules from riddle-lsp, compiled to WebAssembly.

Live: https://riddle-lang.github.io/playground/

Repository layout

packages/
  compiler/   Rust → WASM adapter over riddlec and riddle-lsp
  web/        Next.js frontend (CodeMirror 6 editor)
.github/
  workflows/
    deploy.yml  clone riddle → build WASM + web → deploy a Pages artifact

Local development

Build the WASM compiler

# Clone the main riddle repo next to packages/
git clone --depth=1 https://github.com/riddle-lang/riddle.git packages/riddle-src

# Build (requires wasm-pack)
wasm-pack build packages/compiler --target web --out-dir ../web/public/wasm --release

Run the frontend

cd packages/web
npm install
npm run dev

The web app is a static export, so do not run it with next start. Preview a production build with any static HTTP server pointed at packages/web/out.

Run compiles the generated C in the browser with the pinned Emception 4.2.0 Clang/WASM toolchain. Production execution requires HTTPS and cross-origin isolation; the bundled COOP/COEP service worker performs the first-load reload. Toolchain files are fetched lazily from jsDelivr and cached by the browser.

The debug profile compiles with clang -O0 (fastest Run cycle) while the release profile keeps -O1 for faster generated code. Toolchain warmup starts when the page loads, and unchanged sources skip clang entirely: linked wasm binaries are cached in IndexedDB keyed by (toolchain, profile, source).

Deployment

Set Settings → Pages → Build and deployment → Source to GitHub Actions. No deployment branch is used: builds upload packages/web/out as a Pages artifact and deploy it directly.

Pushes to this repository's main branch deploy with the latest Riddle main. Manual runs can select a Riddle branch, tag, or commit SHA with riddle_ref.

About

A playground for riddle

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages