Skip to content

Tracking Issue for polymorphization #124962

Closed as not planned
Closed as not planned

Description

@RalfJung

This is a tracking issue for polymorphization (-Zpolymorphize).

Current (2024-05) status:

  • no one has worked on it for 4 years yes
  • It mostly works, but there are some bugs remaining where it incorrectly polymorphizes
  • the current implementation is very limited and not really useful
  • @lcnr wants to remove the current implementation and replace it with a different approach

Open problems

Unresolved Questions

  • Does this in any way interact with which code gets monomorphized? For fully monomorphic functions, we sometimes monomorphize and codegen them for no good reason (see here or here). This is very hard to avoid, but it would be good to limit this to fully monomorphic functions. So even with polymorphization, ideally we will not generate code (and evaluate constants) for any function that's not already considered by the collector. Currently, it seems like everything is fine here, but we should have an eye on this.

Implementation history

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    -ZpolymorphizeUnstable option: Polymorphization.
    on May 10, 2024
  2. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on May 10, 2024
  3. compiler-errors commented on Jan 3, 2025

    @compiler-errors
    Contributor

    Polymorphization was removed in #133883, for the record.

  4. jplatte commented on May 8, 2025

    @jplatte
    Contributor

    Why was this closed? I've seen it brought up multiple places now. It seems like there is no longer an implementation of it, sure, but not because the feature was bad, just because the implementation was bad. We have lots of tracking issues for non-implemented features, right?

  5. RalfJung commented on May 8, 2025

    @RalfJung
    MemberAuthor

    We don't typically use tracking issues for features without an up-to-date accepted RFC or MCP, no. There's nothing to "track" if there's no actionable implementation plan.

  6. jplatte commented on May 8, 2025

    @jplatte
    Contributor

    Right so the difference here is that there hasn't been a formal proposal for this, makes sense.

    Though it seems like a new implementation plan exists as per the fourth bullet point in the issue description?

    Anyways, thanks for the quick answer :)

  7. RalfJung commented on May 8, 2025

    @RalfJung
    MemberAuthor

    Though it seems like a new implementation plan exists as per the fourth bullet point in the issue description?

    @lcnr has some ideas; if they want to have an issue open to track them they'll create one. :) But this issue here specifically tracked the old implementation, which is gone, and therefore this issue has served its purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    -ZpolymorphizeUnstable option: Polymorphization.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions