Program and process status
ASPL 0.7.0 · Current release
The required entry function and process status range in ASPL 0.7.0.
On this page
Entry function
An ASPL program starts at the root file's required ابدأ_الرئيسية / start_main function. It takes no parameters and returns i64. Top-level declarations include functions, records, and imports. Native programs may include user source modules and foreign declarations. Executable statements and bindings belong inside functions.
The entry function cannot be called from source. A missing entry function or an invalid signature fails checking with missing-entry-function or invalid-entry-signature. Calling the entry function fails with entry-call-not-allowed.
Process status
Return an integer from 0 through 255 as the process status. Any other result ends execution with trap / invalid-process-status; ASPL does not truncate it. The same entry contract applies to the browser and native hosts in ASPL 0.7.0.
Status and stdout are independent. A normal return of 1 is a successful ASPL execution. Source errors, traps, recoverable results, cancellation, and host or resource failures have distinct outcomes. Use print to produce output, and native commands to look up CLI status conventions.
Complete example
This checked example returns status 0 and produces no output. The source vocabulary is independent of the documentation locale.
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 {
return 0;
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": ""
}
}Find the entry function's result type and the returned process status in the example.
{
"browser": {
"check": "success",
"class": "success",
"output": "",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": ""
}
}