A single Console IO type obscures direction and syscall descriptors.
Examples
Platform spec article
Examples
Spec standingStandard
-
stdin/stdout/stderr use separate System modules.
Context
Decision
Rule Detail Modules System.Input,System.Output,System.ErrorForbidden Monolithic console IO type for standard streams Consequences
Each module binds one
StandardStreamdescriptor; cross-stream APIs stay separate.Verification anchors
packages/runtime/src/System/Input.bd,Output.bd,Error.bd. -
Syscall write failures panic; reads surface Result.
Context
v1 write helpers are infallible at the type level; read paths need explicit error handling.
Decision
Rule Detail Write Write/WriteLinemust panic onWriteWithfailureRead Read/ReadLinereturnResult<string, SyscallError>Consequences
Diagnostics for write failures use fixed panic strings; callers cannot catch write errors in Beskid v1.
Verification anchors
Corelib stream tests; syscall integration in
beskid_runtime. -
WriteLine appends a single LF byte sequence.
Context
Cross-platform hosts may translate line endings below the Beskid API.
Decision
Rule Detail Ending WriteLinemust append\nonlyWindows Host/platform layer may translate later without API change Consequences
Authors see consistent Beskid source semantics; CRLF is not encoded in corelib strings.
Verification anchors
Output.bd/Error.bdtests; platform IO docs.
- Contracts and edge cases MUST rules for standard stream reads, writes, and error handling.
- Design model Stream module boundaries and syscall descriptor model for standard I/O.
- Examples Standard stream read and write usage patterns.
- Flow and algorithm Read and write algorithms for standard stream helpers.
- Verification and traceability Runtime syscall and corelib anchors for standard stream I/O.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Purpose
Section titled “Purpose”Document examples for the Console Io Streams feature: role-specific normative detail beyond the feature hub.
Canonical references
Section titled “Canonical references”- Feature hub: Console Io Streams
- Sibling articles in this bundle (design model, contracts, flow, examples, verification)
Detailed behavior
Section titled “Detailed behavior”Plain stdout
Section titled “Plain stdout”System.Output.WriteLine("ready");System.Error.WriteLine("warning: deprecated flag");Stdin line input
Section titled “Stdin line input”match System.Input.ReadLine() { Result::Ok(line) => { System.Output.WriteLine("echo: ${line}"); }, Result::Error(err) => { System.Error.WriteLine("read failed"); },}Styled line via Console (uses stdout internally)
Section titled “Styled line via Console (uses stdout internally)”Console.FormatLine("[red]Error:[/] file not found");FormatLine calls Console.Format then System.Output.WriteLine; ANSI gating is applied inside format/escape layers, not in Output.bd.
Low-level escape bytes on stdout
Section titled “Low-level escape bytes on stdout”string seq = Ansi.Escape.EmitCsi("2", "J");System.Output.Write(seq);Escape semantics are specified in ANSI escape model; this example only shows the write surface.
Verification
Section titled “Verification”See the verification and traceability article in this bundle and compiler/corelib/beskid_corelib/tests/corelib_tests/src/console/.
Related topics
Section titled “Related topics”- Parent feature hub and Terminal and console area