Home

Awesome

PlutoScript

Write Pluto, a Lua dialect, anywhere JavaScript works.

Usage

You simply need to load a suitable WASM build of libpluto, and then PlutoScript itself:

<script src="https://plutolang.github.io/wasm-builds/out/libpluto/0.9.4/libpluto.js"></script>
<script src="https://plutolang.github.io/PlutoScript/plutoscript.js"></script>

Example

A simple example is the Base32 Encoder tool that is available online here.

Barring the script tags needed for PlutoScript's usage, this is the entire source code:

<textarea id="plain"></textarea>
<textarea id="encoded"></textarea>
<script type="pluto">
    document.getElementById("plain"):addEventListener("input", function()
        document.getElementById("encoded").value = require"base32".encode(document.getElementById("plain").value)
    end)
</script>

JavaScript API

Pluto API