-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for RFC 1868: A portability lint #41619
Comments
cc #43086 |
When this is implemented, reconsider |
Just encountered a relevant research project - their work may have aspects we can reuse: http://fosd.net/TypeChef
|
[Hopefully this doesn't count as inappropriate advertising!] I'll be 1 half of a 2 person talk at the HIW at ICFP reviewing some of the literature. I was certainly inspired to take this up from this RFC and @eternaleye's comment, and I hope whatever proposal this turns into is equally applicable to Rust / fleshing out the details of this RFC too! |
Notes from lang team triage: the consensus is that the RFC looks reasonably accurate, but the design concerns not yet known. If there are design issues, the Lang Team expects that the implementor(s) would discover said design issues during implementation. Additionally, this feature is very much desired by various teams. For instance, the standard library's expansion to platform-specific areas is semi-blocked on this implementation. |
On the
I feel like there should be some good papers in here :) Even if the core mathematical techniques are not new, there is good empirical work on how the ecosystem would use this stuff, prevalance of platform specific code, ec. |
It seems like the current consensus among @rust-lang/lang is that this isn't the approach we want to go after all, and we'd like something type-based rather than lint-based. For instance, something based on the various "capabilities" proposals for global impls of a @rfcbot close |
Team member @joshtriplett has proposed to close this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
@joshtriplett Is there any sort of writeup that broadly explains how a type-based solution would work? I understand there are some concerns about this RFC as-is, but I haven't seen them clearly articulated. I probably dislike conditional compilation more than most, but there are situations where I have a hard time seeing how it can be avoided, and it's hard for me to see how a type-based solution could come close to all the use cases and situations that Overall I like the idea of this RFC, as it would provide a mechanism to inform someone what their code might be incompatible with. I can imagine there are some problems (like |
@rfcbot reviewed -- I agree with the where-clause based approach |
@rustbot labels -I-lang-nominated |
IMO type-based vs lint-based is perhaps not the distinction it sounds like it is. I imagine this would use the same logic programming machinery under-girding the trait system regardless. The question rather of phase separation. A On one extremely we full On the other extreme is today's I would like the full spectrum of options, and I would not like something that awkwardly overlaps with tl;dr new syntax greenfield system 👎 , implementing existing cfg sharing code with the trait system 👍 . |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to close, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
I have not checked my box; I agree with wanting a sketch of a solution that covers the use cases of the RFC before closing. |
@joshtriplett wrote:
Is there a link to these proposals/an elaboration of this approach? |
The idea that I brought up several times in meetings (online and in person) but never really wrote down is basically to use where clauses for this. My belief is that Rust already has a much better designed mechanism for specifying conditions/bounds on items, including the machinism for then assuming those conditions are met within that item: where clauses. Within a This is nearly exactly the same as what we need for platform specific items. Here's the same paragraph as the previous one, with only a few words changed: Within your Rust code, you are not allowed to call So, imagine if we had something like This would work not just for functions/methods, but also for trait impls such as |
This is a tracking issue for the RFC "A portability lint" (rust-lang/rfcs#1868).
Steps:
Unresolved questions:
libc
, which currently involves intricate uses ofcfg
. We should have some idea for how to approach such cases before landing the RFC.The text was updated successfully, but these errors were encountered: