-
-
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
Why don't array comprehensions desugar into map? #9515
Comments
Pretty much a duplicate of #670 (except that comprehension syntax was slightly different 2.5 years ago), very closely related to #8450. Map and array comprehensions are different right now due to inference and a number of other reasons. I don't think we have a syntax for parallel array comprehension, so those are all getting executed on the master process in the first case. I'd call this an unexpected interaction of |
One difference is that with multiple arguments, |
Not meant as a jab; I understand that language design is tricky and that Julia hasn't yet hit v1.0. My point is that these types of issues are particularly critical when designing and implementing new languages, so they should be discussed thoroughly and implemented carefully. I see this as an issue because it suggests that something is weird in the way that array comprehensions are implemented. More precisely, I am concerned that features like array comprehension are given special status in the language. Needless to say, VIP features should be kept to a minimum. I read @StefanKarpinski's comment on #670. The issue is quite old, so I'm not sure how much of what is said is still relevant but his comment raises a few questions:
I have loads of more general questions about the type system but my first post to the group has not been approved yet. If anyone here has the power over those sorts of things, please accept my post! I'll try not to spam! |
@JeffBezanson Yes, technically I was thinking of |
We should generally move to type-inference-independent versions of map and comprehensions, as discussed here: #7258. |
If you posted to -dev, that's a smaller approval group, so it may take longer. If you posted to -users I don't see anything in the queue? |
Apparently Google Groups decided to just stop notifying me about pending members or messages on julia-dev. Sorry for the delay – I had no idea there was a backlog there :-( |
Hmm, I posted to julia-users so I guess it just didn't send properly. I guess I'll try posting again later. |
There are several issues about redesigning comprehensions, so I'm going to close this one as it's more just a discussion. |
I discovered this fact while working with something like the following:
Which raises the obvious question: why don't array comprehensions simply desugar into
map
s? This smells of bad language design that apparently identical language features have subtly different semantics.The text was updated successfully, but these errors were encountered: