# News

## ry 0.5.0

*Released in November 2026.*

Version 0.5.0 ships typed packages with their machine code, builds a typed script into one
executable, makes S4 objects and many base functions faster, and passes more CRAN test suites.
Packages that ry 0.4.5 or earlier compiled must be reinstalled (below). Every figure was reported by
the change that introduced it; none was re-measured for these notes.

### Highlights

- **Reinstall compiled packages.** ry refuses to load a package that an older ry compiled against
  its C headers and says how to reinstall it, because such code can lose list elements to the
  garbage collector. Packages installed by GNU R load unchanged.
- **Typed packages carry their machine code.** `ry install` writes a package's compiled typed
  functions beside its lazy-load database, so a new session runs their first calls without
  compiling them, and installed typed code runs exactly as `ry run` runs it.
- **`ry build --aot --exe`** turns a typed script into one executable.
- **Faster S4.** `new()` shares the class prototype's slot values instead of deep-copying them, so
  2,000 `new()` calls of a class whose prototype holds `runif(1e6)` take about 0.01 s where they
  took 3.4 to 3.9 s (GNU R: about 10 s). `validObject` on a class with a validity method checks its
  slots natively: a loop of 21,000 such objects takes 1.51 to 1.68 s against 2.45 to 2.78 s before
  and 3.7 to 4.0 s on GNU R.
- **Cheaper calls.** Tier 0's fast call path takes 72% of the hot suite's closure calls from compiled
  code, up from 49%, and a call with no arguments costs 757 instructions where it cost 1,387.
  Replacement calls (`f(x) <- v`, `x[i, j] <- v`, `x@name <- v`) and `lapply`'s element calls keep
  the slot frame instead of giving it an environment, which cuts the hot suite's weighted
  instructions by 2.3% to 3.0% across the three code bases.
- **More CRAN packages pass their tests.** Of the test suites of the 100 most-downloaded CRAN
  packages outside the benchmark set (`just top-packages`), ry passes 76 and GNU R 79 in the same
  container, and ry passes 76 of the 79 that GNU R passes.

### Faster base functions

| Call | GNU R | ry 0.4.5 | ry 0.5.0 |
| --- | ---: | ---: | ---: |
| `parse(file, keep.source = TRUE)`, per file | 450 µs | 693 µs | 263 µs |
| `readLines` (kernel k10) | 0.146 s | 0.203 s | 0.060 s |
| `list.files` with a pattern (kernel k11) | 0.079 s | 0.125 s | 0.037 s |
| `c(x, x)`, a million strings | 42.9 ms | 24.6 ms | 10.0 ms |
| `unlist(list(x, x))`, a million strings | 22.8 ms | 33.1 ms | 14.2 ms |
| `rep(x, 2)`, a million strings | 26.6 ms | 31.8 ms | 16.5 ms |
| `x[perm]`, a million strings | 79.8 ms | 26.2 ms | 11.9 ms |
| `d[] <- dv`, 4,000 doubles | 16.0 µs | 36.8 µs | 1.4 µs |
| `s[] <- sv`, 4,000 strings | 43.7 µs | 51.1 µs | 7.7 µs |
| `order(m)`, ten elements | 13.4 µs | 5.4 µs | 0.62 µs |
| `sort(m)`, ten elements | 24.6 µs | 8.7 µs | 1.04 µs |
| `` Reduce(`+`, 1:10) `` | 5.7 µs | 6.4 µs | 2.2 µs |
| `as.Date` on strings (kernel k2) | 1.07 s | 0.532 s | 0.10 s |
| `pmin` and `pmax` (kernel k8) | 1.55 s | 1.261 s | 0.16 s |

The kernels are cut from a user's profile of a package test suite (`just bench-ci`). `ifelse`,
`isTRUE`, `isFALSE`, `unname`, `%in%` and `unlist` run natively for the shapes they cover, which
takes kernel k3 from 2.1x to 3.5x GNU R's speed and kernel k5 from 2.1x to 2.6x. `deparse(x, nlines
= n)` stops after `n` lines, and loading a package's lazy-load database skips the byte code GNU R
wrote into it. `x[] <- value` and `x[a:b] <- value` write the value in whole copies. Compiled
element reads and writes such as `x[[k]] <- 5`, `x$b <- k` and `y <- v[k:4L]` cost fewer instructions
than the interpreter's. A complex assignment such as `f(g(x, i), j) <- v` whose replacement is a
primitive builds no call, which frees 6.6% fewer objects on the finance code base.

### Compatibility and fixes

- `setTimeLimit()` and `setSessionTimeLimit()` raise their limits, with GNU R's errors.
- `.S3methods()` works on ry's own namespaces.
- A compiled `x[i, j] <- v` passes its subscripts to a dispatched method unevaluated, so data.table's
  `DT[col == "a", "x"] <- 1` works. `Recall` forwards promises, and `$`, `@` and their replacement
  methods receive the name as GNU R passes it.
- `UseMethod` dispatches on the argument as passed, which removes a crash, and `x[]` drops the class
  and `tsp`. A callee that modifies an argument forwarded through `...` copies it.
- Fixes found by the top-CRAN suites: ALTREP arguments to `.C` and `.Fortran`, ALTREP classes across
  attribute replacements, `Rf_setAttrib` with dimnames, NUL-trimmed C strings, `gctorture2`,
  `cbind` and `rbind`, closed connections, `lengths`, `NextMethod` and `unlist` names.
- The collector no longer frees the shared compiled code of a closure whose body is `NULL` (such as
  `function(e) NULL` in `tryCatch`) while a later closure reuses it, which broke dplyr's and
  janitor's suites.
- Tier-0 steps that compiled code hands back no longer release handles the compiled code still
  holds, which could free a live object.
- `as.character` of a list deparses its elements as GNU R does.

### The profile summary counts refused compiles, and keys private names

The profile summary's "JIT compilations" counts only the compiles tier 1 finished. The attempts it
refused have a row of their own, "JIT compile attempts refused", and a table counts them by reason,
in the words `RY_JIT_LOG=1` prints, so a run that compiled nothing no longer reads as one that
compiled every hot body. A private package's `private-` label is a hash keyed with a secret that ry
keeps for the project in your cache directory, so a guessed name cannot be confirmed by hashing it.
Labels from earlier summaries differ from new ones. See [the CLI
reference](/reference/cli.md#profile-summary).

### An installed typed package runs like a script

`ry install` and `ry build` on ry's runtime check a typed package before they build it, and an
error in a strict file stops the build. The tarball holds the sources as `ry run` runs them:
literals carry the types the checker gave them, and every one-line parameter and return annotation
is written as the type it stands for, with aliases expanded. So a typed function of an installed
package that converts an R vector with `List.from_r`, or that reads a parameter typed by an alias,
compiles at its first call instead of running that call in the interpreter, and a parameter typed by
a record alias is checked at run time
(``argument `p` must be `Record{x: F64, y: F64}`, not `list` ``). See [the CLI reference](/reference/cli.md#build-and-install).

The same rewrite applies to typed code that `ry run --runtime ry` and the console run, strict or
not, so a parameter typed by an alias of a checkable type is checked at run time there too:
`half("a")`, where `half <- function(x: Meters)` and `alias Meters = F64`, stops with
``argument `x` must be `F64`, not `character` `` instead of failing inside the body.

An `I64` or a `List<I64>` inside a function, a list or a package's namespace serializes, as ry's
own type code that only ry reads back, so a typed package can bind `limit <- 10` where the checker
types `10` as `I64`. `saveRDS(5i64, file)` is refused, and records, tuples, tags, dictionaries and
sets do not serialize.

### An installed typed package carries its machine code

`ry install` on ry's runtime compiles a package's typed functions and writes their machine code
beside the package's lazy-load database, as `R/<package>.<build>.ryt`. A new session maps that file
and runs a typed function's first call on the code compiled at install instead of compiling it: 50
typed functions of one package took 1.43 ms for their first calls against 18.5 ms compiled in the
session, and 2.2 MiB of peak memory against 5.0 MiB (iterate build). Processes that use the same
package share its code pages. `ry build --aot` on a package installs it the same way, and
`R CMD INSTALL --ry-no-typed-code` skips the file. Under `ry run --aot`, a package installed by
another build of ry compiles its typed functions as it loads and says to reinstall it. See
[the CLI reference](/reference/cli.md#build-and-install) and
[the typed code file](/development/typed-code-file.md).

### A typed script builds into one executable

`ry build --aot --exe main.R` writes an executable that runs the script with its typed functions
compiled in: a copy of `ry` with the script and their machine code appended. It skips the checker
and attaches each function's code from itself at its first call, so 20 typed functions took
0.29 ms for their first calls against 6.6 ms under `ry run` (iterate build). Every argument goes to
the script, and packages load from the library as they do for `ry run`. See
[the CLI reference](/reference/cli.md#executables).

### Reinstall packages that ry 0.4.5 or earlier compiled

A package that writes into a list or character vector through a read-only pointer, as data.table's
`setcolorder` does, could lose an element to the garbage collector, so a data.table program that
added columns with `:=` and then reordered them failed with "malformed data.table" or crashed. The
collector now rescans every list or character vector that native code took a pointer into, read-only
or not, but code compiled against ry 0.4.5's headers reads those pointers inline and skips the
rescan. ry therefore refuses to load such a package and says how to reinstall it:

```
Error: package or namespace load failed for ‘data.table’:
 unable to load shared object '/home/me/R/library/data.table/libs/data_table.so':
  package 'data.table' was compiled by ry 0.4.5 against older C headers, and its compiled code is unsafe to run under this ry. Reinstall it with this ry: install.packages("data.table"), or R CMD INSTALL on its source (ry install for a package you develop).
