Skip to content

Ryn 0.1.13: registers, AArch64, variadic C calls

Latest

Choose a tag to compare

@v3nn7 v3nn7 released this 12 Oct 18:08
· 0 commits to fbd97606f791ec44cb2982c7d2c59cf3a358c426 since this release

Native language fixes (2026-10-13): the Windows ZIP and its SHA-256 were rebuilt from commit d7ef69b. Custom-destructor resources can be moved into enum payloads, propagated with ? and extracted with unwrap/expect/unwrap_err without duplicate handles or destruction. Integer as char validates Unicode scalars without truncation. Map() infers key/value types from annotations and structure fields. use module::PublicItem imports public types/functions/aliases. Checking a source file discovers its enclosing manifest and resolves path dependencies relative to it; Windows CLI path separators are normalized. Includes all previous keyboard/thread/mutex and FFI fixes. Verified on Windows: 26 tests, including six existing ownership programs and packaged check/build/run, and byte-identical compiler bootstrap stages. The Linux assets and release tag are unchanged.

Windows threads and mutexes (2026-10-13): the Windows ZIP and its SHA-256 were rebuilt from commit f0bb305. std::thread::Thread now supports spawn/id/join/drop; std::sync::Mutex, MutexGuard and lock_raw use exclusive non-recursive SRW locks. The Windows allocator serializes parallel malloc/free. Includes the keyboard hotfix and all previous FFI fixes. std::sync::JoinHandle, RwLock, Condvar, Barrier, Once and Local remain Linux-only. Verified on Windows: eleven regression tests including packaged check/build/run, and byte-identical compiler bootstrap stages. The Linux assets and release tag are unchanged.

Windows keyboard hotfix (2026-10-13): the Windows ZIP and its SHA-256 were rebuilt from commit c1f72f6. std::keyboard now supports continuous key state, pressed/released edges and read_key through user32.dll, fixing R0905 (opendir). Includes all previous FFI fixes. Verified on Windows: five regression tests including packaged check/build/run, and byte-identical compiler bootstrap stages. The Linux assets and release tag are unchanged.

Updated: this release now also includes pointers to array elements and C strings for FFI: &array[index] of a local integer or bool array passed to an extern "C" function, and std::cstring::CString for str as a NUL-terminated C string. Also includes the earlier fixes (unknown type and enum diagnostics, and passing &local to pointer parameters). The archives were rebuilt from commit e8321af.

Updated: this release now includes the fixes for unknown types and enums (R0230 / R0233 with the name and location) and for passing a local by reference to a pointer parameter of an extern "C" function (for example time(&value), also through a function pointer from load_symbol). The archives were rebuilt from commit de03ba2.

Updated: this release now includes the fix for unknown types and enums (R0230 / R0233 with the name and location instead of the generic unsupported error). The archives were rebuilt from commit cfccd66.

Released together with the work of 0.1.11 and 0.1.12, which had no separate release.

  • extern "C" fun printf(format: *u8, ...) -> i32;: ... after the named parameters of an extern "C" function. Call
    it with any number of variable arguments: integers of any width, f64 and raw pointers are passed as they are; an
    f32 (R0270, write as f64), a string or a structure is rejected. The native backend sets al to the number of
    vector registers in use before each C call, as the System V convention requires. Variadic calls on Windows are
    rejected. ... in a non-extern "C" function is R0010. Tests: tests/suite/ffi/variadic_*.
  • The function-record encoding carries a variadic flag (parser, AST and generics).
  • Documentation: docs/language-0.2.md replaces the old "cannot be declared" limitation.
  • x86-64 encoder (selfhost/src/back/x64.ryn): EVEX for 512-bit zmm0-zmm31 (evex_rr, zmm_move_at, opmask
    {%kN} and zeroing {z}), opmask instructions (kmovw/kmovq to and from general registers, kandw, korw,
    kxorw, knotw, kortestw, ktestw), MMX on mm0-mm7 (mmx_rr, movq, emms), and VEX registers 8 to 15 for
    ymm (the VEX prefix now carries R and B). tools/tests/test_encoder_bytes.py checks 31 instructions against llvm-mc
    (19 identical bytes, the rest equivalent forms that decode the same). These encodings are not yet reachable from Ryn
    programs; the AVX-512 forms have not been executed, since the development machine has no AVX-512.
  • Vector types from Ryn programs: std::simd has 512-bit types F32x16, F64x8, I32x16, I64x8 (generated by
    tools/gen-simd.py). Arithmetic uses EVEX on one zmm register when std::cpu reports AVX-512F and two 256-bit halves
    otherwise. Comparisons return integer lane masks (u16 for 16 lanes, u8 for 8); blend(other, mask) merges by mask.
    The AVX-512 form is verified by its bytes and by llvm-objdump only: this host has no AVX-512.
  • std::mmx (Mmx, a 64-bit value): add, subtract, multiply, compare and bit operations on 8, 16, 32 or 64-bit lanes.
    Each operation runs in mm0/mm1 and ends with emms. Tests: tests/suite/mmx/, tests/suite/simd/zmm_*.
  • AArch64 backend for Linux: ryn build --target aarch64-linux and rync --target aarch64-linux write a static ARM64
    executable from the same IR. The subset (integer and bool functions, loops, echo of integers and bools, self tail
    calls, the x86-64 runtime errors and their exit statuses) is compiled; everything else is refused with a named reason.
    Verified by encoding checks against llvm-mc and by running the suite's accepted programs under the Unicorn emulator:
    70 of 538 run programs are accepted, all match. See docs/arm64-backend.md.
  • RYN_DUMP_IR=<path> writes the IR text of a program (a debugging aid for the code generators).

Full changelog: https://github.com/rynlanguage/Ryn/blob/v0.1.13/CHANGELOG.md