3 ms·
In Virgil, you can have it either way, anonymous tuple types with members indexed with .N, or flattened data types (without identity) with field names: var p
by titzer 4y ago
In Virgil, you can have it either way, anonymous tuple types with members indexed with .N, or flattened data types (without identity) with field names:
var p: (int, int) = (0, 0);
var q = p.0 + p.1;
type Point(x: int, y: int) #unboxed { }
var p = Point(0, 0);
var q = p.x + p.y;
Both will generate identical machine code with no allocations. It requires no escape analysis or assumption of non-identity (both tuples and data types have structural equality).