-
Notifications
You must be signed in to change notification settings - Fork 4
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
[RFCs]: Magnition Proposal - Template type passing #6
base: main
Are you sure you want to change the base?
Conversation
This PR proposes RFCs for the following two features: - Localized Layout Options - Template typename passing with inheritance Signed-off-by: mkhubaibumer <[email protected]>
Signed-off-by: mkhubaibumer <[email protected]>
Signed-off-by: mkhubaibumer <[email protected]>
Signed-off-by: mkhubaibumer <[email protected]>
…O/rfcs into template-type-passing
@cmnrd @lhstrh @petervdonovan @edwardalee for review and suggestions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the stated problem. I am not fully sure if LF should be focused on fixing this, though. If we do so, we are risking becoming yet another C++. Given the code generation we do, we would certainly be in the position to bring higher-level language concepts to C, but I wonder if that should be our focus. After all, we have targets that already provide the necessary tools as built-in features.
@petervdonovan You probably understand best the current implementation of C generics. Could you comment on the feasibility and how much effort it would be to implement this?
I believe that this might take as little as an afternoon to implement and that in any case it would not be a four-month project.
But I also share this concern. I also had this concern back when generics were being implemented; this is why I chose not to add tests to show that inheritance was compatible with generics. If I understand the history (I was not around at the time when this happened), inheritance was introduced experimentally early on in the project when it was easier to introduce features quickly without much discussion. Over time there has been resistance to removing it because it was already there. And now because it is called "inheritance" and in the Java/C++ world, inheritance is often the go-to solution for code reuse, this mechanism might end up being used a lot, even if there are other ways to achieve code reuse. I think that in order to resolve this, either inheritance should be deprecated, or people like me who have concerns about inheritance should stop arguing about it and just commit to getting inheritance to work properly and writing proper tests for it. I don't know which of these two paths is more pragmatic; maybe choosing one of them should be the subject of another RFC. |
rendered
This PR proposes RFC for the following feature: