Shoddy Documentation

Machines

The Shoddy standard library, one page per machine

Each page covers one file under machines/. A page holds a summary, a note on why and how the machine is useful, and a short history of its subject area where there's one to tell. Then comes a user's guide, and a reference for every word in its public surface — every word the machine offers your program. Start with whichever machine your program already Includes.

The mathematical machines follow one written design. The charter states the family law every one of them keeps. The physics atlas maps a physics curriculum onto them, machine by machine.

Graphics & interaction

MachineWhat it's for
buzzer — MmlNotes parses MML to frequenciesbuzzerSound — note names, MIDI numbers, and a GW-BASIC-subset MML player over the Sound/NoteOn/SoundQueue builtins.Ready
keys — ClassifyKey then KeyGlyphkeysPhysical-key classification — raw key codes folded into friendly GameKeys for hotkeys and game controls.Ready
scribbler — Open, draw, blitscribblerA pixel-buffer drawing surface in a window, over the Scribbler* builtins — the event decoder and shape-drawing layer.Ready
terminal — Print a line, InKey a keystroketerminalThe raw console words — Print, Input, InputLine, InKey and Args. Documentation only: it declares nothing, because all five are builtins.Ready
turtle — Forward and TurnLeftturtlePurely functional turtle graphics — a Turtle value threaded through the program, drawing into a scribbler.Ready
vt100 — Bold wraps text in an escapevt100VT100 terminal escape codes — cursor movement, colour, and clearing.Ready

Core numerics

MachineWhat it's for
bool — a punched card, one hole per bitboolThe binary layer — number bases, bit operations, masks and fields, two's complement, the codes, the logic gates, truth tables and Quine–McCluskey minimisation. Shoddy has no bitwise builtins; this is why you need none.Ready
clock — FormatDurationclockTiming over the Ticks/Sleep/Clock builtins — monotonic measuring and wall-clock stamping.Ready
eng — a sine wave under an integral signengEngineering mathematics — trigonometry and hyperbolics, complex numbers, numeric calculus, a Runge–Kutta ODE stepper and root-finding, polynomials, number theory, the discrete distributions, units and physical constants.Ready
ephemeris — a crescent moon, a planet on its arc, and a starephemerisThe sky as arithmetic — sidereal time, altitude and azimuth for any observer, the sun and moon as sky positions, the moon's phase, distance, rise and set, and the five naked-eye planets from Keplerian elements. Pure, dated by argument, and no clock anywhere near it.Ready
geo — a globe crossed by a great circlegeoThe Earth as arithmetic — distance and bearing, routes and bounding boxes, cross-track and intersection, coordinates in every written form, geohash and Maidenhead, rhumb lines and the horizon, and where the sun is. Pure, sphere-based, and no network anywhere near it.Ready
julian — a calendar month with one day ringedjulianThe calendar as arithmetic — the one place the Gregorian leap rules are spelled: dates, serials, the astronomical Julian day, date arithmetic and weekdays. Pure, standalone, and it never reads a clock.Ready
math — Clamp and LerpmathThe derived math layer over the numeric builtins — E, Tau, Log2, LogBase, and friends.Ready

Sequences & text

MachineWhat it's for
regex — a pattern, and the run it matchesregexRegular expressions as a compiled value — a Pike VM that never backtracks, so no input can hang it and none can end the session. Leaving out backreferences and lookaround is what buys that.Ready
seq — Taken of a RangeseqSequences — Map/Filter/Fold and friends, over both List and Array.Ready
sinq — a jumbled list ordered and gatheredsinqQuerying a sequence — ordering by a key, grouping, joining, the set words, and a walker for a record graph that holds itself. The half of a query the rest of the library could not express.Ready
str — Split on a commastrString helpers built on Instr/Left/Right/Mid/Len — surgery, boolean conversions, number formatting.Ready

Algebra

MachineWhat it's for
alg — one expression rewritten as anotheralgSymbolic algebra over an expression type — exact rationals, a parser and printer, differentiation, factorisation, integration, limits and series, and a bridge that turns a formula into a function value.Ready
lin — a bracketed grid reduced to its diagonallinLinear algebra over matrix's Matrix — determinants, inverses, systems, rank, the LU/QR/Cholesky factorisations and eigenvalues.Ready
matrix — MatVec against the identitymatrixMatrices — dimensioned, flat row-major storage, O(1) access.Ready
sparse — a grid with only a few cells storedsparseMatrices that are mostly zeros — stored by column, a row index and a value per entry and nothing for the gaps. The working form for big thin problems; matrix stays the everyday grid.Ready

