Pequod / PiROS manual ↑ rowan.id.au
PiROS · userland scripting

The Pequod manual

Pequod is a small PHP-flavoured scripting and templating language for PiROS. You run it as the psh command — freestanding scripts from the shell, and, served by the tintin web server, it turns .psh files into dynamic web pages backed by the queequeg SQL engine.

Everything here runs on a from-scratch OS: no libc, no framework. Pequod is a tree-walking interpreter that lives entirely in a signed, ring-3 program and reaches the system only through the PiROS syscall ABI. This manual is task-first — each page ends with examples you can paste and adapt.

01

Basic usage

Running scripts, variables, types, strings, operators, comments, and the two ways Pequod reads a file.

02

Command reference

Every control structure, operator, array form, and built-in function — with exact syntax.

03

Shell scripting

Functions, include libraries, reading and writing files, and practical script recipes.

04

Web pages with tintin

Template mode, <?= ?>, forms with $_GET/$_POST, and safe HTML output.

05

SQL via Queequeg

qq_query, result arrays, writes, error handling, and injection-safe qq_quote.

Conventions. Paths like files/page.psh are relative to your PiROS /data/<user>/files store. A file cap of 4096 bytes applies to scripts and to values read/written via psh; large jobs are split with include. Every example was written against the shipped interpreter.