```

A package installed by GNU R loads unchanged. Every installation from source by ry records the
version of its headers' binary interface in a `RyAbi:` field of the package's `DESCRIPTION`, and
`ry load` and `ry install` rebuild objects that an older ry left in a package's `src/`
([the CLI reference](/reference/cli.md#build-and-install)).

## ry 0.4.5

*Released in November 2026.*

Version 0.4.5 builds for Windows, prints a report when a process crashes, adds `ry run --aot`, and
makes calls faster at both tiers of the interpreter. Every figure below was reported by the change
that introduced it; none was re-measured for these notes.

### Highlights

- **Windows builds.** Fixes for the Windows archive: lock files open for writing so Windows can lock
  them, package `inst` directories install by concatenation, directory listings use slashes, package
  DLLs link Rtools' gettext, the embedded base R's files keep their modification times, base R's code
  images run without a stray argument, and file errors carry the operating system's wording. The
  archive is best effort ([Releasing](/development/releasing.md)).
- **Calls run in the dispatch loop.** A call to a compiled closure continues in the loop the caller
  is already running, instead of entering through Rust recursion. A framed call costs 1,172
  instructions over an empty loop, where it cost 1,880. Validation's instruction count falls 1.5% and
  the expression tree program's 10.4%.
- **Tier 1 compiles closure calls with effects.** Every exit from compiled code names a frame
  state, and deoptimization rebuilds the interpreter frames, those of inlined callees included, so
  a closure call runs without a frame, an environment or promises. On the applications suite, the
  orders program runs in 85 ms against 154 ms, and the geometric mean of GNU R's time
  over ry's moves from 2.83x to 2.96x.
- **`ry run --aot`** compiles a script's typed functions before it starts.
- **A crash leaves a report**, and **`ry test --jobs`** runs tests in parallel.
- **Closure calls allocate less.** A call on a slot frame allocates no environment, no binding cell
  and, for most arguments, no promise. On the finance code base the collector frees 264.0M objects
  where it freed 348.2M, and collection time falls from 2.41 s to 1.86 s.
- **The three code bases run faster.** Native condition prologues, an S3 lookup fast path, a native
  `compiler::compile` and a recursive `dir.create` move them from 1.53x, 1.47x and 1.38x GNU R's
  speed to 1.81x, 1.50x and 1.59x (finance, data science, biostatistics; one run each, so expect a
  few percent of noise). `tryCatch` with no condition costs 17.6% fewer instructions.
- **A faster DataFrame `:=`.** `x[id4 == step, v1 := v1 + 1L]` in a loop takes 0.111 s from R at
  1e7 rows against data.table's 0.356 s, and 0.987 s at 1e8 rows against 3.079 s.
- **Typed ports of all 54 public benchmark programs** run natively and print GNU R's checksum.

### Smaller changes

- The interpreter is split into an engine crate, a numeric crate and four leaf crates (`stats`,
  `graphics`, `frames`, `services`), so the checker binary builds without the interpreter: 44.3 MB
  down to 30.5 MB on the iterate profile.
- Answering a constructed name in the checker reads the package layer instead of folding over every
  file, which keeps an edit from re-reading the whole project.
- `%%` and `%/%` on doubles match GNU R bit for bit. Of 2,209 value pairs, 311 differed before and
  none do after, and whole numbers below 2^53 take a 64-bit path.
- `parent.env(1)` signals GNU R's "argument is not an environment" error instead of returning a
  search-path environment.
- Types and symbols are four-byte ids and an item's syntax carries a stamp, so an edit lowers only
  the items it changed. A check of the finance code base takes about 7% less wall time, CPU and
  memory, with byte-identical output.
- A hot suite (`just bench hot`) replays the 100 package functions that hold the most time in the
  code bases in about 30 s, and `just bench-mechanisms` prices each R-level operation in instructions.
- `just bench codebases` times the three 300,000-line code bases per test block against GNU R.
- The nix shell builds GNU R with the setup hook it needs, and its cache is rebuilt only when the
  inputs change.

### `ry run --aot` compiles typed code before the script starts

`ry run --aot script.R` compiles the script's typed functions before its first expression runs, so that no function compiles in the middle of the program. Without the flag a typed function compiles at its first call, which costs about a millisecond on that call. The whole run takes the same time either way, because the same compiler does the same work: the flag moves it in front of the program. Untyped R code is not compiled ahead of time. See [the CLI reference](/reference/cli.md#compiling-ahead-of-time).

A typed function that converts an R vector with `List.from_r` compiles at its first call, and so does one that calls a function of a loaded package such as `stats::rnorm`. Each used to run its first call in the interpreter, to see the vector's item type or to load the function. The item type is the one the type checker gives the conversion. Where the checker says `List<F64>` and R hands over integers or logicals, as `abs(-3:3)` does, the conversion widens them; a vector of any other type stops the conversion with an error that names both types.

### A crash leaves a report

A process that ends in SIGSEGV, SIGBUS or SIGABRT, for example a segmentation fault in a package's compiled code, now prints a report on standard error before it dies: the ry version, the signal with the faulting address and its cause, the R call stack with function names, and the native stack. It then dies by the same signal, so exit statuses and core dumps are unchanged. Windows prints no report yet. See [the CLI reference](/reference/cli.md#crash-reports).

### Faster aperm, t, apply, sweep, partial sorts and scalar array indexing

`aperm()` and `t()` copied one element at a time through a per-element type dispatch, and `aperm()` allocated an index vector for every element. Both now run one blocked, strided copy specialized by element type, so the data is read and written once, in cache-sized tiles, and a permutation that keeps the first dimension is a plain run copy. `aperm()` and `t()` also read an array whose dimnames were set after creation in place, where they used to copy its data first. `a[i, j, k]` with one plain position per dimension of an array without dimnames reads the element directly instead of building index vectors, and `sort(x, partial = ...)` (so `quantile()` and `median()`) selects on a copy of the numbers instead of an index permutation. `apply()` and `sweep()` get faster through `aperm()`.

Measured on one machine against GNU R 4.6.2 (seconds, best of three, release build):

| | ry before | ry after | GNU R |
|---|---:|---:|---:|
| `aperm(a, c(2, 1, 3))`, 200x200x50, 20 times | 1.39 | 0.22 | 0.42 |
| `aperm(a, c(3, 1, 2))`, 200x200x50, 20 times | 1.25 | 0.14 | 0.26 |
| `aperm()` of an integer array and of one with dimnames, 20 times | 0.98, 1.22 | 0.07, 0.14 | 0.16, 0.54 |
| `t(m)`, 1000x1000, 200 times | 1.88 | 0.69 | 0.91 |
| `a[3, 4, 5]`, 200,000 times | 0.060 | 0.017 | 0.006 |
| `apply(m, 1, sum)` and `sweep(m, 2, colMeans(m))`, 1000x1000 | 0.037, 0.046 | 0.012, 0.016 | 0.025, 0.016 |
| `apply(a, c(1, 3), sum)`, 200x200x50 | 0.082 | 0.025 | 0.052 |
| `quantile()` of 2 million doubles, 5 times | 1.14 | 0.34 | 0.35 |
| `sort(x, partial = 1e6)`, 5 times | 0.41 | 0.19 | 0.18 |

Character and list arrays are permuted straight into the result, with no intermediate copy, so `aperm()` of a 100x100x100 character array takes 0.45 s for 200 calls, against 1.54 s before and 1.55 s in GNU R. Wider tiles make `aperm(a, c(3, 1, 2))` of a 200x200x200 array take 0.36 s for 20 calls, against 0.59 s before and 1.49 s in GNU R. `aperm()` of an expression array stops with GNU R's error "unimplemented type 'expression' in 'aperm'", and `t()` with "argument is not a matrix", where both used to permute it.

Scalar array indexing at the top level and `rbind()` of data frames (0.075 s before, 0.037 s after for 200 calls, against 0.025 s) are still slower than GNU R, because their remaining time is in the interpreter's per-call overhead.

### The VS Code extension on Windows

The Marketplace had no Windows package for 0.4.4, so VS Code on Windows installed the universal `ry.vsix`, which bundles no binary, and failed with "spawn ry ENOENT" in the log only. A release now publishes the universal `ry.vsix` only when every platform has its package, and the extension shows an error with a link to the installation page when it finds no `ry` to start.

### The Linux runtime loads on glibc 2.41 and later

The `libR.so` of 0.4.4 had no `PT_GNU_STACK` program header, because BOLT's `-use-gnu-stack` overwrote it. glibc 2.41 and later then refused to load the library ("cannot enable executable stack"), so `ry run` failed on such systems. The release build now links with `-z noexecstack`, restores the header after BOLT, and fails if `libR.so` or `ry` lacks it. A load failure for this cause now says that the runtime was packaged without the header, instead of suggesting a `noexec` mount. Until you upgrade, `GLIBC_TUNABLES=glibc.rtld.execstack=2` works around it.

### Parallel tests

`ry test --jobs N` runs the test files in `N` worker processes, and a package that sets `Config/testthat/parallel: true` uses every core without the flag. The workers load the package through ry's lazy loader under the project's `ry.toml`, so they need neither pkgload nor every import installed. On the finance benchmark code base (501 test files, 43,011 expectations, 4 cores) the suite takes 84 s with four workers against 252 s in one process. See [the CLI reference](/reference/cli.md#parallel-tests).

### httpuv and plumber serve requests

`R_getVarEx()` returns its default when that default is a C `NULL`, which is how Rcpp asks whether a name is bound in an environment. httpuv builds each request that way, so an in-process server answered every request with "object 'REQUEST_METHOD' not found".

### Faster formatC

A scalar `formatC()` call takes about 40% fewer instructions: its native path calls the formatting code directly instead of building R arguments for it, and reads `options(OutDec)` without calling `getOption()` when `decimal.mark` is left out. The report benchmark, which formats 20,000 account numbers with `formatC()`, takes 12% fewer instructions.

## ry 0.4.4

*Released in November 2026.*

Version 0.4.4 is ry's first full release, not a pre-release. Closure calls run without an
environment unless something asks for one, packages and base R are compiled before a session
starts, the Linux build is profile-guided, and typed code runs natively in many more shapes.
It ships for Linux x86_64 and macOS arm64; Windows follows in a later release.

Every figure below was reported by the change that introduced it (instructions are callgrind
counts). None was re-measured for these notes.

### Highlights

- **Closure calls run in slot frames.** A call keeps its arguments and locals in slots of the
  interpreter's register window and creates an environment only when something asks for one.
  62.5% of the calls on the testthat workload never need theirs.
- **Code is compiled before a session starts.** `ry install` writes a code image (`.ryc`) beside
  each package's lazy-load database. It holds the compiled code of every closure and machine code
  for the package's numeric functions, which a session maps read-only and runs without warming up,
  even with the JIT off. `ry install --train tests` trains the image on the package's own tests,
  and `RY_CODE_IMAGE=0` makes a session ignore images ([CLI reference](/reference/cli.md)). Base R's
  closures are compiled into the start-up image, which is laid out in the order a session first
  touches it.
- **The Linux build is profile-guided.** Every crate is compiled with profile-guided optimization,
  and BOLT lays out `libR`. Against a plain release build, the test phase of the testthat workload
  runs 10 to 13% faster, held-out public benchmark programs run 9 to 25% faster, and peak memory is
  about 6 MB lower.
- **Typed code runs natively in more shapes.** List literals, `List.append`, slicing, `List.swap`
  and `List.concat`, sets, logical selection, sorting, records, tags, text and results, the scalar
  `Num` functions, record updates, `Str.to_utf8` and `Str.from_utf8_lossy` all compile, and typed
  code calls R natively. The typed mandelbrot_ascii port takes 0.31 s against 30.2 s in the
  interpreter, and fannkuchredux 0.044 s against 5.8 s. `RY_TYPED_LOG` says why a typed call runs in
  the interpreter.
- **A better console.** Input is colored from ry's own parser, with the bracket at the cursor and
  its partner highlighted (`[console] highlight = false` or `NO_COLOR` turns colors off, and
  `[console.colors]` overrides a style; see [Configuration](/reference/configuration.md)). Each command
  is checked against what earlier commands defined, so a paste costs time in proportion to its
  length: 5,000 typed lines take 1.36 s, where 1,000 took 3.6 s. A paste no longer stalls on the
  terminal, and `menu()`, `readline()`, `scan()` and `stdin()` read from the console.

### Faster sprintf

`sprintf()` formats numbers with the same native code as `format()` and `paste()`, and it parses its formats once per call instead of once per element. A scalar `sprintf("%.2f", x)` takes half the instructions it did, and the report benchmark, which builds 20,000 lines with `sprintf`, takes 8% fewer instructions overall. The output matches GNU R byte for byte, including glibc's edge cases: a negative `*` precision, `%#g` when rounding carries to the next power of ten, and `%#o`.