Money & finance

MachineWhat it's for
fin — a payment, a schedule, a yieldfinFinance: time value of money, loans, appraisal, depreciation, dates and bonds.Ready
money — MoneySplit keeps every pennymoneyExact money — whole cents in a Number, no floating-point drift.Ready

Statistics & machine learning

MachineWhat it's for
neural — Softmax turns scores into probabilitiesneuralFeed-forward neural networks — one hidden Tanh layer, mini-batch SGD with momentum, gradients as net-shaped values. Two heads over one backward pass: regression on squared error, classification on softmax and cross-entropy.Ready
plotter — Histogram onto a plotplotterStatistical charts — histogram, bar, pie, box, scatter — stats doing the arithmetic, scribbler doing the drawing.Ready
random — A seeded ShufflerandomRandom numbers, built on the Rnd builtin — seedless by construction; shuffling and sampling too.Ready
stats — Mean and StdDevstatsStatistics — descriptive measures, correlation and regression, and the classic tests with real p-values from the Erf/GammaP/BetaI builtins.Ready

Markup & data formats

MachineWhat it's for
csv — a quoted cell holds its commacsvCSV to RFC 4180, both directions — quoted cells, doubled quotes, line breaks inside a cell, and dialects for tabs, semicolons and comment lines. Rows, or a sheet with named columns, or straight into your own Type.Ready
html — HtmlParse then HLinkshtmlHTML, forgivingly — implied end tags, void and raw-text elements, an entity table, and the same tree xml builds.Ready
json — JsonParse then JPathjsonJSON to RFC 8259, both directions — a total reader that returns errors as values, compact and pretty writers, and path navigation.Ready
xml — XmlParse then XFindxmlXML 1.0, both directions — a total reader that returns errors as values, elements, attributes, comments, CDATA and the doctype all kept.Ready

Data & storage

MachineWhat it's for
dict — DictPut then DictGetOrdictDictionaries as association lists of Pair — honest, simple key/value lookup.Ready
file — WriteLines then ReadLinesfileLine-oriented text file I/O, built on the whole-file builtins.Ready
isam — IsamInsert then IsamGetisamIndexed-sequential files — a keyed database over a fixed-record binary file, index kept on disk as a B+tree in a companion .idx file.Ready
recio — PutRec then GetRecrecioRecord-oriented binary I/O — fixed-size records and the offset arithmetic that sits under isam.Ready
shaker — ShakeEncrypt then ShakeDecryptshakerReversible obfuscation — a four-round Feistel network over a list of Numbers, with a checksum so tampering is caught. Not a cryptosystem.Ready

Networking

MachineWhat it's for
https — HttpsGet then HttpBodyhttpsAn HTTP client over TLS — build a request, fetch it, take the reply apart. The parsing half is pure.Ready
net — Request over TCPnetTCP/IP client and server over the non-blocking TCP* builtins — connect, request/response, and a poll-driven accept loop. Gated behind --allow-net.Ready

Optimization

MachineWhat it's for
mip — a search tree splitting a fraction in twomipInteger programming by branch and bound over simplex — for the answers that have to be whole numbers, with honest sensitivity once the decisions are taken.Ready
mps — LoadMps reads an MPS filempsReading and writing MPS linear-programming files — the format that feeds simplex.Ready
simplex — Optimize returns a status and a costsimplexLinear programming via the simplex method.Ready

Runtime stack

MachineWhat it's for
cuttle — the last fold laid is the first liftedcuttleA heterogeneous runtime stack (one that mixes value types) any mill can hold as a value, and the pure algebra over it — Shoddy's own concatenative core, reified as a plain value.Ready
lineshaft — the engine drives every machine by beltlineshaftThe language's own control-flow and execution-failure words — Call, Ifte, Error and Assert. Documentation only: it declares nothing, because all four are builtins.Ready
reckoner — 3 4 + evaluates to 7reckonerAn interpreter for lines of RPN (reverse Polish notation — values first, then the operator), split on whitespace and run over cuttle's stack: dictionary, registers, modes, history and the combinators.Ready

The reckoner seeds bridge the rest of the standard library into this engine. They are not catalogued separately here, because they have no bearing outside it — see the seed list on reckoner's own page.