← DGT Tools
MaddLang SilverJavaScript Edition

PORTABLE · SANDBOXED · NO BUILD STEP

Write silver.
Run safely.

A browser-focused JavaScript implementation informed by the current MaddLang-rs Silver standard, with explicit sandbox extensions for custom commands and DOM plugins. Programs run locally in a disposable Web Worker with strict time, loop, call-depth, step, and output limits.

Level 1 active
OUTPUT

Ready. Functions only run when called; return values only appear when printed, assigned, or run as the selected entry.

MaddLang Console runtime, errors, worker, and plugin events

Language

string name = "value"uint count = 3uint[] values = [1, 2, 3]print(name, count)set name = value (legacy/host)add count 1unset nameecho $nameif $name == "value" { … }while $count != 3 { … }assert $count == 3fn main { … }call function_namecommand my_command { javascript … }my_commandreturn $value

Safe host API

host console.print, "text"host text.length, "text"host text.upper, "text"host text.lower, "TEXT"host array.length, "$items"host time.nowconst nodes = await page.texts()await page.setText(index, text)await page.wait(milliseconds)

JavaScript commands run in a disposable worker and receive only a text-node page capability. Eligible text on this actual page can be changed; controls and code are protected. The editor, Tools navigation, filesystem, shell, cookies, accounts, and network are not exposed.

Use the runtime

<script src="maddlang-silver.js"></script>
<script>
await MaddLangSilver.run(source, {
  write: console.log,
  host: { "my.safe.fn": async args => args[0] }
});
</script>

Current Silver standard · Current Gold standard

The runtime is also CommonJS-compatible: require('./maddlang-silver.js').