HTPL Playground

Hyper Text Programming Language — one file, full stack. Frontend, middleend and backend in HTML format.

Version 0.2. No garbage collector. Ownership, move, borrow and drop, like Rust.

How it works

Run the server, then open the built page in your browser. Pick an example, edit the code, press Run. The server runs your code with eval_htpl and returns the output.

htpl run playground/app.htpl --port 3200
htpl build playground/app.htpl -o playground.html
# open playground.html in your browser

Memory, like Rust

Copy types: number, bool, null. Move types: string, array, object. Assigning a bare Move variable moves it. Borrow with ampersand: many immutable borrows or one mutable borrow, never both. No assigning while borrowed. Write through a mutable borrow with star. Borrows end at scope end.

Examples

Playground

Pick an example, edit it, press Run. Input and server are not supported inside eval.



Output will appear here.