Playground Documentation Challenges Full Docs

API

Submit Formall source code and receive interpreted output files.

Upload & Run

Upload a .fl file or paste source code directly to interpret:

📁 Choose a .fl file or drag & drop it here

Endpoints

POST /api/run

Submit source code for interpretation. Accepts either a file upload or raw source text.

POST /api/run

Request (file upload)

Content-Type: multipart/form-data

ParameterTypeDescription
filefileFormall source file (.fl). Max 2 MB.

Request (source text)

Content-Type: multipart/form-data or application/x-www-form-urlencoded

ParameterTypeDescription
sourcestringFormall source code as plain text. Max 2 MB.

Response

200 OK
{
  "success": true,
  "token": "aBcDeFgHiJkLmNoPqRsTuVxYz012345",
  "status_url": "/api/status?token=aBcDeFgHiJkLmNoPqRsTuVxYz012345",
  "files": {
    "source":     "/files/TOKEN/source.fl",
    "output":     "/files/TOKEN/output.txt",
    "result":     "/files/TOKEN/result.txt",
    "statements": "/files/TOKEN/statements.txt",
    "log":        "/files/TOKEN/log.txt",
    "messages":   "/files/TOKEN/messages.txt",
    "tree":       "/files/TOKEN/tree.txt",
    "links":      "/files/TOKEN/links.txt",
    "labels":     "/files/TOKEN/labels.txt"
  }
}
ℹ
Interpretation runs asynchronously. Use the status_url to poll for results.

GET /api/status

Check whether the interpretation has finished. Once ready is true, download result files via the URLs returned by /api/run.

GET /api/status?token=TOKEN
ParameterTypeDescription
tokenstring32-character alphanumeric session token returned by /api/run.

Response (processing)

200 OK
{ "ready": false }

Response (ready)

200 OK
{ "ready": true, "ok": true, "exit_code": 0 }

ok is true when the code is checked without errors (exit code 0); exit code 1 means an error in the code, other codes a failure of the interpreter.

GET /files/{token}/{filename}

Download individual result files directly once interpretation is complete.

Available files (the interpreter runs as formall source.fl -o DIR, see the command line):

  • source.fl — the source
  • output.txt — what the interpreter printed: the error, warnings and notices about the source, and the result line OK <seconds> or ERROR <seconds>
  • result.txt — the result line alone, written last
  • statements.txt — every statement with its position
  • log.txt — every command with the statements it gives and all messages
  • messages.txt — all errors, warnings, notices and remarks, also about imported files
  • labels.txt — labels and their statements
  • links.txt — the premises of every statement
  • tree.txt — the block tree (for debugging the interpreter)

Runs made before 2026-10-11 keep their old file names (out.fl, log.fl, log.messages.fl, …).

Command line

The same interpreter runs locally:

formall FILE.fl [options]

  -o, --out DIR        all reports with standard names in DIR (created if missing); result.txt last
  --log FILE           every command with the statements it gives and all messages
  --statements FILE    every statement with its position
  --messages FILE      all errors, warnings, notices and remarks, also about imported files
  --links FILE, --labels FILE, --tree FILE, --result FILE
  --certificate-journal FILE  a certificate of every statement (JSON lines), checked by the independent kernel
  --trust FILE         the axioms, definitions, rules and conditions of every theorem T::
  --profile FILE       where the time went
  --cache DIR          where module objects are kept (default: .formall next to formall.project, else ~/.cache/formall)
  -j, --jobs N         modules compiled in parallel
  --import-root DIR    also allow import() from DIR;  --allow-any-import
  --explicit           every value and fact is written (calls)
  --prefix, --no-fold  printing;  -q, --quiet  only the error on stderr;  -h, --help

Imported files are modules: each is checked once and kept as an object in the cache; only what changed is checked again (import).

The last line on stdout is OK <seconds> or ERROR <seconds>; the exit code is 0 (OK), 1 (an error in the file) or 2 (a wrong command line, a file that cannot be read or written). The error, and the warnings and notices about the file itself (not about imported files, not about text generated by decide), go to stderr.

Errors

Error responses use standard HTTP status codes:

CodeMeaning
400No input provided
405Method not allowed (use POST for /api/run)
413File or source too large
500Internal server error

Examples

cURL — file upload

Shell
curl -X POST -F "file=@example.fl" https://formall.mooo.com/api/run

cURL — source text

Shell
curl -X POST -d "source=for x (do)" https://formall.mooo.com/api/run

cURL — check status

Shell
curl https://formall.mooo.com/api/status?token=YOUR_TOKEN

JavaScript (fetch)

ℹ
This example is for browser environments. Paste it into the browser console (F12) on any webpage.
JavaScript
// Create file input element
const fileInput = document.createElement('input');
fileInput.type = 'file';
document.body.appendChild(fileInput);

// Handle file selection
fileInput.onchange = async () => {
    try {
        // Prepare form data with selected file
        const form = new FormData();
        form.append('file', fileInput.files[0]);

        // Upload file
        const res = await fetch('https://formall.mooo.com/api/run', {
            method: 'POST',
            body: form
        });
        const data = await res.json();

        // Poll for completion
        const poll = async (token) => {
            const r = await fetch(`https://formall.mooo.com/api/status?token=${token}`);
            const s = await r.json();
            if (s.ready) return s;
            await new Promise(r => setTimeout(r, 1000));
            return poll(token);
        };

        await poll(data.token);

        // Download output file
        const output = await fetch(`https://formall.mooo.com${data.files.output}`)
            .then(r => r.text());
        console.log(output);

    } catch (error) {
        console.error('Error:', error);
    }
};

// Open file picker
fileInput.click();

Python (requests)

Python
import requests, time

# Upload file
r = requests.post('https://formall.mooo.com/api/run',
                   files={'file': open('example.fl', 'rb')})
data = r.json()
token = data['token']

# Poll for results
while True:
    s = requests.get(f'https://formall.mooo.com/api/status?token={token}').json()
    if s['ready']:
        break
    time.sleep(1)

# Download output
output = requests.get(f'https://formall.mooo.com{data["files"]["output"]}').text
print(output)