Skip to content

Make sure we can fix the parser's bad list/number interactions #8613

Open
@roberth

Description

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

We have to obscure syntaxes that can be argued to be bugs; certainly one of them.
However, changing the tokenizer/parser for them technically means breaking the language.

I think bug for bug compatibility is valuable, but also costly. In this case the cost/benefit of bug for bug compatibility seems off, and we may have a way out.

Describe the solution you'd like

Language versioning would be great, but going this route also means that we'd have to indefinitely support the bad syntax.
So regardless of the language versioning idea, we can run an experiment to verify that the community does not rely on the bad syntax, and then "break" the syntax to no ill effect.
Benefits:

  • clean up the implementation; less maintenance overhead
  • the default language version has better syntax

Method:

  • reject the bad syntaxes in the lexer and/or parser. Ask users to open an issue in the error message.
  • wait
  • if nothing is reported, fix and improve the lexer and/or parser as appropriate depending on whether an issue was created

Describe alternatives you've considered

Wait for language versioning and maintain the bad syntax forever even if there's no benefit of doing so.

Additional context

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    bugfeatureFeature request or proposalidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.languageThe Nix expression language; parser, interpreter, primops, evaluation, etcprocessIssues related to the development process of Nix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions