-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
WIP: change getfield lowering and call overloaded version #5848
Conversation
This is an admirable show of patience in digging through my dirty laundry :) The biggest issue is deciding what exactly Also, you want as much behavior as possible defined through method definitions, since the compiler already knows how to analyze those. Anything else will require more special cases. For example
will automatically do direct access for any fields that lack method definitions. Using |
I agree with this and the approach of using method dispatch for field lookup. It's not just better for the compiler – it reduces yet another language feature to method dispatch, which is just elegant. |
This PR now implements generic version (see sysimg). Still WIP pending a couple test failures that should be tractable.
|
What is the status of this? It would be great to see some progress on this in 0.4. |
Agreed that this feature (if perhaps not this PR) would be really nice for 0.4. This PR still has a fundamental flaw in the module reference resolution. I do intend to look at it again, but not sure how much further I will get. |
Well, that's what I think. We'll see what @JeffBezanson thinks – a while back I think we agreed on this, but opinions to change over time. |
I spoke with Jeff a few days ago, and he was still generally favorable to dot overloading as well. |
I don't want to be the bad guy here. But the discussion in #1974 raises several issue which need to be IMHO clarified. Note that I am not sure either if I want this or not. The biggest issue I see is that currently there is a clear distinction between the public and the private interface. This will break and we will need a clear guideline when and how to use it. |
I think we'll need to feel this one out a bit once we have the functionality. We already tend to regard fields as private and I think that making |
Yes, generally in favor, but concerned that the As a slightly more abstract problem, I'm not sure it's good for However this makes julia harder to compile, since you basically must do an extra round of inference to resolve the |
This is a really hard decision because it will have a very major impact on the language. The language bindings are one thing but if we really need to have "public fields" is IMHO another one. What about making a hard split? If a type Wouldn't this be a much less invasive change? |
Perhaps we should keep the language-level discussions in #1974 for the time being. |
6c7c7e3
to
1a4c02f
Compare
Any chance of resurrecting this? It seems like all of the linguistic debates have devolved to mere bikeshedding over |
Ok, I'll have another go at this. |
[ci skip]
Awesome, thanks for rebasing! |
@JeffBezanson and @ihnorton, what are the major remaining issues with this? |
Not really ready for review. I have more local work that fixed most of the inference issues (I think). But I'm stuck in bootstrap purgatory now. |
Any timeline for resurrecting this? |
Just to state the reason I like I think For example, I would like to have a type/object for an optical transition, which has many properties (frequency
Probably after |
Will open a new PR if I get further in the future. |
Would be great to see a PR on this for 0.5. |
I just rebased this on the current master at yyc/ovldot although I won't necessarily have time to push this further anytime soon either...... |
Can you or @ihnorton open a new PR with that? It's easier to discuss a PR than a branch. |
Here is an attempt to implement getfield overloading, for #1974.