Skip to content
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
@propensive

Description

@propensive

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions