On this page
- Set up VS Code
- Zed and other editors
- Verada's browser IDE
- A first example: transform and reverse a vector
- Open or create an expression
- Edit blocks, text and symbols
- Source synchronization and Undo
- Where an expression runs
- Inputs, execution and results
- Counterexample inputs
- Lazy coordinate preview
- Troubleshooting
- Budgets
- A saved file, from the command line
APL Workbench
The APL Workbench opens an APL expression beside its Vada, Varc or Vibe source. Edit the expression as nested blocks or text, supply example inputs, and inspect a native result without running the surrounding application. The compiler checks accepted edits in their host program and performs the calculation; the panel does not implement a second APL language. It works in VS Code, in Zed and other editors through a browser page, in Verada's own browser IDE, and on a saved file from the command line.
An expression runs wherever its context fixes the subtype it takes (below). Source editing, running an example and proving the program are separate operations: a successful example is evidence about those inputs, not a proof for every input.
Set up VS Code
Install veradic and the extension as described in Editors and the language server. The workbench is veradic's: the language server keeps each panel's session, checks its edits, runs its examples in separate worker processes and holds their values; the extension shows the panel. After reinstalling veradic, use Verada: Restart the language server.
Native examples require a trusted workspace. Z3 must be available to the language server for proofs and counterexample searches. Normal example execution does not establish a proof. Vada and Varc files are recognized directly; Python/Vibe and Ada files use the extension's Verada-project rules, including a verada.toml, with verada.vibe enabled for Python.
The native runner uses POSIX process control: the Workbench runs on macOS and on Linux (where veradic builds from source; see Building and installing Verada). The extension runs the compiler on the workspace's host, beside its files; a virtual filesystem without a native workspace cannot run examples. In a Remote-SSH window, install the extension on the remote host (Install in SSH) and veradic there, with verada.path naming it if it is not on that host's PATH; the panel shows in your local window and the work happens on the remote host. (Remote-SSH itself needs a POSIX login shell on the remote host; with fish, give the host a RemoteCommand /bin/bash and turn on remote.SSH.enableRemoteCommand.)
Zed and other editors
Editors that do not host webview panels, such as Zed, open the workbench in a browser. Zed runs no language server in a project it does not trust: trust the project when Zed asks, and if the action below does not appear, restart Zed. Place the cursor in an APL string and choose the code action Open APL Workbench in a browser (Zed: Cmd+.), or its code lens. The language server opens the page in your browser; if the editor cannot open it, a message gives its private address. The page is the same canvas, and its accepted edits arrive in the editor's buffer as ordinary, undoable edits. The editor's workspace trust does not reach a browser page, so each page has its own Allow examples to run switch beside Run: until you turn it on, the page explores and edits but compiles and runs nothing. Turn it off again to stop runs. (workbench serve pages start with it on: you started the service yourself.)
Verada's browser IDE
In veradic ide, right-click in an APL string and choose Open APL Workbench (Cmd+K, Cmd+Shift+A), or use the lightbulb's action. The workbench opens in the pane beside the editor, where the Guide and Assistant open; its edits are the editor's, one Undo step each. Insert APL Expression… starts a new expression at the cursor.
A first example: transform and reverse a vector
Open the example project and its Vada source. The example declares a six-element vector with host indices -2 .. 3 and initializes its result with:
⌽ (X × 2) + 1
For X containing 1 2 3 4 5 6, (X × 2) + 1 denotes the vector 3 5 7 9 11 13. The outer ⌽ reverses that value, giving 13 11 9 7 5 3. This describes the expression's values; execution need not materialize the intermediate array or visit input positions in ascending order.
The complete source is:
pragma Extensions_Allowed (On);
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
type Vector is array (Integer range <>) of Integer;
X : constant Vector (-2 .. 3) := (1, 2, 3, 4, 5, 6);
Adjusted : constant Vector (-2 .. 3) := APL ("⌽ (X × 2) + 1");
begin
for Value of Adjusted loop
Put_Line (Integer'Image (Value));
end loop;
end Main;- Place the source cursor inside the APL string and choose Verada: Open APL Workbench. The canvas opens beside the source. It prepares the example inputs automatically when the source is ready; use Prepare inputs if preparation needs to be repeated.
- Under Try it → Inputs, enter
1 2 3 4 5 6forX. Spaces or commas separate cells. Its declared host bounds are-2 .. 3; fixed bounds are shown for reference. - Choose Run. The result table shows
13 11 9 7 5 3at host indices-2through3. - In the nested multiplication block, change the value
2to3. Once the compiler accepts the edit, it prints the source as⌽ ((X × 3) + 1), adding parentheses around the outer argument. Run with the same inputs to obtain19 16 13 10 7 4. - Focus the regular source editor and use its native Undo to restore the original expression. The canvas follows that source change; run again to recover
13 11 9 7 5 3. - Change the input cells and run again to compare results. Changing inputs alone does not run code or change the source expression.

The example project's notes repeat these steps.
The input cells are explicit examples supplied to the workbench. The runner does not execute the application's initialization to obtain them, even when the source contains an initial value for X. The full source file can also be checked and run with the ordinary command-line tools. From the repository root:
veradic run --proof full --project docs/manuals/examples/apl-workbench/vada/verada.tomlThis proves and runs the source program, printing the six values on separate lines. The expected output includes the leading space that Vada's Integer'Image writes for positive values.
Open or create an expression
Open an existing expression using any of these entry points:
- Verada: Open APL Workbench in the Command Palette or the editor, editor-tab or Explorer file context menu.
- The Open APL Workbench button in the source editor's title bar.
- The Open APL Workbench link above an APL expression, when
verada.apl.codeLensis enabled, or the expression's lightbulb/refactor action. - Cmd+K, Cmd+Shift+A on macOS, or Ctrl+K, Ctrl+Shift+A elsewhere.
A file-level command chooses the expression at the cursor, opens a sole expression, or offers a picker with source positions and previews. The panel remains attached to its file; moving the source cursor does not switch the selected expression. For files with several expressions, use the picker beside the panel's APL field. Identical expressions at different positions remain distinct.
Verada: Insert APL Expression starts an empty canvas at a host expression position. A complete, accepted assembly inserts its host-language wrapper at that position. Empty sockets never produce placeholder source. The command does not add required Vada pragmas or Vibe imports; prepare those in the source first. Source or dependency changes can invalidate the insertion position, in which case start the insertion again at the intended cursor.
Generated host expressions and literal spellings that cannot be mapped back to editable source remain read-only. Opening them for explanation does not make them writable.
The Structure section below the canvas lists the compiler's bound tree of the expression, a page at a time, for expressions of any size: the canvas draws up to 128 blocks and shows larger parts as text. Select a node to read its role, explore its inputs with Right or Explore, and choose Show in source to see it in the editor.
Edit blocks, text and symbols
The left-hand catalogue contains values and visible names, operations, functions and operators. Drag a block into a socket, or select the socket and click a catalogue block. Value and function sockets have different shapes and labels. Wrap keeps the selected subtree inside a new form. Forms the canvas cannot decompose remain editable APL fragment blocks instead of disappearing.
Find a block searches all categories by glyph, name and familiar terms such as map, filter, fold and prefix sum. These terms aid discovery; they are not additional syntax or a claim of identical semantics in another language. Hover a family, tile or operation to see its forms, examples and current restrictions. A value input offers an APL/Text choice; function inputs use APL.
APL multiplication is ×; * means power. For example, (X × 2) + 1 doubles and adds one, whereas (X * 2) + 1 squares and adds one. See the APL language reference for binding, primitives and host-language restrictions.
The APL field above the canvas accepts the expression's text, without its host wrapper. After a short pause, the compiler checks a local text draft; Ctrl/Cmd+Enter requests an immediate check. Accepted text updates the source and blocks. Incomplete or rejected text stays in the field, with the last valid canvas retained and block editing paused. A pending block draft similarly pauses text editing until it is resolved.
Use the symbol-picker button at the right of the APL field, Ctrl+Space, or a backtick. Choose a glyph with the pointer or Up/Down and Enter; Escape closes the list. Typing or moving the caret dismisses it and resumes ordinary editing. The picker replaces selected text or its opening backtick and works while the APL expression is unfinished.
In the regular source editor, Verada: Insert APL Symbol… supplies the same vocabulary inside an APL literal. Its shortcut is Cmd+K, Cmd+Shift+I on macOS and Ctrl+K, Ctrl+Shift+I elsewhere. Completion and backtick-key completion also provide glyphs. Insertion uses native text Undo and refuses selections spanning different literals.
Adjust Tile size to fit the expression. The dividers resize catalogue width and the canvas/input split; focus a divider to use arrow keys, Shift for larger steps, and Enter to reset. Text fields can be resized from their corner. These presentation settings do not change source or input values.
Everything works from the keyboard and with a screen reader (checked with VoiceOver's accessibility tree): each block and socket is a button or field named by its role and value ("Left value: 1 2 3", "Function: ×"), Tab moves through them in reading order, status lines are announced as they change, and the result table has a caption and row and column headers. Running keeps focus: it waits on Cancel during the run and returns to Run.
Source synchronization and Undo
A complete legal block assembly is printed and checked by the compiler, then updates the source buffer automatically. Each accepted update is one ordinary editor Undo transaction. It need not save the source file, open a closed source tab, move the source selection or change the active editor. Undo block edit and Redo handle the canvas's local editing history; native source Undo/Redo belongs to the source editor.
Incomplete assemblies stay on the canvas without changing source. The APL field's border and accompanying status distinguish synchronized text, unfinished/pending work and failed synchronization. Read the status rather than relying on colour alone.
Manual source edits and source Undo/Redo rebuild a clean canvas. Invalid APL remains a repairable fragment. If the host wrapper itself becomes unreadable, the previous canvas is retained with an unavailable status. When source changes while a local draft is unfinished, choose Recheck my draft against source to validate that draft in the new context, or Reload source to discard it and use the current source. Reload is the small ↻ beside the APL field, shown when a draft or recovery state needs it; synchronized panels follow source changes automatically.
Switching expressions retains each expression's draft and input text for the panel's lifetime, but cancels pending work for the previous expression. A retained draft whose source context changed needs explicit rechecking. A removed expression does not silently attach its draft to a nearby occurrence.
Where an expression runs
An example runs the APL expression alone, as a function of the inputs it reads, with the subtype its context gives it. The contexts that give one are:
| Context | The subtype |
|---|---|
an object's initial value, X : T := APL (...) |
the object's |
an assignment to a whole object, X := APL (...) |
the object's, which must be a constrained subtype |
return APL (...), or an expression function's body |
the function's result subtype |
an in actual parameter, F (APL (...)) |
the formal parameter's |
a qualified expression, T'(APL (...)) |
T |
The innermost of these around the expression is used. An APL expression assigned to a slice or a component, given as an out or in out actual, or assigned to an object whose bounds come from its initial value can be explored and edited, but the panel says why it does not run; write it as the initial value of a constant of the subtype wanted to try it.
Inputs, execution and results
Preparation checks the selected expression in its context and captures its resolved source files, including unsaved editor buffers. It identifies the values that you must supply explicitly; values known statically can remain part of the compiled expression. The run uses those source bytes and inputs in a separate worker; it does not run application startup or an unapplied draft. Source, dependency and project-configuration changes invalidate preparation and results. Prepare again before relying on a new run.
The runner admits machine integers, Float/Long_Float and Booleans, as scalars and as rectangular arrays of any rank. Integer cells use exact decimal text; Boolean cells are true or false; floating-point cells use finite decimal values. Array cells are entered in row order. Supply exactly the number of cells implied by the shape. Scalar and component constraints are checked, and values outside them are rejected.
Fixed array bounds come from the host declaration. Some runtime bounds can depend on explicit immutable scalar inputs; these appear before their arrays. Enter matching lower bounds and lengths. Mutable bounds, unsupported predicates, dynamic scalar/component constraints and uninspected host calls remain outside the supported subset. Pure host expression functions are admitted only when the compiler can inspect their bodies, contracts and dependencies; foreign, recursive, effectful and statement-body calls remain unavailable.
Host indices and logical APL positions describe different coordinates. In the first example the host result starts at -2, while its first logical APL position is 0. Result tables and input bounds use the declared host indices. A sample's APL position, when one is available, is explicitly labelled as zero-based.
Run brings the completed result into view. Cancel stops its worker. Changing inputs clears the block samples; any retained output is labelled as belonging to the previous run. Changing source invalidates the results. Run again to obtain current values. Inputs and results are limited by the cell budget (65,536 unless changed), and the panel displays at most 256 cells in one window. Under Result range and exact values, select per-axis starts and counts and choose Show range to inspect another window; an array of rank two or more shows one plane of its last two axes at a time. Paging a completed result does not make the computation itself lazy.
Integers remain exact. Floating-point results display decimal values, with exact IEEE bits available through cell help and the copy field, including negative zero. Compatible consecutive results from the same preparation are compared exactly; changes to type, shape or bounds are reported separately. A failed, cancelled or incomplete run does not publish a partial result.
Save useful input sets
Expand Saved inputs, give the current inputs a name and choose Save. Choose a saved set and Load to restore it without executing it. Sets from an earlier source revision are labelled for review, and incompatible shapes or types are refused. Saving is explicit; merely typing inputs or finding a counterexample does not save them.
Up to eight sets share a 256 KiB budget. VS Code retains explicitly saved sets in the panel's saved state; the browser fallback retains them only for its session. Saved sets contain inputs and their provenance, not a running worker or a durable result. Use source-controlled tests for examples that must remain part of a project's regression suite.
Read intermediate samples
The canvas can annotate supported value blocks with Samples from diagnostic runs using the current inputs. They are actual scalar execution occurrences, not reconstructed intermediate arrays. A scan, reduction or fused expression can execute a source operation several times, eliminate it, or give it no separate observable scalar boundary.
In the captured run of ⌽ (X × 2) + 1 with inputs 1 2 3 4 5 6, the multiplication block shows samples 12 10 8 6 4 2 from six executions, at logical APL positions [5] [4] [3] [2] [1] [0]. The addition block shows 13 11 9 7 5 3. These lists record the actual execution order: this run visits the higher input positions first. They are not a reordered display of an intermediate array. Read each run's positions and ordinals rather than assuming that samples follow ascending input indices.

Here the addition samples and final result happen to contain the same six values. The Samples annotation records executions and their logical positions; Result describes the completed vector and its shape. The screenshot is scrolled to these annotations rather than showing the whole nested expression at this scale.
For a specific occurrence, select a value block and expand Inspect an execution occurrence. Choose an Execution ordinal and Run and inspect; optionally restrict it to an Expanded computation. Ordinal 0 means the first execution, not array index zero. The result identifies the chosen source computation and occurrence, and includes a logical APL position where the compiler has a checked mapping. An unavailable site reports why it cannot be inspected.
Each block is observed in a separate diagnostic run of the whole checked expression, so the badges do not form one combined timeline across blocks. A later failure or cancellation discards its samples together with the result. Up to 16 intermediate blocks can be annotated, with the first 32 matching scalar occurrences retained and a compact subset shown on a tile. These samples explain an example's execution; they do not replace the original program's proof obligations.
Counterexample inputs
After preparation, Counterexample inputs → Find input candidates asks the prover about checks in the original source context. A candidate is offered only when its failing check lies inside the selected expression and every captured input can be reconstructed exactly and validated. Candidates are complete integer and Boolean scalar inputs, each a constant or an in parameter of the enclosing subprogram: the solver's model gives values on entry to the subprogram, which a variable may no longer have where the expression runs. Array and floating-point inputs, ambiguous bindings and partial models are not offered (a model of an array gives only the cells the proof needed). A local subprogram that is proved only at its callers offers no candidates.
For example, this program has APL ("⌊ 1 ÷ X") in a function with an integer parameter:
pragma Extensions_Allowed (On);
procedure Main is
function Divide (X : Integer) return Integer with Pre => True is
R : Integer := APL ("⌊ 1 ÷ X");
begin
return R;
end Divide;
begin
null;
end Main;Its explicit Pre => True gives the nested function its own proof context. The search finds X = 0. Choose the original check, Load candidate inputs, then Run to observe division by zero. Changing X to 1 produces 1.
Loading neither runs nor saves the candidate. Explicitly saving it preserves its solver provenance; manually editing its inputs clears that association. A search has a bounded nine-second process budget. No candidates can mean unsupported inputs, incomplete models, a timeout or no model found; it is not a proof of safety. A solver replay and a native workbench run are distinct, and a failed run is not automatically identified as the same failure as the original solver check.
Lazy coordinate preview
Lazy coordinate preview is an additional operation for supported mappings over one captured rectangular array. Identity, reverse, transpose and supported compositions can map requested result cells to input cells without materializing the output. Focus a cell to see the exact input coordinate supplying it.
The compiler must establish a fixed-axis mapping with an identical component subtype. Runtime shape calculations, element arithmetic, cyclic reshape, filters and reductions are outside this preview. The transformation example therefore uses ordinary Run because it combines reversal with element arithmetic. A mapped preview is labelled separately because it has not executed the initializer; ordinary Run remains available for its checked native computation.
Troubleshooting
| Symptom | What to check |
|---|---|
| No workbench command or link | Install the matching extension, reload VS Code, check the source language/project association and verada.apl.codeLens. A file without APL needs Insert APL Expression. |
| Inputs or Run remain unavailable | Read the preparation status, check workspace trust and fix host syntax/type errors. The selected expression must be a supported whole initializer. |
| Compiler identity mismatch after a build | The compiler changed under the running language server. Restart the Verada language server and prepare again. |
| An edited expression has not reached the source | Finish missing sockets or correct the text draft. For a source/draft conflict, explicitly recheck the draft or reload source. |
| Wrong cell count or array bounds | Use the captured shape and its host indices. For runtime bounds, make scalar bound inputs agree with the supplied array axes. |
| No sample on a block | Static folding, fusion or an unsupported scalar boundary may leave no observation. An execution ordinal can also exceed the actual number of occurrences. |
| No counterexample candidates | Read the search status. Array/float inputs and incomplete models are excluded, and absence of candidates does not prove the initializer. |
| A run or analysis exceeds its budget | Reduce the example, or raise the budget named in the message. A large result window cannot avoid the cost of an ordinary full run. |
| Run says it needs a trusted workspace | In VS Code, trust the workspace. In a browser page, turn on Allow examples to run. |
| The panel says the expression does not run | Its context does not fix its subtype (where an expression runs), or it was written by the host syntax rather than as an APL literal. |
Budgets
Each example and analysis runs under budgets that keep an editor session responsive. They are settings: in VS Code verada.workbench.NAME; in Zed and other editors the language server's initialization option workbench, for example "lsp": {"veradic": {"initialization_options": {"workbench": {"runMs": 10000}}}}; for veradic workbench serve, --budget NAME=VALUE. A change applies to the next run.
| Budget | Default | Bounds |
|---|---|---|
compileMs |
10000 | compiling an example |
runMs |
2000 | running it and exporting its result |
killMs |
500 | from cancelling a run to killing its process |
analysisMs |
9000 | a counterexample search or a context analysis |
requestMs |
10000 | one workbench request, and the editor's applying an edit |
workers |
2 | runs and analyses at once |
maxCells |
65536 | an example's input cells, its result, an inspection's occurrences |
memoryMiB |
1024 | a run's or analysis's resident memory, sampled |
resultMiB |
16 | one stored result |
storeMiB |
256 | all the results a session keeps |
The memory budget is a sampled watchdog, not a hostile-code sandbox: use a trusted workspace. Fixed bounds protect the session itself: 8 MiB source files, 256 KiB APL text, 512 inputs and 32 levels in a block draft, eight panels and four requests at once.
A saved file, from the command line
veradic workbench serve opens the workbench on a saved file, without an editor that hosts it:
veradic workbench serve /absolute/path/main.va 12 24Give the source path and the APL expression's line and column (one-based; columns count UTF-16 code units). Open the private address it prints in a browser on the same computer; do not publish it. The page is the same canvas. The service never writes the file: an edit you accept is shown with its place for you to copy into your editor, and once you save the file the page follows it. Add --create before the path to build a new expression at a host expression position, --minutes N to serve for other than an hour, and --budget NAME=VALUE to change a budget. Ctrl-C stops it.
For language meaning, use the APL reference. For project-wide checks and proofs use check and prove; for interactive declarations and statements use the separate REPL.