A path towards removing URL literals #437

Closed
opened 2024-07-09 12:50:05 +00:00 by piegames · 1 comment
Member

URL literals are a notoriously bad feature and we all agree that one day they should be no more. Despite probably nobody using them, the mere existence of the feature in the parser causes significant performance overhead (TODO quote @pennae for some numbers).

Currently URL literals can be merely disabled with --extra-experimental-features=no-url-literals, however doing so currently gives no performance benefits.

The cleanest solution would be to implement proper language versioning which allows us to do breaking changes (see also RFC 137). However, this will not be implemented in the near future, therefore a different graceful mechanism for its deprecation is needed.

To remove URL literals in the language, the following steps are proposed:

  1. Enable no-url-literals by default (explicitly specifying it is a no-op or maybe prints a warning), and add an option to disable it via a new --extra-deprecated-features=url-literals.
  2. Decide on a time frame for how long that feature will be supported, and clearly communicate that in the error messages. Given that migration only requires putting quotes around strings and thus is trivial, a year of notice should be sufficient.
    • Optionally provide some tooling to automatically migrate code
  3. Finally remove the feature entirely, --extra-deprecated-features=url-literals will throw an error and --extra-experimental-features=no-url-literals will remain a no-op for a while until eventually being removed.
URL literals are a notoriously bad feature and we all agree that one day they should be no more. Despite probably nobody using them, the mere existence of the feature in the parser causes significant performance overhead (TODO quote @pennae for some numbers). Currently URL literals can be merely disabled with `--extra-experimental-features=no-url-literals`, however doing so currently gives no performance benefits. The cleanest solution would be to implement [proper language versioning](https://wiki.lix.systems/books/lix-contributors/page/language-versioning) which allows us to do breaking changes (see also RFC 137). However, this will not be implemented in the near future, therefore a different graceful mechanism for its deprecation is needed. To remove URL literals in the language, the following steps are proposed: 1. Enable `no-url-literals` by default (explicitly specifying it is a no-op or maybe prints a warning), and add an option to disable it via a new `--extra-deprecated-features=url-literals`. 2. Decide on a time frame for how long that feature will be supported, and clearly communicate that in the error messages. Given that migration only requires putting quotes around strings and thus is trivial, a year of notice should be sufficient. - Optionally provide some tooling to automatically migrate code 3. Finally remove the feature entirely, `--extra-deprecated-features=url-literals` will throw an error and `--extra-experimental-features=no-url-literals` will remain a no-op for a while until eventually being removed.
piegames added the
performance
RFD
labels 2024-07-09 12:51:47 +00:00
piegames added the
Area/language
label 2024-07-10 06:43:44 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/1736 ("libexpr: Deprecate URL literals")
  • commit message in cl/1735 ("libexpr: Introduce Deprecated features")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/1736", "number": 1736, "kind": "commit message"}, {"backlink": "https://gerrit.lix.systems/c/lix/+/1735", "number": 1735, "kind": "commit message"}], "cl_meta": {"1736": {"change_title": "libexpr: Deprecate URL literals"}, "1735": {"change_title": "libexpr: Introduce Deprecated features"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/1736](https://gerrit.lix.systems/c/lix/+/1736) ("libexpr: Deprecate URL literals") * commit message in [cl/1735](https://gerrit.lix.systems/c/lix/+/1735) ("libexpr: Introduce Deprecated features")
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#437
No description provided.