Expand description
I/O Operations for Seq
These functions are exported with C ABI for LLVM codegen to call.
§Safety Contract
IMPORTANT: These functions are designed to be called ONLY by compiler-generated code, not by end users or arbitrary C code. The compiler is responsible for:
- Ensuring stack has correct types (verified by type checker)
- Passing valid, null-terminated C strings to
push_string - Never calling these functions directly from user code
§String Handling
String literals from the compiler must be valid UTF-8 C strings (null-terminated).
Currently, each string literal is allocated as an owned String. See
docs/STRING_INTERNING_DESIGN.md for discussion of future optimizations
(interning, static references, etc.).
Re-exports§
pub use patch_seq_exit_op as exit_op;pub use patch_seq_int_to_string as int_to_string;pub use patch_seq_push_seqstring as push_seqstring;pub use patch_seq_push_string as push_string;pub use patch_seq_read_line as read_line;pub use patch_seq_read_line_plus as read_line_plus;pub use patch_seq_write_line as write_line;
Functions§
- patch_
seq_ ⚠exit_ op - Exit the program with a status code
- patch_
seq_ ⚠int_ to_ string - Convert an integer to a string
- patch_
seq_ ⚠push_ seqstring - Push a SeqString value onto the stack
- patch_
seq_ ⚠push_ string - Push a C string literal onto the stack (for compiler-generated code)
- patch_
seq_ ⚠read_ line - Read a line from stdin
- patch_
seq_ ⚠read_ line_ plus - Read a line from stdin with explicit EOF detection
- patch_
seq_ ⚠write_ line - Write a string to stdout followed by a newline