Skip to content

Torvik v1.1.3 — Stability Release: Silent Bugs Removal And Fixes For Both Platforms

Choose a tag to compare

@torvik-lang torvik-lang released this 09 Jul 17:50
· 164 commits to main since this release
Immutable release. Only release title and notes can be modified.
4aefca5

v1.1.3 is a patch release with no new syntax and no breaking changes — just a compiler-wide audit that hunted down silent wrong answers, silent no-ops, and compile-then-crash holes, on Linux and Windows. It's backed by a new end-to-end test suite (78 cases, now shipping in the repo under dev/tests with both sh and PowerShell runners) that runs green on both platforms, with the full suite ASAN-clean and the compiler verified through a three-generation self-hosting fixpoint on each OS.

If you're on v1.1.x, update with:

rune update

Silent wrong answers fixed

These compiled and ran — and quietly produced the wrong result.

  • Leading unary minus precedence. -m + 2 compiled as -(m + 2) (so -7 instead of -3 for m = 5). A leading - now binds to exactly one value in every position, and negation is type-aware: -x works on f64 and i128 (previously invalid IR or a segfault), while negating a str, list, bool, or u128 is a clean error.
  • fixed is now enforced. Reassigning a fixed binding — plain or compound, local or global — previously compiled and mutated silently. It's now the compile error the guide always documented. Enforcement surfaced 131 latent fixed-then-mutated bindings inside the compiler itself, all converted to set (behavior identical).
  • Return types are checked. df f() -> str { return 5; } compiled and crashed at run time; -> i64 { return "x"; } printed a pointer. Both are now clean, located compile errors.
  • Weave stages are arity- and type-checked. 5 ~> addn (missing argument) called the function with garbage; 5 ~> shout (an i64 woven into a str parameter) segfaulted. Both are now clean compile errors — and integer-returning weaves inside echo!() no longer crash (that one was a documented example!).
  • Booleans print consistently. echo!(true) printed 1, tostr(true) returned "1", and fs_exists() echoed 1/0. Everything bool now prints true/false.
  • Collection element fixes. list<bool> element reads segfaulted; list<u64> elements leading an expression used signed division (a full-range value divided negative). Both fixed.
  • Large integers printed truncated on Windows. long is 32-bit on Win64, so int_to_str (and whole-list printing) mangled big values — -9223372036854775807 printed as 1. Linux was never affected. Fixed with 64-bit formatting throughout.

Crashes fixed

  • bag<T> was released out from under you. A one-character class of bug (an exact-match type check where lists and tables use a prefix match) meant bag<str> declarations skipped reference counting entirely — the bag was freed at end-of-statement and every later use was a use-after-free. Linux's allocator happened to tolerate it; Windows access-violated. Found with AddressSanitizer, fixed at all five sites, re-verified clean.
  • set c: bool = true; could silently drop the store, leaving the variable uninitialized — ternaries on such variables picked arbitrary branches.

Windows fixes

  • apply std; now works on Windows. The installer shipped the std:: submodules but never the umbrella std.tv, so apply std; failed on every Windows install while apply std::math; worked. The installer now install the same library set as Linux. (Reinstall or re-run the installer to pick this up.)
  • readkey() honors redirected stdin. It previously read only the console device, so piped input hung forever waiting for a physical keypress.

Implemented as documented

  • ~ (bitwise NOT) — in the operator table since v1.0, previously a parse error.
  • upper(s) / lower(s) as ordinary calls — previously they existed only as weave stages.
  • Zero-argument console builtins — read(), readint(), readfloat(), readbool() now work exactly as STDLIB.md shows (an optional prompt argument is still accepted).
  • torvc file.tv derives its output name from the source file (./file, file.exe on Windows) as TOOLING.md documents — previously the binary silently went to ~/tv_out.
  • Full-range i128/u128 global literals — up to u128 max and down to i128 min, boxed at startup exactly like locals, with clean range errors.

Added

  • readkey_str() — the pressed key as a 1-character string (pairs with char_at), complementing readkey()'s unchanged byte-code return (pairs with byte_at). STDLIB.md previously misdocumented readkey() as returning str; that form never compiled in any release, so no working code is affected — the docs now describe the real behavior, and readkey_str() provides the string form.
  • The end-to-end test suite now ships in dev/tests: 34 positive programs, 30 expected-clean-error cases, 8 rune project cases, and 6 torvc flag cases, with runners for both platforms.

Notes

  • One documented limitation remains: 128-bit globals take a single literal initializer (expressions in a 128-bit global initializer are a clean compile error — compute in a function instead).
  • Full details in CHANGELOG.md.

Full Changelog: v1.1.2...v1.1.3