### Faster namespace loads

Loading a package's namespace does less work in R. `ls()` sorts names by a byte key per name, `methods::cacheMetaData()` handles packages whose old classes ask for the `Ops` group natively, the registered native routines are bound in one pass, and `readRDS()` of a path reads the file whole instead of through a connection. `loadNamespace("rlang")` in a fresh process takes 31 ms instead of 45 ms, and 30 load and unload cycles in one process take 0.54 s instead of 0.66 s.

### Package code is read without decompressing it

A package's code image holds each lazy-loaded record uncompressed, and ry maps the image and reads records from it in place instead of inflating them from the `.rdb`. The base packages get such images when the start image is built. On the testthat workload no `.rdb` is opened, fetches take 33% fewer instructions, the whole run takes 1.3% fewer, and four workers together hold 10 MB less private memory.

### Fewer futile collections

When a minor collection leaves the heap full, the collector predicts from the last escalation how much an intermediate collection would free, and goes straight to a major one when that is too little. On the `records` program of the real-world benchmark, collection takes a third fewer instructions and the whole run 9% fewer, and peak memory drops from 111 MB to 97 MB. `R_PreserveObject` marks the object's header, so releasing a call frame no longer looks the environment up in a hash table.

### Package code is allocated old

A lazy-load fetch, which reads a package's functions and data when they are first used, allocates them directly in the old generation, so minor collections no longer trace them only to promote them. `library(testthat)` runs no collection and 6% fewer instructions, the collector's instructions over the testthat workload drop by 14%, and peak memory is unchanged.

