Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Console I/O streams

Platform spec feature

Console I/O streams

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

What this feature specifies

Split standard stream helpers in corelib_runtime: System.Input (stdin), System.Output (stdout), and System.Error (stderr). All traffic uses System.Syscall.ReadWith / WriteWith with typed Descriptor::Standard(StandardStream::*) selectors—no direct fd integers in user code.

Contract statement

StreamModuleSyscall descriptorReadWrite
stdinSystem.InputStdinRead, ReadLineResult<string, SyscallError>Not supported
stdoutSystem.OutputStdoutNot supportedWrite, WriteLine
stderrSystem.ErrorStderrNot supportedWrite, WriteLine
  • Encoding at the boundary is UTF-8 bytes of the Beskid string type.
  • WriteLine must write the text then a single "\n" line feed (corelib policy; not CRLF unless host translates).
  • Write / WriteLine failures from WriteWith must panic with __panic_str("System.Output.Write failed") or the stderr equivalent—there is no Result on write helpers in v1.
  • ANSI and markup must not be interpreted in these modules; escape bytes are ordinary string contents (see ANSI escape model).

Implementation anchors

  • compiler/corelib/packages/runtime/src/System/Input.bd, Output.bd, Error.bd
  • compiler/corelib/packages/runtime/src/System/Syscall/
  • Informative module docs: compiler/corelib/beskid_corelib/docs/System/Input.md, Output.md, Error.md

No open decisions. Closed choices are normative ADRs under adr/ (D-CORE-TERM-0010D-CORE-TERM-0012); use the reader ADRs tab for expandable detail.

Articles