Tekst
Source
Documentation/Error Handlingsource tree
Language guide

Error Handling

The native LLVM backend reports runtime and lowering failures explicitly. try/catch syntax is reserved for exception-aware backend work and is not currently lowered by the native compiler.

Compiler errors

Syntax errors, unsupported constructs, missing modules, invalid arguments, and backend limitations are reported during compilation. The compiler does not silently change unsupported code into another behavior.

Native backend status

The native backend currently rejects try/catch with an explicit diagnostic. Runtime support functions for exception state exist in the native runtime, but the compiler does not yet lower source-level exception blocks into that mechanism.

unsupported.tk
try:
    print(10 / 0)
catch:
    print("handled")

Use ordinary control flow and input validation where possible, and treat compiler diagnostics as the source of truth for unsupported language features.

Runtime failures

Native runtime operations validate their arguments and report failures such as invalid file operations, invalid socket parameters, division by zero, and unavailable standard-library operations.

Reserved syntax

The try, catch, and related exception mechanisms remain part of the language implementation work. Documentation should not present them as available native compiler features until lowering support is enabled.