Repository navigation
Ryn 0.1.7 — Native Power & Benchmarks
"Native Power & Benchmarks". The version strings (VERSION, ryn --version, rync --version, the registry header, the CI
archive names) say 0.1.7.
Nested structures
- A path of fields is stored through a reference:
self.q.p.y = 1andl.a.x += 1in amut selfmethod or through a
&mutparameter (the native backend declined these as "assignment through this reference"). The store goes to the
address of the nested field (PlaceAddressin the IR), so the old value is dropped and the new one moved in once. - A
mut selfmethod is called on a structure nested in another one (self.b.shift(1),l.b.shift(1)), in place, with the
mutability of the root checked (R0204on an immutable local). It wasR0235("method receivers must be a local
variable"). - A field of a structure nested in the result of a call is read (
make().q.p.x), and the rest of the result is dropped. - A method is called on a
Stringfield of a call result (make().label.len(),make().q.p.name.clone()): the string moves
into a hidden local that lives as long as the enclosing block, so nothing leaks or is freed twice (it was R0905). Alet
whose statement needed such a temporary no longer drops the bound name at the end of the statement. - A structure stored through a pointer as a whole (
self.seen = ...of aVec, aStringor a nested structure) works
for the native backend; it was declined as "a structure field of a structure type". This is what stopped programs with
a collection field changed throughselfinside loops from compiling. - C calls with more than six integer arguments pass the rest on the stack, for named functions and for calls through a
function pointer (scalar arguments only; records and the freestanding and Windows targets still decline). - The help of
R0905no longer points at the removed--backend cranelift. - Tests:
tests/suite/structs/nested_struct_*,vec_field_mutated_through_self_in_loops,
raii/nested_destructor_runs_once_per_resource,ffi/foreign_call_with_stack_arguments.
ryn bench
ryn bench <file.ryn|project-dir>compiles the program, times the compiler (--compile-runs N), runs the program
--warmup Ntimes without counting and then--iterations Ntimes with its output captured, and prints the minimum,
median, mean, maximum and standard deviation.--jsonprints the report as JSON,--save-baseline FILEwrites it,
--baseline FILE --threshold PERCENTcompares medians (default 10%) and exits 1 on a regression. A project with a
benches/directory times every.rynfile in it by name. Written in Ryn (selfhost/src/driver/bench.ryn).- The peak resident memory of the compiler and of the program is reported and written to the JSON (
peak_memory_kb), and a
baseline that has it makes memory growth past the threshold a regression too.std::process::ProcessResulthas a new
fieldpeak_memory_kb(the child'sru_maxrssfromwait4; 0 on Windows, where it is not measured). - Tests:
tools/tests/test_bench.py.