Zero-cost Functional Records in Rust

68 points jonwolski 12 comments

Rust (or LLVM) is able to optimize what appears to be "copy-construction" into
update-in-place when a function consumes a struct and returns a copy of that struct, even with some modifications to the original struct.

The functional programming abstractions are truly zero-cost.