-
Notifications
You must be signed in to change notification settings - Fork 22
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
use properties, not fields #60
Conversation
@rafaqz what do you think? Should we just drop julia < v1.7 support? The alternative would be to base |
If this works for |
Well, the same function works, but slower - not for the tightest loops. See the new commit: it keeps the current behavior on 1.6-, throwing when fields != properties. 1.7+ get the correct properties handling. Also, maybe there are better ways to get struct properties as a namedtuple? |
Codecov Report
@@ Coverage Diff @@
## master #60 +/- ##
==========================================
+ Coverage 98.16% 98.24% +0.08%
==========================================
Files 3 3
Lines 109 114 +5
==========================================
+ Hits 107 112 +5
Misses 2 2
Continue to review full report at Codecov.
|
Julia v1.6 is LTS and this package has ~ 500 dependants. It worries me a lot dropping 1.6 support. |
Nothing gets dropped. Users on Julia 1.7+ get the bug fixed, users on 1.6- get a cleaner error instead of a confusing exception or silently wrong behavior. |
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.
LGTM (the downstream package tests hack needs to be removed before merge)
@jw3126 as you asked about |
@aplavin this is what I'm worried about
It has to be a compile time operation on 1.6 (This package is used in extremely performance critical code because it compiles away. If we add any cost at all to the methods here it will have very bad consequences, and effectively remove the possibility to use 1.6, even if it "still works") |
@rafaqz that comment of mine referred to an older version of this PR. Currently, there should be no performance regression. |
I would like to merge this? Any objections? |
@aplavin can you merge master into this so the integration tests run with this PR? After they pass I will merge this PR! |
Co-authored-by: Jan Weidner <jw3126@gmail.com>
Thanks again @aplavin this PR is a huge improvement! |
Just pulled this in to some code that now breaks. While this solves the issue for anyone who wants to operate on custom properties, the scope of usability seems rather narrow as it breaks any type that has computed properties (trying to to call a constructor with all those properties as arguments) which you'd never want to set nor construct from. |
@ancapdev this PR just fixes a bug in ConstructionBase: earlier, There has been work on introducing |
@ancapdev thanks a lot this is valuable feedback for us. Is some of that code open source, I would like to take a look at it? |
@aplavin Thanks, that's a good option, we could define @jw3126 The affected code we have is not public, unfortunately, but it's nothing particularly complex. We simply had some structs with a few computed properties, and we were using |
If you are only interested in |
That also makes sense, thanks |
fix #59