### Cheaper minor collections

A minor collection checks an already marked object inline, without a function call or bounds checks, and handles a newly marked one out of line. Minor collections during `library(testthat)` take 29% fewer instructions, and the testthat workload takes 1.2% fewer in total.

### Collections skip what did not change

A minor collection no longer reads dead call frames that own no memory, and it marks only the method-cache entries stored since the last collection instead of the whole S3 and S4 cache. The garbage collection share of `--profile-summary` on the testthat workload halves, from 0.046 s to 0.021 s, and the collection pauses take 35% less time; part of that is the summary's own counting of freed objects, which the summary lists apart as "profile summary bookkeeping".

### Package-specific fast paths

ry runs a few package functions natively when the installed package is exactly the release the
native code follows; any other release runs its own R code unchanged.

| Package | Function | Release | Effect |
| --- | --- | --- | --- |
| rlang | `trace_back()` | 1.3.0 | 0.16 ms instead of 9 ms at a depth of 200 frames, so every `expect_error()` and `expect_warning()` is cheaper; the testthat workload takes 31% fewer instructions |
| withr | the helpers behind `local_envvar()`, `with_envvar()`, `local_options()`, `with_options()` and `local_language()` | 3.0.3 | the testthat workload takes 23% fewer instructions, and every test skips creating and deleting a temporary directory, so its wall time halves together with the base fast paths below |

### Faster environment variables

`Sys.getenv()` looks up every name it is given in one pass over the environment. `Sys.setenv()` leaves a variable alone when it already holds the new value, and `Sys.unsetenv()` skips a variable that is not set. withr's `local_envvar()` restores often hit both cases. A lookup rejects most variables after comparing one byte, as glibc does, and together these take 2.4% off the instructions the testthat workload runs.

### Faster partial matching and name lookups

`pmatch()` and `charmatch()` compare each input with the table in place, without copying the strings, and mark the table entries already used in a bitset. Native code that reads an argument or option by name uses a symbol installed at startup instead of interning the name on every call, and reading the text of a string the heap has already validated as UTF-8 is inlined at each call site. The testthat workload runs 1.2% fewer instructions, and 2.25% fewer together with the environment-variable lookups above.

### Faster assignment forms and kernels in the public benchmark suites

`<<-`, array slab writes such as `a[i, 2, ] <- v`, matrix `m[[i, j]]`, vector growth, `attr<-`,
`%*%` on small matrices and complex vector arithmetic run on compiled or direct paths. With the
JIT on, the geometric mean speed-up over GNU R rises from 1.58x to 1.90x on the awfy programs,
from 2.27x to 2.78x on rcp and from 1.53x to 2.04x on shootout (`tools/bench/bench.py
--public all --repeat 3`). Complex division and non-integer powers follow C99, so special values
such as `(Inf+1i) / 0` match GNU R.

### Cheaper minor collections and package metadata reads

Large lists and character vectors record stores in cards, so a minor collection rescans only the
parts that changed, and growing a list with `[[<-` moves its elements instead of copying them.
rcp's list-for drops from 1.54 s to 0.73 s and list-while from 1.20 s to 0.73 s, which takes both
past GNU R (1.63x and 1.58x), and the rcp geometric mean rises from 2.64x to 2.80x.
`unserialize()` and `readRDS()` on a connection read from its buffer, which takes a third off
their cost during `library(testthat)`.

### Faster `attr()` lookups, large matrix products and small vector allocation

`attr(x, which)` finds a full or partial match in one pass over the attributes, which takes
shootout's knucleotide_brute_2 from 1.38x to 2.08x of GNU R. `%*%` computes four result columns
per pass over its left operand, with each entry summed in the same order as before, so results
are unchanged and spectralnorm_math rises from 1.27x to 1.44x.
Small vectors are allocated inline at the call site, which takes 2.2% off the instructions of
the testthat workload.

### Also in this release

- **More behavior matches GNU R.** `cat()` rejects a list or a call with GNU R's error, after
  writing the output before it. `structure()` gives its result its own dimnames list, so xts's
  `as.xts(m)` no longer clears `m`'s row names. `unlink()` removes files and trees as GNU R's
  `R_unlink` does. `NaN + NA` is `NaN` and `NA + NaN` is `NA`. `sort`, `order` and `ls` follow GNU
  R's collation rule for `LC_ALL=C` and `LC_COLLATE=C`, and so do `Rf_isUnsorted` and
  `R_orderVector` in the C API. A process started with SIGINT ignored keeps ignoring it.
