Skip to content

README: the language reference against the ledger, and a plainer read - #64

Open
jeany55 wants to merge 2 commits into
trigscript-4from
readme-language-4
Open

jeany55 wants to merge 2 commits into
trigscript-4from
readme-language-4

Conversation

@jeany55

@jeany55 jeany55 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

What changes

"The language" was checked feature by feature against ledger/, and the ledger won where they differed. The rest of the README reads in shorter sentences.

Added, each with a short example that compiles (and, where it prints, a // what it shows that the test holds against Simulate):

  • New sections: Numbers with a fraction (fixed, Math.sqrt, hypot, sin, cos, tan, atan, atan2, rounding, decimals in a printed text), Functions as values (kept in a variable, an array, a field or a Map; closures), Errors (try, catch, finally, throw, classes of error, e.stack, a stack overflow as a RangeError), Events (on.created, died, killed, morphed, order), Sounds (playWav, tone, noise, pluck, fm, silence, effects, mixdown, together, sounds.Name), Files the script imports (.video, .image, .sound, .notes, cover()), The standard library (math, random, timers, signals, ui, cutscene, fog, screen, music; reserveLocation).
  • Time and edges became Waiting and tasks: async/await, nextFrame, until, start() and tasks, Promise.all/race/any, .then, generators, for await.
  • Functions return records, tuples and arrays; optional parameters; a nested function sees the outer function's locals.
  • Classes in any file, type parameters, protected, instances kept by reference.
  • Input: keyHeld, on.key, on.chat, local.*, await sync(), select(), centerLocation with a size.
  • memory.game.frame, memory.map.*, memory.vision.countdown.
  • Arrays: shift, unshift, splice, at, lastIndexOf, join of numbers. Texts: split, replace/replaceAll, trim*, upper and lower case, charCodeAt, parseInt, isNaN, a boolean in a text, lines of JSX.
  • number | undefined, players in variables, labels, const enum, namespace, comment(), a Map keyed by a union of texts.
  • The front matter links the guide's new TrigScript and eudplib page (TrigScript guide: four pictures, a table beside eudplib, plainer sentences scm-js#77).

Corrected:

  • TrigScript beside TypeScript, row by row.
  • What a program does not have, rebuilt from refusals checked with the compiler. The stale "Still to come" paragraph naming docs/eud-plan.md is gone.
  • "The game reports no held key": keyHeld exists.
  • Input is carried by the map on the own build. A script built through eudplib still uses MSQC and chatEvent, and the README says what each takes from the map.
  • A program's texts go into the built map's string table by the build, not "by eudplib".
  • A function declared inside another sees the outer function's locals. const b = a copies an array.
  • Class limits that no longer hold: one class per array, a variable never given another instance, waves.push(w) refused, no type parameters on a class.
  • displayText(text, false) follows the player's subtitle setting.
  • The "1700 slots" sentence, which contradicted "a loop costs what the map holds".
  • For other plugins and the compiler section no longer say eudplib builds the map.

Not verified

  • chatted's {n} "up to 1 048 575" may be the MSQC limit. On the own build the limit depends on the map's size.
  • What the own build's input takes from the map comes from the plan's step 12, not from a game run.
  • program()'s hover in compiler/declarations.ts still says programs are built by the eudplib plugin. Out of scope here.
  • The link to docs.scmjs.dev goes live with the next scm-js release that publishes the docs.

Checked

  • npx vitest run tests/readme.test.ts: 46 passed (30 before).
  • npx tsc -p tsconfig.json: clean.
  • The one ```tsx example (lines of JSX), which the README test does not read, was compiled and simulated by hand.

🤖 Generated with Claude Code

https://claude.ai/code/session_01En4SHqafb1QFJ4xgbUkAe5

jeany55 and others added 2 commits October 23, 2026 19:45
The reference called missing a good part of what the ledger shows the language takes.
Added, each with a short example that compiles and prints what it says: numbers with
a fraction and Math, functions as values and closures, errors (try, catch, finally,
throw), instances kept by reference, events (on.*), keyHeld, local and sync(), select(),
memory.*, the new array and text methods, labels, optional parameters, functions that
return records and tuples, sounds made when the script is built, async/await, tasks,
Promise.all and race, generators, the files the Explorer imports, and the standard
library's modules. Corrected: the TrigScript beside TypeScript table, What a program
does not have (each refusal checked with the compiler), the held key, the input
carried by the map rather than MSQC and chatEvent, the build's string table, nested
functions seeing the outer locals, const b = a copying an array, and the stale
"Still to come". The rest of the file reads in shorter sentences.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01En4SHqafb1QFJ4xgbUkAe5
…dashes

The front matter points at the guide's "TrigScript and eudplib" page. The uncaught
error is quoted as the game says it, with its full stop, and memory.vision.countdown
says what writing 1 does, as its hover does. The version notes and the contributors'
table say their asides with commas, colons and brackets instead of paired dashes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01En4SHqafb1QFJ4xgbUkAe5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant