Skip to content

Rock v0.7.2

Latest

Choose a tag to compare

@github-actions github-actions released this 18 Nov 15:00
Immutable release. Only release title and notes can be modified.

Rock v0.7.2

Rock v0.7.2 warns about unused code by default, infers more generic functions
without explicit signatures, and improves diagnostics for return types and
trait bounds. The compiler now specializes only the code it needs.

Highlights

  • Unused-code warnings. The compiler reports unused bindings, unused imports
    (including globs), and dead code. Public library API is kept even when the
    library itself does not use it. Unused code is still type-checked.
  • More flexible inference. A function without a signature can keep a generic
    interface when callers pass different types. Payload enum constructors can
    be passed as functions, and where clauses can constrain concrete types,
    as in String: From T. The standard functor and monad operators accept
    borrowed callbacks.
  • Clearer errors. Explicit return values are checked against the enclosing
    function or lambda. A method blocked by an implementation bound reports that
    bound instead of appearing to be an unknown field. The language server clears
    stale diagnostics after reanalysis.
  • Runtime fixes. Owned array loops move elements even when those elements
    need no destructor. The compiler also preserves destructors needed by
    temporary values. Standard-library file, socket, and thread operations now
    report failures from more underlying POSIX calls.

Upgrading from v0.7.1

  • Existing code may produce new warnings. Use rock build -D unused to make
    all unused-code lints errors, or -A dead_code to silence only that lint.
    -W restores a warning. The same flags work with rock run and rockc;
    later flags override earlier ones.
  • If you use rockc to emit a reusable .rkca directly, pass
    --crate-type lib and --no-link with --emit-artifact. Binary crates
    cannot emit crate artifacts. rock build selects these flags automatically.
  • Rebuild dependency artifacts with the new compiler and use the matching
    standard library. If a return mismatch is now reported, make the explicit
    return and any reachable final expression agree with the function's result
    type.

Install or update

The packaged toolchain targets Linux x86-64 GNU and requires glibc 2.39 or
newer, a C linker, curl, CA certificates, GNU tar, gzip, and sha256sum.
On Ubuntu 24.04, install build-essential curl ca-certificates. LLVM 18 is
linked into the toolchain; no separate LLVM installation is needed.

After publication, install with an existing rockup:

rockup self update
rockup install v0.7.2
rockup default v0.7.2
rock --version

For a fresh installation, use the pinned bootstrap after publication:

curl --proto '=https' --tlsv1.2 -fsSL https://github.com/Rock-lang-org/Rock/releases/download/v0.7.2/install.sh | sh -s -- v0.7.2

Changelog ·
Compare v0.7.1…v0.7.2