- **DataFrame functions are qualified, so `package:ry` masks no other package's functions.**
  `setkey` and `setkeyv` are `DataFrame.set_key(df, cols)`, `key` is `DataFrame.key(df)`, `copy`
  is `DataFrame.copy(df)`, and `col` and `lit` are `Expr.col(name)` and `Expr.lit(value)`, so
  `library(data.table)` attaches without a masking message ([DataFrames](/reference/dataframes.md)).
- **ry cleans up its cache.** Each ry build assembles an R home under the cache, and homes that no
  running process holds and no current build uses are deleted. A stale start-up image in a home is
  rewritten instead of slowing every start.
- **ry starts without a shell on `PATH` on Linux and macOS**, because `Sys.which()` searches
  `PATH` natively there.
- **Collector fixes.** Several objects the collector could free while they were still in use are
  rooted: evaluated builtin arguments, argument references, tenured weak-pair lists with young
  values, and a pending unwind during a JIT exit.
- **Nightly builds.** Linux x86_64 nightlies of any ref are published as GitHub pre-releases, so
  `releases/latest` always names the newest full release ([Installation](/installation.md)).

### Known limitations

- **`ry R` needs GNU R**, because it runs your code on GNU R itself.

## ry 0.4.3-beta, Linux only

*Released in November 2026 as a pre-release.*

