ASPL لباتASPL 0.7.0

Search documentation

Search starts with current English documentation · ASPL 0.7.0

Enter a complete name such as read_line, or words about a topic.

    العربية
    Source files

    Open one UTF-8 .aspl or .لبات file, up to 1 MiB, in a new draft. It stays in this browser and does not run automatically.

    Line input

    ASPL 0.7.0 · Current release

    Read a complete line with EOF, strict UTF-8, and a 65536-byte limit.

    On this page

    Reading a line and EOF

    The builtin اقرأ_سطر / read_line: () -> string reads one line. It takes neither arguments nor an غير_آمن / unsafe marker, and neither name may be defined. Print a prompt before the call because the builtin writes no prompt, echo, or terminator. A line ends in LF or CRLF, which are removed. An empty line produces an empty string. A final unterminated line is returned once at EOF, then the next call traps with input-exhausted.

    Accepted: pass, return, compare, print, measure, index, slice, concatenate, or explicitly parse the read string with a numeric parser. Rejected: treating source notation or Arabic-Indic digits as accepted numeric input, or implicitly converting a string to a number.

    Browser and native · ASPL 0.7.0 · English source

    Execution: Browser and native · ASPL 0.7.0

    Prerequisites:
    • No prior knowledge is required to open and check it.

    Input lines: ["Mina"]

    fn start_main() -> i64 {
        print("ما اسمك؟ ");
        let name = read_line();
        print("مرحبا ");
        print(name);
        print("\n");
        return 0;
    }
    
    Download input.aspl

    Expected outcomes
    {
      "browser": {
        "check": "success",
        "class": "success",
        "output": "ما اسمك؟ مرحبا Mina\n",
        "processStatus": 0
      },
      "native": {
        "check": 0,
        "status": 0,
        "output": "ما اسمك؟ مرحبا Mina\n"
      }
    }

    Exact input and UTF-8

    The runtime validates the complete line as strict UTF-8. Whitespace, NUL, Arabic marks, direction controls, Arabic-Indic digits, and normalization form stay exactly as the host supplied them. Program input does not pass through the source editor, lexer, or digit conversion. Invalid input traps with invalid-input-utf8 and the first invalid byte offset.

    Line limit and cancellation

    Both hosts allow 65536 payload bytes per line, excluding LF or CRLF. Exactly that size is accepted. A larger line ends the run with input-line-limit, never a truncated string. Cancelling while waiting is cancellation, not EOF.

    String ownership

    The execution owns each successful nonempty input string under shared runtime ownership: literal bytes stay borrowed from the compiled program without copying, while registers, parameters, and returns carry the same immutable bytes across calls and returns. Replacing a binding or cleaning up a frame reclaims the discarded string, so the VM memory limit counts only live strings.

    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.

    Line input was added after the output-only MVP builtin contract. See browser input or native input.

    Browse pages