Skip to content

A position field for all values, for free #8209

@roberth

Description

@roberth

Is your feature request related to a problem? Please describe.

Values don't carry position info. This leads to worse error messages.

Describe the solution you'd like

Value currently uses a whole word for their type tag. Certainly on 64-bit, we could use half of that space to store a position index. On 32-bit we may choose to consume an extra word for this purpose, or not to support this. The latter might make Nix behave disproportionally worse over time as the resulting code paths are exercised more rarely.

Despite the lack of a strictly per-value overhead on 64-bit, this likely increases the memory consumption by increasing the size of the positions table. I think this can be solved by #8208

Describe alternatives you've considered

Only do this when debugging is enabled, only do this when show-trace is enabled, but most users won't know this or use this, so that's kind of useless.

Additional context
Add any other context or screenshots about the feature request here.

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-messagesConfusing messages and better diagnosticsfeatureFeature request or proposallanguageThe Nix expression language; parser, interpreter, primops, evaluation, etc

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions