This repository was archived by the owner on Sep 1, 2020. It is now read-only.
This repository was archived by the owner on Sep 1, 2020. It is now read-only.
@reorderable vals as an alternative to lazy vals #20
Closed
Description
As @paulp points out, most lazy vals don't need to be double-locked lazy vals because it's only used as a cheap (lazy?) way of guaranteeing safe initialization order, but comes with a performance cost for every subsequent access. In many cases static analysis could avoid this by choosing a safe initialization order at compile time.
@reorderable
would be used in place of lazy
for these cases, and the compiler would generate warnings (or errors?) where the dependencies can't be determined statically.