Version 0.4.3-beta makes calls, S3 and S4 dispatch and the hottest builtins cheaper, fixes the S4
and `ry check` problems that test users reported, and brings more numerical routines to bit
identity with GNU R. It ships Linux x86_64 binaries only: macOS and Windows users stay on
[0.4.1-beta](https://github.com/felix-andreas/ry/releases/tag/0.4.1-beta) until a later release
fixes those builds ([Installation](/installation.md)).

Every figure below was reported by the change that introduced it (instructions are callgrind
counts per call). None was re-measured for these notes.

### Highlights

- **Faster closure calls.** Guards carry version stamps, calls to a known callee are tail
  dispatched, a callee without side effects skips its promises, and each call site caches its
  argument matching. A closure call takes 3,411 instructions, against 3,968 before and 4,602 in
  GNU R.
- **S3 and S4 dispatch cache per call site.** An S3 dispatch takes 7,688 instructions (GNU R
  9,824) and an S4 dispatch 8,688 (GNU R 11,681).
- **Native prologues for hot base closures.** The validation workload runs 1.94 times as fast as
  GNU R.
- **Builtin fast paths.** Instructions per call, before and after, with GNU R for comparison:

  | Call | Before | After | GNU R |
  | --- | --- | --- | --- |
  | `identical(a, b)` | 8,545 | 1,818 | 3,149 |
  | `x %in% y` | 11,327 | 1,745 | 8,226 |
  | `isTRUE(x)` | 6,087 | 1,114 | 5,594 |
  | `!x` | 944 | 563 | 750 |
  | `x[["net"]] <- 3` | 4,910 | 987 | 2,011 |

- **The JIT is cheaper to keep on.** Proofs are shared across sibling enclosures, nothing is
  revalidated while no binding has moved, and `pkg::f(...)` calls are compiled.

### Measured against 0.4.2-beta

On the `bench-real` workloads (10 real-world programs, geometric mean of the speed relative to GNU R,
`--repeat 3`), 0.4.3-beta runs 1.22 times as fast as GNU R with the JIT on and 1.28 times with it
off. 0.4.2-beta measured 0.90 times with the JIT on. The new testthat workload
(`tools/bench/applications/testthat.R`) runs 1.12 times as fast with the JIT on and 1.23 times with it off.

### Also in this release

- **S4 definitions run natively in more shapes.** A class under a class-union member is defined
  natively: 200 such classes take 20 ms, against 831 ms on the R path and 1,017 ms in GNU R.
  Methods that omit or rename generic arguments, and generics with a braced body, are native too.
  `setAs()` and `setClassUnion(member = )` are matched in the load index, so both are held back
  until first use. S4 subclass bookkeeping and `.local` methods run natively.
- **`deparse(getClass("A"))` matches GNU R**, and a segfault when deparsing an S4 object is fixed.
- **`ry check` no longer crashes** on a forward capture after a hinted lambda.
- **`solve()` works without a system LAPACK**, because the Linux archive ships GNU R's reference
  `libRblas.so` and `libRlapack.so`.
- **`gc()` reports a max-used figure close to the real peak.** A reproducer that reported 4,198 MB
  now reports 575 MB, against an 831 MB process peak. GNU R counts the peak at allocation, while
  ry samples it at collections.
- **Profile summaries for packages.** `ry load --profile-summary FILE` and `ry test
  --profile-summary FILE` write the summary `ry run` writes. `RY_PROFILE_SUMMARY_DIR=DIR` makes every
  process write `DIR/ry-profile-<start>-<pid>.md`, and child processes inherit it
  ([CLI reference](/reference/cli.md)).
- **Load plans are linear in the S4 definitions.** The first plan of a 591-file S4 package drops
  from 38 ms to 14 ms.
- **More numerics match GNU R bit for bit:** `pgamma`, `qgamma`, `pbeta`, `qbeta`, the quantile
  search of `qbinom`, `qpois` and `qnbinom`, `dnbinom`, `loess`, `smooth.spline`, `lowess`, `fft`,
  and the long double accumulation and matrix-product modes. `options(ry.blas = "host")` or
  `RY_BLAS=host` sends `%*%`, `crossprod` and `tcrossprod` through the installed BLAS, so the bits
  follow the machine's BLAS.
- **A pinned corpus of real package test suites** from a CRAN mirror supports package
  compatibility work. It exposed a segfault when `[[` fell back after an S4 generic found no
  method, and `options(expressions = )` having no effect; both are fixed.

### Known limitations

- **No macOS or Windows binaries.** 0.4.3-beta has a Linux x86_64 archive only.
- **The JIT on is still slower than off on 8 of the 10 `bench-real` workloads**, because the cost
  of the first compile is not yet amortized.
- **`ry R` still needs GNU R**, because it runs your code on GNU R itself.
- **Linear algebra on Windows needs GNU R.** Windows has no system LAPACK, so `solve()` and its
  relatives need `R_HOME` naming a GNU R installation.

## ry 0.4.2-beta, Linux only

*Released in November 2026 as a pre-release.*

Version 0.4.2-beta starts faster, uses less memory in common cases and loads S4 packages in a
fraction of the time. It ships Linux x86_64 binaries only: macOS and Windows users stay on
[0.4.1-beta](https://github.com/felix-andreas/ry/releases/tag/0.4.1-beta) until a later release
fixes those builds ([Installation](/installation.md)).

### Highlights

- **Start-up.** On the benchmark machine an empty script runs in about 30 to 37 ms, against 119 to
  143 ms on 0.4.1-beta, and `library(lattice)` takes about 58 ms instead of 158 ms. The release also
  bundles all 15 recommended packages on Linux, so `library(lattice)` works without GNU R.
- **S4 packages load lazily.** Each held-back S4 generic runs at its first use, and the S4 cache on
  disk is gone. On a synthetic S4-heavy package the first `new()` takes 80 to 87 ms instead of 0.36
  to 0.40 s.
- **Frames are released at return**, and closure calls take their arguments from an arena, which
  keeps the peak memory of call-heavy programs lower.
- **Faster vector code.** `[[<-` and `[<-` grow vectors in place, matrix sub-assignment has its own
  bytecode, the JIT reads and stores matrix elements natively, regular expressions run on PCRE2
  directly, and `textConnection()` is implemented natively.
- **Typed code uses less memory.** Typed list programs stay near GNU R's peak, and an empty typed
  list keeps the item type the checker gave it.
- **Packages build in parallel**, and `.libPaths()` includes GNU R's user and site libraries.
  Stable hashes of base R functions ignore srcrefs.

### Measured against 0.4.1-beta

The untyped benchmark programs of the [Benchmarks](/benchmarks.md) page, best of 3 runs on a 4-core
Xeon at 2.1 GHz, give identical results on both releases. Warm times differ by at most 10 percent
(array_map 0.030 s to 0.033 s, fib 5 ms to 6 ms), and bond_book (0.416 s to 0.267 s), drawdown
(0.037 s to 0.029 s) and array_sum (0.022 s to 0.018 s) are faster. The start-up peak of an empty
script with `stats` attached is about 6 MiB higher (38.8 MiB to 45.0 MiB), and the peak of
`array_map`, `closures`, `loop_sum`, `validate`, `vector_arith`, `sales` and `vasicek` is 2 to 44 MiB lower,
while `array_dot`, `array_filter`, `array_sum`, `bond_book`, `expr_tree`, `fib`, `log_rank`, `orders` and `report` are 4 to 8 MiB higher
and `drawdown` is 15 MiB higher.

### Also in this release

- **ry needs no GNU R to run R.** `ry run`, `ry load`, `ry test`, `ry document` and `ry install`
  use a build of base R 4.6.2 that ships inside `ry`, so `R.version` reports R 4.6.2. Set
  `R_HOME` to a GNU R installation to emulate that release instead ([Installation](/installation.md#r)).
- **Typed code runs on native values.** A typed function in strict mode compiles before its first
  call to native code over numbers, strings and lists, so typed programs that build strings or
  call local functions run 10 to 120 times faster than on GNU R ([Benchmarks](/benchmarks.md)).
- **S4 definitions run natively.** `setClass()`, `setGeneric()`, `setMethod()` (also on
  primitives such as `length`), `setClassUnion()`, `methods::cacheMetaData()` and inherited single-argument dispatch run in Rust
  for the shapes packages usually write, with results identical to the methods package's R code.
  A loaded package's S4 generics run at their own first use, so on a generated package with 2,892
  S4 definitions the first `new()` after a cold load takes about 85 ms instead of about 6 s, with
  no S4 cache on disk.
- **`format()` shows external pointers** as GNU R does (`<pointer: 0x…>`), so `str()` of a value
  that holds one, such as an S4 class definition, no longer fails with "Found no format() method".

### Known limitations

- **No macOS or Windows binaries.** 0.4.2-beta has a Linux x86_64 archive only.
- **`ry R` still needs GNU R**, because it runs your code on GNU R itself.
- **Linear algebra on Windows needs GNU R.** Windows has no system LAPACK, so `solve()` and its
  relatives need `R_HOME` naming a GNU R installation, whose `Rblas.dll` and `Rlapack.dll` they call.

## ry 0.4.1-beta, on every platform

*Released in November 2026 as a pre-release.*

Version 0.4.1-beta ships ry with its runtime for Linux x86_64, macOS on Apple silicon and Windows
x86_64, loads large S4 packages much faster, and fixes the R incompatibilities that real package
test suites reported. The VS Code extension on the Marketplace is unchanged at 0.3.2, so set
`ry.path` to the new binary to use the runtime from VS Code ([Installation](/installation.md)).

### Highlights

- **macOS and Windows archives.** `ry run`, `ry load` and `ry install` work on all three platforms,
  and the release workflow smoke-tests each archive against GNU R and a CRAN package before it
  publishes.
- **Large S4 packages load in well under a second once cached.** On a generated package with
  2,877 S4 definitions, `ry load` followed by the first `new()` takes about 0.75 s on a second run,
  against about 6.6 s before. Class unions and `setAs` no longer stop ry from holding S4
  definitions back until first use, and the cached definitions are restored lazily without
  `methods::cacheMetaData`.
- **`sys.call()` and `sys.calls()` no longer copy the arguments.** Under `do.call()` with a large
  argument they took about 0.1 s each, which made data.table's `[` hundreds of times slower.

### All changes

- Regular expressions accept TRE's `{+}` quantifier.
- `names<-` dispatches `as.character`, so Date and POSIXct names match GNU R.
- `format(x, "%OS0")` prints whole seconds.
- An interrupt raised under `suspendInterrupts()` stays pending until the next check.
- `ry load` attaches testthat and sources the test helpers as pkgload does.
- `ry test` runs `test_*.R` files and filters on testthat's context name.
- `c()` drops `NULL` arguments before S4 dispatch, as GNU R does.
- `nrows()` and `ncols()` accept `NULL` and pairlists.
- `round()` and `signif()` port GNU R's algorithm, including the R 4.5.1 change, so they pick the
  same nearest double.
- On Windows, paths split at both separators, `system()` runs without a shell and honors its
  redirections, and `R CMD` puts Rtools first on `PATH`, so `R CMD build` and package installs work.

## ry 0.4.0-beta, the first release that runs R

*Released in November 2026 as a pre-release.*

Version 0.4.0-beta adds ry's own R runtime beside the checker, plus the language features that only
that runtime runs.

### Highlights

- **Your R code runs faster.** On the eleven programs on [Why ry](/getting-started.md), ry's runtime beats GNU
  R on ten: 1.2 times faster on vectorized arithmetic, 5 to 7 times on loops over vectors, and 130
  times on recursive `fib` (0.01 s against 1.31 s). `log_rank`, which spends its time in builtins,
  runs at GNU R's speed. [Benchmarks](/benchmarks.md) has the code and the method.
- **Types reach run time.** Inline annotations sit beside `#:` comments, and ry's runtime checks them
  at function boundaries. [Strict mode](/guide.md#strict-mode) rejects untyped code, and
  `ry check --annotate` writes the types it asks for.
- **Records, tuples, tagged unions and `match`** model data with exhaustiveness checks, and typed
  code that uses them compiles to machine code at its first call.
- **One binary.** A release archive holds `ry` alone. The runtime is embedded in it and unpacked into
  your cache directory the first time you run code.
- **Package development is built in.** `ry load` loads your package lazily, `ry test` runs its tests
  and `ry document` writes its documentation, each a drop-in for the devtools command.
- **`DataFrame`** is a typed table that runs on the Polars engine, and the
  [standard library](/reference/standard-library.md) (`Result`, `List`, `Str`, `Dict`, `Set` and more)
  now covers Roc's builtins.

### All changes

- **`ry run script.R` runs R on ry's runtime**, and `ry R script.R` runs the same script on GNU R.
  ry's runtime still reads base R from your GNU R installation, so both need one.
- **Inline annotations** such as `function(price: double) -> double` sit beside `#:` comments. ry's
  runtime checks them at function boundaries, and GNU R runs the code with them erased.
- **Records, tuples, tagged unions and `match`**, checked for exhaustiveness, are ry's recommended
  way to model data.
- **`DataFrame`** is a typed table with a Polars-style API that runs on the Polars engine.
- **`ry load`** loads the package you are developing from source, lazily, and the `ry run` and `ry R`
  consoles reload what you edited before each command.
- **`ry check --fix`** applies the safe fixes (`T` to `TRUE`, `=` to `<-`, a trailing comma), and
  `--unsafe-fixes` also applies spelling suggestions. The editor gets the same quick fixes plus a
  fix-all action, refactorings (extract a variable or a function, inline a variable, and move types
  between a `#:` comment and inline syntax), a call hierarchy, workspace symbol search, an outline
  with sections, folding, selection ranges, semantic highlighting and parameter-name hints.
- **More lints, including lintr's.** `equals-na`, `vector-logic`, `length-sequence`, `class-equals`
  and `length-test` are on by default, each with an unsafe fix. Eleven more ported from lintr, such
  as `scalar-in`, `order-subset`, `matrix-apply` and `nzchar`, are available when you turn them on,
  like `redundant-return` and `commented-code` ([diagnostic codes](/reference/diagnostic-codes.md)). A project that is set up for lintr keeps its
  choices without a `ry.toml`, because ry reads the `linters` field of its
  [`.lintr` file](/reference/configuration.md#a-lintr-lintr-file).
- **`ry check --annotate` writes the types strict mode asks for.** It adds the inferred type of
  each unannotated top-level function and binding, then lists what is left to type by hand. The
  editor offers the same edit for one binding or a whole file
  ([Moving a file to strict mode](/guide.md#strict-mode)).
- **`ry fmt --range`** formats only the lines you name, the editor formats a selection or the line you
  just finished, and `ry fmt` runs in parallel ([Formatting](/guide.md#format)).
- **Faster recursion and more of base R.** A function that only does scalar arithmetic, such as
  recursive `fib`, compiles to frameless machine code (`fib(30)` takes 0.005 s against 0.9 s on GNU
  R), and sockets work, so `parallel`'s PSOCK clusters run.
- **A debugger and a console in VS Code.** `F5` runs the current script under a debugger with
  breakpoints, stepping and variable inspection, "Debug test" does the same for one `test_that()`
  block, and `Ctrl+Enter` sends the selection to a ry console. Other editors can use the same
  debugger through `ry debug-adapter`. See [Editors](/reference/cli.md#debug-adapter).
- **The editor attaches to a running console.** "ry: Attach to Console" debugs the commands you type
  in `ry run`, `browser()` stops at a `Browse[1]>` prompt that an editor can take over, "View Data"
  opens a paged, sortable and filterable table of a data frame, matrix or `DataFrame`, and hover and
  completion use the console's live values. R chunks in R Markdown and Quarto documents get the
  language-server features too (Unix only for the console connection).
- **Named arguments navigate.** Hover, go-to-definition, references and rename follow a named
  argument to the parameter it fills, so renaming a parameter also rewrites `rate = 0.05` at its
  call sites, and `pkg::name` goes to the package's stub or your own definition.
- **Faster loads.** `ry load` binds R6 class generators lazily and holds back S4 methods on other
  packages' generics, so a session that never touches them skips their setup
  ([package loading](/reference/package-loading.md)), and a strict `ry load` runs its check while the
  runtime starts and checks only the package's own files, not its tests and scripts.
- **`ry test` runs your package's tests as `devtools::test()` does.** It loads the package lazily
  with `ry load`, runs the `tests/testthat` files with testthat's own reporters, and exits with `1`
  when a test fails. With `--watch`, every save reloads only the changed definitions, rebuilds
  compiled code after a `src/` edit, and runs the test files the edit can reach first. It learns of
  saves from the operating system's file notifications, as the consoles now do. On a 308,000-line
  benchmark package with 502 test files, the first file's results arrive in about 2 s, against 62 s
  for `devtools::test()`
  ([CLI](/reference/cli.md#test), [Running tests](/reference/package-loading.md)).
- **`ry document` writes documentation as `devtools::document()` does.** It runs roxygen2 against
  the lazily loaded package, and its `man/*.Rd` files and `NAMESPACE` are byte for byte the same.
  It caches each file's parsed blocks and runs roxygen2's slowest steps in linear time, so on a
  benchmark package with 22,000 Rd files it takes about 2 minutes after an edit, against 21 for
  devtools ([Writing documentation](/guide.md#run-code)).
- **`ry load` follows `devtools::load_all()` more closely.** `system.file()` maps `inst/`, testthat
  helpers are sourced, lazily defined functions keep their source references, a package that
  imports a reloaded one sees its new bindings, `Encoding: latin1` is honored, and a declared
  `S3method()` with no function refuses the load with R's message. Every load of a strict package
  is checked, including a reload in the console, which re-checks only what the edit changed. On
  ry's runtime, `src/` compiles with ry's own toolchain, and `if` blocks in `NAMESPACE` are
  evaluated as GNU R evaluates them ([package loading](/reference/package-loading.md)).
- **Help works on ry's runtime.** `?mean`, `help("mean")`, `help(package = "stats")` and
  `help.start()` print or serve R's help pages, HTML help included, as GNU R does
  ([Console](/reference/cli.md#run-and-r)).
- **The editor follows `$` fields and installed packages.** Go-to-definition, hover, references and
  rename resolve `x$name` through the values that built `x`: lists, data frames, records and R6
  classes, including `self$` and `private$`. Rename refuses a field it cannot trace completely.
  For a package without a ry stub, definition and hover read the installed package's code and help
  without running R ([Editors](/installation.md#editors)). Renaming a package-level `the` also renames its
  uses after `the$x <- v` inside a function, where R works on a local copy.
- **Completion and signature help work on untyped code.** Completion ranks names by how often the
  project uses them, with locals first, and a package without a ry stub completes the exports in its
  installed `NAMESPACE`. Signature help covers untyped functions, installed packages and R6 methods
  called through `self$`, and an unresolved name that a package exports gets the quick fixes
  "Qualify as `pkg::name`" and, in a script, "Add `library(pkg)`". A function literal shows its
  inferred signature as an inlay hint, member names such as `x$field`, `x@slot` and R6 members are
  highlighted, and the outline lists S4 slots and a type's tags.
- **Fewer false reports on real packages.** Inferred signatures now carry facts about the callee's
  body, such as a return chosen by a flag default or a parameter read only through `substitute()`.
  Names injected into R6 and Reference Class methods (`self`, `private`, `.self`) resolve, a
  literal `source("file.R")` is followed, and `with`, `subset` and `transform` mask their column
  arguments. With typing on, the corpus packages' `R/` sources report 51 errors, down from 98, and
  about 26 of those are real package bugs. The generated benchmark packages report nothing.
- **Graphics draw as GNU R does.** A gallery of 149 figures (base graphics with `persp`, contours,
  dendrograms and plotmath, grid, lattice, ggplot2 and PerformanceAnalytics charts) renders on every
  device, and 146 of them match GNU R pixel for pixel on ragg. On `pdf()`, `svg()` and the bitmap
  devices, gradients, tiling patterns, clipping paths, masks, compositing groups and even-odd fills
  work, and `postscript()` refuses them as GNU R's device does. knitr and rmarkdown documents with
  plot chunks render on ry.
- **`DataFrame` checks column types and handles bigger data.** Arithmetic or comparison on a text
  column is a type error on the column reference. Reading a CSV no longer holds the parsed file
  next to its columns, so a 1e8-row group-by run fits in 15 GB. data.table's `dt[i]` runs on
  data.table's own code again, which uses less memory. [From data.table](/reference/from-data-table.md)
  maps `dt[i, j, by]`, `:=`, joins and `fread` to `DataFrame` verbs, and the opt-in
  `[lint] data-table` setting marks data.table calls and links to it.
- **Typed code compiles at its first call.** A closure whose parameters and return are annotated
  compiles from its signature instead of after warm-up. Records, tuples, tags and guarded `match`
  compile natively too, and a variable that is an integer on one path and a double on another stays
  unboxed. A fold over 200 tag-union records five times takes 0.05 to 0.1 s, against 0.4 to 0.7 s on GNU R for
  the same program written with `list(kind = )`. In compiled code, `List.walk`, `List.map`,
  `List.keep_if`, `List.drop_if`, `List.any`, `List.all` and `List.count_if` run as native loops
  with the callback inlined: walking a 100-element list 10,000 times takes 0.009 s, against 0.36 s
  with the JIT off and 0.94 s for `Reduce` on GNU R.
- **Faster everyday R on ry's runtime.** `switch` compiles to bytecode, a closure call makes one
  collection check for its whole frame, small objects are allocated by bumping a pointer, and
  `x[[i]] <- v` on a plain local vector inside a function writes in place, and S3 dispatch caches
  its method lookups. Base R's kernels, such as `match`, `order`, `split`, `strsplit`, `table`,
  `merge`, `aggregate` and `cumsum`, run at or below GNU R's time at 1e7 rows; `apply` over rows is
  still about 1.4 times slower.
- **The standard library is complete against Roc's builtins.** `Dict.with_capacity` and
  `Set.with_capacity` are new, and `reserve` now works on an empty `Dict` or `Set`
  ([standard library](/reference/standard-library.md)). `List.range` and `List.repeat` stop with an
  error past 2,147,483,647 elements.
- **Lower memory, faster cold checks.** Large vectors are collected sooner, strings are interned in
  a flat table, and `as.character()` of a long number vector is deferred as on GNU R, so peak memory
  on string-heavy code is within 1.1 times GNU R's. `1:n`, `seq_len(n)` and `seq_along(x)` with
  over a million elements are compact, so `seq_len(2^31 - 1)` no longer allocates 8 GB. `gc()`
  reports real cell counts, and `gc.time()` and `gcinfo()` work. The parser now builds ry's own flat
  syntax tree, and a cold check keeps one parse tree per worker, so `ry check --no-cache` on the
  300,000-line benchmark code bases takes about 1.2 s on 4 cores and peaks under 300 MiB.
- **More packages pass their own tests.** ry's runtime passes the tests of 155 of the 164 packages
  that GNU R passes (94.5%), among them rlang, purrr, vctrs, R6, Matrix, S7, pkgload, shiny, readr
  and git2r, and 35 of GNU R's own 66 `tests/*.R` scripts print exactly what they print on GNU R.
  The optimizers and integrators behind `optim` and `integrate` (L-BFGS-B, UNCMIN, QUADPACK and the interval
  search) are now written from scratch and match GNU R's results.
  A session uses one temporary directory, removed when it exits.
- **Linear algebra works on NixOS.** BLAS and LAPACK are also looked up in the directories GNU R's
  `etc/Makeconf` records, and packages that ry installs link the same libraries
  ([Installation](/installation.md)).
- **Seeded harnesses cover more of ry**: the help server, makefile expansion in `R CMD`, the JIT,
  reloads, the debugger's message framing, CSV reading and rendered graphics files. The bugs they
  found are fixed, and an unclosed quote in a CSV file is now an error.

### Installing

This release has one archive, for Linux x86_64: `ry-x86_64-unknown-linux-gnu.tar.gz`. It holds the
single `ry` binary, with ry's runtime built in, and needs glibc 2.35 or newer. macOS and Windows
archives, and a VS Code extension that bundles the new binary, follow in a later release.
[Installation](/installation.md) shows how to install the archive and what to use on other platforms.

### Known limitations

- **ry's runtime still needs GNU R**, version 4.3 or later built as a shared library, because it
  reads base R's sources and the default packages from that installation. `ry check`, `ry fmt` and
  `ry server` need no R.
- **Linux x86_64 only.** This release has no macOS or Windows archive. The VS Code extension on
  the Marketplace is still 0.3.2, which bundles 0.3.2-beta without ry's runtime and has none of
  the debugger and console features above. The Windows runtime has run only under
  Wine so far.
- **Peak memory is often higher than GNU R's.** On the benchmark programs, ry uses more memory on
  eight of eleven, up to 1.8 times as much (`drawdown`, 133 MiB against 73 MiB).
- **Not every package passes its tests yet**: 9 of the 164 packages that pass on GNU R still fail on
  ry's runtime, and `apply` over rows is about 1.4 times slower than on GNU R.

### Licence

ry 0.3 was UPL-1.0 throughout. Parts of ry's runtime translate GNU R's own C code, so the `ry`
binary and the crates behind the runtime are now GPL-2.0-or-later, like GNU R. The tooling crates
(the parser, the checker, the formatter and the editor features) stay UPL-1.0, the C headers that
packages compile against are LGPL-2.1-or-later as R's are, and the VS Code and Zed extensions are
MIT. [Licensing](/reference/licensing.md) has the details, including why the binary as a whole is
passed on under GPL-3.0-or-later.

## ry 0.3.0, a complete rewrite

*Released in July 2026 as a pre-release.*

Version 0.3.0 replaces the previous implementation end to end, with a new parser, a new analysis
engine, and a static type checker, the first one for R.

- **The project is renamed from Roughly to ry.** The binary is `ry`, the configuration file is
  `ry.toml`, and a suppression comment reads `# ry: allow(...)`. The crate is published as `ry-lang`.
- **R gets a static type checker**, new and experimental: Hindley-Milner inference with numeric
  constraints and generics, guided by [`#:` annotation comments](/guide.md#annotate). Type
  errors are opt-in through `[check] typing`, but hover, completion, signature help, and inlay hints
  use the inferred types either way.
- **The R parser is hand-written.** It builds lossless syntax trees, recovers from broken input, and
  produces precise diagnostics that feed straight into the analysis, so one mistake no longer hides
  the findings in the rest of the file.
- **The analysis engine is incremental.** A memoized query core rechecks only what an edit could have
  affected, and incremental results are verified to be byte-identical to an analysis from scratch.
- **The standard library has type stubs.** Declaration-only `.Rtypes` stubs for base, stats, utils,
  and methods ship inside the binary, and a project can override any of them.
- **The editor features run on the new analysis**: hover, completion, go-to-definition, references,
  rename, document and workspace symbols, inlay hints, signature help, and semantic highlighting of
  `#:` annotations.
- **ry ships an R console.** `ry repl` and `ry run` load your system R (they are the only commands
  that do), and completion in the console is backed by the project analysis.

Binaries are on [GitHub Releases](https://github.com/felix-andreas/ry/releases), and the VS Code
extension is on the [Marketplace](https://marketplace.visualstudio.com/items?itemName=felix-andreas.ry).
