-
-
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] add some junk #24400
[WIP] add some junk #24400
Conversation
Despite triage liking this, and despite the name being somewhat descriptive
of what's actually in the array, I'm not a huge fan of the word `junk`
here. Were any other terms discussed? (I don't actually have any better
ideas...)
…On Sun, Oct 29, 2017 at 4:57 PM, Sacha Verweij ***@***.***> wrote:
Per triage, base needs more junk. This pull request adds some junk.
Specifically, this pull request explores #11557 (comment)
<#11557 (comment)>
by replacing the existing primitive Array constructors with junk
equivalents, e.g. Array{T,N}(d::Vararg{Int,N}) -> Array{T,N}(junk,
d::Vararg{Int,N}), and reimplementing the existing constructors in terms
of those junk equivalents. The next step would be deprecating the
existing constructors in favor of those junk equivalents. Best!
------------------------------
You can view, comment on, or merge this pull request online at:
#24400
Commit Summary
- Replace primitive Array{...}(dims...) constructors with
Array{...}(junk, dims...).
File Changes
- *M* base/boot.jl
<https://github.com/JuliaLang/julia/pull/24400/files#diff-0> (53)
- *M* base/sysimg.jl
<https://github.com/JuliaLang/julia/pull/24400/files#diff-1> (32)
Patch Links:
- https://github.com/JuliaLang/julia/pull/24400.patch
- https://github.com/JuliaLang/julia/pull/24400.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#24400>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANoEgX2IhC3jQsRLO_pKFYkl8_5QQUWks5sxRDbgaJpZM4QKiMJ>
.
|
Alas I do not recall whether and if so what other possibilities were discussed. Descriptiveness was the primary argument in favor of Having wrung an adequate volume of groanworthy humor from the name, I have no further attachment to it :). Best! |
Reducing the CI failure to the following test provided a good laugh: # issue #14878
mutable struct A14878
ext
end
A14878() = A14878(Dict())
mutable struct B14878
end
B14878(ng) = B14878()
function trigger14878()
w = A14878()
w.ext[:14878] = B14878(junk) # junk not defined!
return w
end
@test_throws UndefVarError trigger14878() Someone (quite reasonably) did not anticipate introduction of the name |
|
|
Triage would like a better sense of the scope of objection to (Edit by Stefan:) To clarify: thumbs up is "yeah, I like |
I have no opinion pro or contra |
The current candidates seem to be Everyone on the triage call is pro-junk or as Jeff said, "I'm not a junk hater". The vote is currently tied 5 to 5. It would be helpful if the junk haters could explain what their objection to the name is. |
I don't think having a debug possibility of filling uninitialized memory with a known pattern should influence the naming. |
It doesn't influence the naming so much as it highlights the nature of the operation. It doesn't actually mean "give me an uninitialized array" – it means "give me an array full of junk". |
But the point is I don't actually want junk, I just don't care what is
currently in the array and whatever it is I am fine with that.
So if uninitialized is to long (a feature in my opinion), I would propose a
third option `whatever, highlighting the fact that the runtime can give me
whatever, junk, random, zeros..., whatever is fastest I want that.
For NUMA aware programming I particularly don't want the memory to be
touched before I do something to it.
…On Thu, 9 Nov 2017 at 15:44 Stefan Karpinski ***@***.***> wrote:
It doesn't influence the naming, so much as it highlights the nature of
the operation. It doesn't actually *mean* "give me an uninitialized
array" – it means "give me an array full of junk".
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#24400 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI3atKq2UNtvzPrYl0xd-x79RbbrkHiks5s02Q3gaJpZM4QKiMJ>
.
|
At the same time, a comment in each file where |
I appreciate the argument for |
If we're not going to do |
|
Despite the anti-junk contingent taking the lead early on in this nail-biting vote, team junk seems to have pulled ahead with 9 versus 7. So let's go with |
@malmaud has made the case that |
Actual pro-uninitialized argument: |
As with most things Julia, I don't always agree with the decisions, but I'm very happy that the language exists and that people are both cordial and sometimes humorous in their responses. I'm happy with the decision here, and also would have been fine if it had gone the other way. Thanks for the discussion! |
Also |
Closing in favor of #24652. Thanks all! |
Per triage, base needs more
junk
. This pull request adds somejunk
. Specifically, this pull request explores #11557 (comment) / #16029 (comment) by replacing the existing primitiveArray
constructors withjunk
equivalents, e.g.Array{T,N}(d::Vararg{Int,N})
->Array{T,N}(junk, d::Vararg{Int,N})
, and reimplementing the existing constructors in terms of thosejunk
equivalents. The next step would be deprecating the existing constructors in favor of thosejunk
equivalents. Best!