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').