Learn
Example corpus#
Complete programs, one per file, that fixed the surface of the language; the test suite parses, checks and formats every one.
Hand-written programs that fix the surface of Renyi before the parser exists.
They are the input to the LLM readability test (docs/design/03-readability-test.md)
and become the first conformance tests at M1. Every file follows
docs/design/02-syntax-sketch.md; python3 tools/lint_examples.py checks the
parts a regular expression can see.
- File: hello.ryUse case: CLIDemonstrates: module header,
main, capabilities,otherwisedefault, interpolation - File: temperature_table.ryUse case: scriptDemonstrates: pure function with
example:lines, ranges withby, Decimal literals - File: shapes.ryUse case: libraryDemonstrates: sum type, refinement on variant fields, ability declaration and implementation,
matchas expression,maybe - File: active_users.ryUse case: dataDemonstrates: refined alias, record with derived
FromJson, multi-line query, error union - File: word_count.ryUse case: dataDemonstrates: nested query sources,
group by,sorted by ... descending,take - File: weather.ryUse case: agent / API glueDemonstrates: HTTP and JSON, generic decoding through a
letannotation,success/failurematching with typed error patterns, capability scoped to one host, areplaystest with its recording underfixtures/ - File: invoice.ryUse case: libraryDemonstrates: exact money with Decimal, refinements with
and,see also,testblocks withcheck - File: retry.ryUse case: libraryDemonstrates: function-typed parameter,
for anywith a constraint, mutable locals,timeandrandomcapabilities, wrapped parameter list - File: concurrent_fetch.ryUse case: agent / API glueDemonstrates:
concurrentlyquery,run concurrentlyblock with awithindeadline, loop header withsorted by, areplaystest - File: currency_tool.ryUse case: agent toolDemonstrates:
expose as tool, refinedTextsubtype used as a map key, three-way error union, areplaystest - File: sales_report.ryUse case: dataDemonstrates: CSV rows with
mayberesults, error translation withotherwise fail with, mutableMap, writing a file, capabilities scoped to one directory - File: config.ryUse case: serviceDemonstrates: refined subtypes, decoder-enforced constraints,
deprecated: ... replaced by, fallback withotherwise - File: http_service.ryUse case: backend serviceDemonstrates: pure request handler passed by name,
matchon text,otherwise returnearly exit - File: todo_cli.ryUse case: CLIDemonstrates: commands as a sum type,
example:on parsing,with_index, fallible construction withotherwisedefault - File: traffic_light.ryUse case: libraryDemonstrates: state machine as nested
matchover two sum types,can ToTexton a sum type, accumulating loop - File: expression_tree.ryUse case: libraryDemonstrates: recursive sum type and recursive functions over it, nested constructors in
example:lines - File: permissions.ryUse case: libraryDemonstrates:
Setunion, intersection, difference and subset,to_set(), refinedTextsubtype checked withmatches - File: log_parser.ryUse case: dataDemonstrates:
rawregular expression in a refinement,matchon text literals,example: ... fails with ...,group bywith a computed key, one-lineif ... end - File: deadlines.ryUse case: scriptDemonstrates:
Datearithmetic and ordering fromstd.time,Weekdayvariants throughexposing,repeat until, multi-lineexample:clauses - File: inventory_db.ryUse case: dataDemonstrates: SQLite through
std.sqlite,can FromRow, typedletto decode rows, multi-line string constant, query parameters,ignorefor an unneeded result, areplaystest that seeds its own table, recorded underfixtures/ - File: stacks.ryUse case: libraryDemonstrates: generic record
Stack of Item, own abilitySizedwith a generic implementation (for any Item), generic functions,testblocks with typedlet - File: invoice_report.ryUse case: scriptDemonstrates: imports the corpus module
invoiceand calls its functions qualified,sumover a call, nested record literals - File: shipping_rules.ryUse case: embedded libraryDemonstrates: no
mainand no capabilities: the host application loads the module and callsquotewith a JSON parcel;public letconstant;ifas an expression - File: semver.ryUse case: libraryDemonstrates: hand-written
ToTextimplementation,can Compare bythree fields, refinedPartsubtype,example: ... fails with ...,otherwise failinside tests - File: pagination.ryUse case: agent / API glueDemonstrates: cursor loop with
repeat until,maybe Textstate,matchas an expression, external field name withas,append_all,group by, areplaystest with a hand-written two-page recording underfixtures/ - File: statistics.ryUse case: scriptDemonstrates:
Floatarithmetic withpower,remainderandsquare_root,maybe Floatresults,success/failurematching on a conversion - File: dependency_order.ryUse case: libraryDemonstrates: topological sort over a
MapwithSetsubset tests, nested loops withwhere,repeat untilover a shrinking map - File: assistant.ryUse case: agent / API glueDemonstrates: HTTP POST with headers and a JSON body,
environment.get, re-raising a matched error withfail with error, top-level typed constant, areplaystest with a hand-written recording underfixtures/whoseAuthorizationheader is redacted - File: file_tree.ryUse case: CLIDemonstrates: recursion with effects,
filesystem.inspectandfilesystem.list,Entryvariants throughexposing, earlyreturnfrom a one-lineif - File: markdown_table.ryUse case: libraryDemonstrates: multi-line
"""literal in anexample:,with_indexqueries,pad_rightandrepeat, building a list withset ... to ... append
The corpus is at its target size of thirty programs. It grows from here only
when the readability test or the conformance suite needs a construct that no
program covers. Every method and module function the programs call is
declared in docs/design/04-stdlib-sketch.md; the lint rejects a call that is
not.