RingScript puts a real programming-language VM inside the browser — compiled to WebAssembly, resident in the page. You write clear, boring, readable code. No build step, no bundler, no node_modules, no framework to relearn next year.
A name field, a greeting, a click counter. Below are the two versions of the very same page — line for line, same length, same order — so the only thing that differs is how the logic reads.
Both start from identical markup, and the Ring version adds two setup lines once per page:
<input id="guest"> // the markup, shared by both <button>Greet</button> <div id="hello"></div> <script src="ringscript.js"></script> // Ring only: once per page <script>RingScript.boot()</script>
let clicks = 0; document.getElementById("go") .addEventListener("click", function () { const input = document.getElementById("guest"); let name = input.value; if (name === "") { name = "stranger"; } document.getElementById("hello").textContent = "Ahlan, " + name + "!"; clicks = clicks + 1; });
nClicks = 0 func Greet cName = Page(:getvalue, [ :id = "guest" ]) if cName = "" cName = "stranger" ok Page(:settext, [ :id = "hello", :text = "Ahlan, " + cName + "!" ]) nClicks++
No listener to register, no node to look up twice,
no closure to reason about: the button says ring.call('Greet') and the function
is called Greet. That is the whole trick — and it holds as the page grows.
One virtual machine lives for the whole page. Define something in one evaluation, use it in the next — variables, functions and classes simply stay.
A mistake returns a message with its real line number and the VM keeps running. A thousand failing evaluations later, memory is still flat.
ring.call("Price", {qty: 3}) goes in as JSON and comes back as JSON.
Ring can call your JavaScript too. The seam is thin — and optional.
A loader and a wasm module. Drop them next to your HTML on GitHub Pages, nginx, S3, a shared host. No toolchain, ever.
It is Ring's own compiler and VM compiled to WebAssembly — verified to print byte-identical output to the native interpreter.
Ring is small, dynamic and readable, with lists, OOP, declarative blocks and natural-language syntax. Learn it in an afternoon.
ringscript.js and
ringscript.wasm. Or, with Ring installed:
ringpm install ringscript from mayouni.RingScript.boot() — which starts the VM
and runs every <script type="text/ring"> block on the page.ring.call('Name'); read and write the page with Page()."It runs Ring" is a claim worth checking, so it is checked continuously against the native interpreter — the whole official sample set and every code block in Ring's documentation.
Inside a browser there are no files, no OS calls, no threads — the same rules every web app lives by. Ring programs that ask for them get a clean, catchable error rather than a dead runtime. Everything else in the language behaves exactly as it does natively.
RingScript is for page logic, business rules, teaching, notebooks and offline-first apps. For heavy number crunching, keep using what you already use.