Stating my opininon

This post was deleted by me.

1 Like

I am not hearing this. This particular change was on master and 0.7-alpha for a very long time, and many people used those versions. You’re also making it sound like we somehow didn’t test it. We did test it, and it worked exactly as intended. Ok, so you think the 1.0 release was absurd. Fine. So that makes it ok to make another absurd major release?

The “mistake” actually consisted of a positive change from a software engineering perspective. The behavior now is much more reliable in large source files and projects. Then it turned out that some people really wanted to do lecture examples with certain 3-line loops in the REPL, and that became less convenient to the tune of adding a single word to the code. So stop trying to paint this like some huge screwup requiring reflection and contrition. My patience is running out.

17 Likes

You know what, I have learned something from this. What I learned is that if I try to solicit feedback on a proposal to fix something that’s bothering people, what I get instead is the same tired points about the 1.0 release process, and other miscellaneous griping about version numbers, over and over again.

8 Likes

Personally, the issue doesn’t bother me at all. On the contrary, I find the way 1.0 works quite easy to understand, unlike the previous which I never got, and that matters most to me. I’d rather have an interactive inconvinience than not understanding how the REPL works. I don’t mind learning though.

I may also find the proposed behaviour easy to understand and as good as the current one, who knows. My point is that, if a higher proportion of people were like me, it wouldn’t be worth the change. But clearly, that’s not the case.

I am curious if this really bothers a high proportion of people, or you are just getting the noise of a vocal minority while the rest of us sit back and watch.

15 Likes

Indeed, I do worry about that. It’s one reason we didn’t just “fix it” immediately (a few people have claimed it’s a bug) and have to be quite cautious.

4 Likes

This post was deleted by me.

1 Like

As an observer who doesn’t feel particularly invested in the global scope issue, to me it does seem that this has gone rather off the rails. It sounds pretty simple to me: everybody agrees that the code behavior should not depend on the enclosing scope, according to the constraints that @jeff.bezanson laid out in the start of the other thread, we will get there as soon as semantic versioning allows. I’m not really sure what it is people are getting so upset about. I agree that the devs were a little overzealous in releasing 1.0 so soon after 0.7, but really, it’s over now, most stuff runs on 1.0 now, why continue to discuss the release schedule of 1.0? It really wasn’t that big a deal.

One thing I find very peculiar about this conversation is the number of people who seem to be arguing based on what code will look good in a lecture slide. Not only does that seem like a bizarre argument, but it seems contrary to what I find to be the prevailing attitudes of the community regarding any other topic. Fortunately, I feel no need to counter that argument and I’m not going to get involved in it since I agree with the desired result.

So I think everybody agrees about everything. Let’s relax :slightly_smiling_face:

16 Likes

This post was deleted by me.

Maybe you want to come back again? It’s ok to just step away for a while, when feelings are running hot :slight_smile:

13 Likes

I wouldn’t worry about people laughing if I thought it was really the right thing to do. The 0.7-1.0 transition was also very clearly a one-time thing, intended from the beginning (and communicated as such) not to be repeated.

I really don’t think that’s necessary. Please just stick around, and we’ll all get where we’re going eventually :slight_smile:

8 Likes

This post was deleted by me.

Maybe there should be a poll? This would give a hint of how much user code (as opposed to package code) is actually affected by this. Many users are not even aware of the issue … we are just enjoying Julia :slight_smile:

1 Like

Polls are the utter worse way to do decision making in open source.

If we want to find out how much code we break we can test the entire ecosystem.
Or a statistical sampling of it.

But end of the day a decision really comes from core devs taking in feedback and other information and giving consideration based on there experience and expertise.

Not us, semi-informed randoms

We must trust the people we trust.

10 Likes

I really agree here! The core devs have listened to the users’ concerns and there is no perfect solution. I trust that they will make the right choice here!

FWIW, I like the new scoping behavior in 1.0 very much: I think it is clean and consistent, and I don’t think that it would be a problem in practice in a pedagogical setting (on the contrary, I think that becoming informed about globals at an early stage is important, as they are a source of many performance gotchas).

But I don’t feel like repeating this every time there is a thread/discussion about this.

16 Likes

I agree. The new rules are clear and easy to understand.

I also don’t have an issue with teaching / learning scoping rules. I learned Pascal 30 years ago. It is a language developed to teach good programming, such as it was back then. One of the first things we learned was scoping. We were a bunch of high school kids and nobody had a melt down because they had to learn scoping rules. Maybe some nervous ticks, but no melt downs.

This month I’ll be teaching an introductory course in Julia at work (a bunch of engineers, but mostly not active programmers) and I have no issue teaching them to add the odd ‘’‘global’‘’ here and there.

I would like to see the REPL behave the same as scripts do. This is because I use the REPL as my primary debugging tool by selecting blocks of code in Juno and executing them as I step through the code. Honestly, I have not even checked if this specific issue is even applicable in this case. I just believe in general it would be better to get consistent behaviour between the various ways of using Julia, including Jupyter.

How that consistency is achieved, I am more than happy to leave to the core devs. Clearly they are light years ahead of my own knowledge and ability here.

7 Likes

Same here. Also, from some discussions it is easy to get the impression that #19324 was a horrible mistake that can be and needs to be fixed ASAP. Instead it was a solution to a difficult technical problem with various trade-offs, and the change (if any) will almost certainly involve some, too.

It would rather wait to see how the community adjusts to the solution as is for a while. I remember the reception of * for string concatenation: some were resisting it very vocally, but he issue is now mostly forgotten as a problem.

6 Likes

I also 100% trust the core devs to come up with a good solution here, as a few good alternatives were sketched out already. I also think it’d be really important to have a good communication on the path forward, meaning explaining it thoroughly as soon as there is a final decision: in terms of teaching Julia, one would have a different approach explaining the new scoping depending on whether it’s set in stone or will change in Julia 1.3

3 Likes

A funny thing that I stumbled into just yesterday, which I suspect is directly related to the scoping rules in Julia.

Working on my Algorithms assignment I was asked to calculate the time and space complexity of this code:

int main(int n) {
  int r = 0;
  for (int i = 1; i < n; ++i) {
    i--;
    r++; 
  }
  return r;
 }

Here, for n > 1 the for loop never exits.

Obviously, my first instinct was to implement the algorithm in Julia to analyse it. But the thing is, in Julia the for loop works differently, and it exits just fine. I tried various changes in order to get access to i, but I couldn’t get the for loop to behave like the one in C.

function main(n::Int)
  r = 0
  for i in 1:n
    i -= 1
    r += 1
  end
  r
end

Got me thinking a bit that I couldn’t represent the algorithm – as I must say I was a bit disappointed that I couldn’t use Julia for my assignment and had to go back to PHP :slight_smile: :blush:

This has nothing to do with scoping but how a C-loop is defined.

In Julia, you would write the equivalent of the C-code as

function main(n::Int)
    r = 0
    i = 1
    while i < n
        i-=1
        r+=1 
        
        i+=1
    end
    return r
end

What you have in your original Julia code is like the C++ style of a range loop Range-based for loop (since C++11) - cppreference.com.

2 Likes