Safe output
ASPL 0.7.0 · Current release
Print literal text with explicit newlines and output separate from status.
On this page
Print text
The output builtin is اطبع / print: (string) -> unit. It writes string bytes in order, including NUL, without an automatic newline or flush. Add \n explicitly. Neither alias can be redefined. The browser safely displays output bytes without interpreting them as page markup.
Accepted: one string, including an empty string. Rejected: a number, multiple arguments, or storing the result.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input: No input lines are required.
fn start_main() -> i64 {
print("مرحبا\n");
return 0;
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "مرحبا\n",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "مرحبا\n"
}
}Output, status, and host failure
Writing is synchronous; an empty string does not touch the host. Native output retries interrupted writes and continues short writes. Output accepted before failure remains visible. There is no special SIGPIPE handler; a closed pipe may terminate the process through that signal. If the environment ignores or blocks it and writing returns EPIPE, the result is a host failure with status 8.
Output is separate from process status. The browser 256 KiB ceiling rejects a whole crossing write and retains earlier output. Browser output stays safe text even when it contains HTML markup.
Release scope and related reading
This page describes ASPL 0.7.0. The linked MVP text is a historical record, not a complete description of current extensions.