← Back to AILP Home

Debugging

Debug Output

Use the stddbg stream (FD 3) for debug output that doesn't mix with stdout/stderr.

Print Debugging

println(`DEBUG: x = &{x}, y = &{y}`);

Type Inspection

Common Issues

See META/NITPICK/KNOWN_ISSUES.md for current known issues and workarounds.

Constant Arithmetic Bug

fixed with arithmetic expressions evaluates to 0. Compute in a variable:

// WRONG: fixed int64:NEG1 = 0i64 - 1i64;   // → 0
// RIGHT: int64:neg1 = (0i64 - 1i64);

String Literal in sys()

Store in variable first:

// WRONG: sys(SYS_OPEN, "file.txt", 0i64, 0i64);
// RIGHT: string:path = "file.txt";
//        sys(SYS_OPEN, path, 0i64, 0i64);