The PostScript Editor lets you work with that program directly. You can write
or open .ps and
.eps source, run it, see what it draws, and inspect
anything it writes to %stdout or %stderr.
The editor is also a full debugger. You can set breakpoints, step into, over, or out of procedures, inspect PostScript's operand, call, and dictionary stacks, and evaluate expressions against a paused program from the console.
Press PostScript… on the home screen. The editor is a page, not a document window — it replaces the whole app frame the way the home screen does, and the < button at the left of the menu bar goes back. Documents you had open are untouched and are still there when you return.
The page is three resizable columns:
%stdout and
%stderr, with the console entry line along its bottom edge.
A status line runs along the foot of the page.
These are three separate things here, which explains most of the editor's behavior:
| Thing | What it is |
|---|---|
| File | Bytes on disk. This is what run reads — always. |
| Buffer | One file as you are editing it: its text, its unsaved changes and its breakpoints. |
| Tab | A view of a buffer, opened on demand. |
A buffer can exist, hold breakpoints and be executed with no tab at all — running a library is not a reason to look at it. Closing a tab drops the view and keeps the buffer, which is why breakpoints survive closing a tab.
File ▸ New File… asks for a name up front, so there is never an untitled file to name later — which is why Run can save your work without stopping to ask.
Pressing Run saves every changed buffer and then executes the active one from disk. So
(lib.ps) run means here what it means in Ghostscript, and one tab can call
another. The console is the exception — see below.
Programs go in the app's own storage under user/postscript. That is the folder
run searches, and it is where the first Open or Save As in the in-app files
browser starts. The shipped samples live one level down, in
user/postscript/examples, so the library root stays yours:
| Sample | What it shows |
|---|---|
hello.ps | The smallest useful program — it computes, prints with =, and draws. |
stepping.ps | Written to be stepped: put a breakpoint on the fill inside /bar and the preview gains one bar per stop. |
lib.ps | A small procedure library, meant to be pulled in with run. |
uses-lib.ps | The other half of the pair — step into the run and lib.ps opens as its own tab. |
You can open a .ps file from anywhere with File ▸ Open… (either
the in-app files browser or the native picker — the split menu remembers which you prefer).
A file opened from an arbitrary folder runs fine as the active program, but it cannot be
reached by run from another program: (name) run resolves bare
filenames under user/postscript only — beside the asking file first, then at the
library root, which is how examples/uses-lib.ps finds examples/lib.ps.
No ../, no absolute paths.
| Control | Does |
|---|---|
| ▶ Run / Continue | Runs until the next breakpoint, or to the end. With no breakpoints set, continuing is running — it is one verb. |
| Step Into | One operation, entering procedures and run files. |
| Over | Runs a called procedure to completion and stops after it. |
| Out | Finishes the current procedure and stops in its caller. |
| Restart | Back to before the program ran: the drawing, the printed output, the stacks and the paused position all go. |
bx w add by lineto is five of them. The current line gets a band and the exact
operation being executed gets a tighter highlight inside it, so stepping across a line
visibly advances.
Editing discards a run in progress — the program you were stepping no longer exists. Breakpoints are not discarded: they move with the text, so typing a line at the top of a file renumbers every breakpoint in it.
PostScript has three stacks and all three are shown, operand stack first — in a stack language
that is the program state. Values are written the way the language writes them
(-dict-, {proc}, (str), /name). Clicking a
call-stack row reveals that frame's call site, opening its tab if it is not already showing.
The line under the Output pane. Type PostScript and press Enter: it is evaluated
against the live interpreter, so it sees the paused program's dictionaries and
leaves its results on the real operand stack. w = prints the value of
w as the program sees it right now, and the program's own position does not
move.
The console is the one thing here that is not a file: paste-and-try needs no file.