A browser-based runner for Saq, a minimal scripting language where everything is a call or a block — no operators, no keywords.
Live: https://pyanahida.github.io/saq_online_runner/
Open the page, edit the code in the editor, and press Run.
Output appears in the console below. input(...) opens a modal dialog.
The editor loads its sample program from eg.txt.
- Entry:
main{ ... } - Variables:
var(k, v)declares;rs(k, v)/reset(k, v)reassigns;v('k')or#kreads. Accessing an undeclared variable is a fatal error. - Sugar:
#a(v)reassigns (a = v);#a(#b)isa = b;##kisvg('k')for system variables. #lexing: greedy over[0-9A-Za-z\-_], truncates at the first character outside that set.- System variables (read-only):
##ipt,##time,##clock. - Comparison / logic:
eq gt lt and or not. - Branching:
if(cond, { ... }),if-else(cond, { ... }, { ... }). - Loops:
loop(n, { ... })(autotonum),while(cond, { ... }). Nobreak/continue. - Arithmetic:
add sub mul div mod, implicit numeric coercion.modtakes the sign ofa * b. Numbers are JS-styleNumber. - Strings: single quotes only; escapes
\n \t \r \\ \'.cat(a, b)concatenates;tonum(s)converts, returningNaNon failure. - Self-add:
sa('k', x)≡rs(k, add(v(k), x)). - I/O:
say(...),input('text')writes to system variableipt. - Errors: value-level failures yield
NaNsilently; undeclared variable access halts the whole program. Noisnan— usenot(eq(#x, #x)).
main{
input('Enter a number');
var('n', tonum(##ipt));
if(not(eq(#n, #n)), {
say('Not a number');
}, {
var('i', 0);
var('sum', 0);
while(lt(#i, #n), {
sa('sum', #i);
sa('i', 1);
});
say(cat('Sum: ', #sum));
});
}
Because eg.txt is loaded via fetch, serve the directory over HTTP:
python -m http.server
Then open http://localhost:8000/.
- v1.3.0 — English UI, mobile layout
- v1.2.0 — hosted on GitHub Pages
- v1.1.0 — sample program moved to
eg.txt - v1.0.0 — initial release