Warning in 1.0 +?

Is possible switch ON Warnings: in Julia 1.0 and higher like was in 0.7 ? :

julia> sum(rand(10,10),1)
┌ Warning: `sum(a::AbstractArray, dims)` is deprecated, use `sum(a, dims=dims)` instead.
│   caller = top-level scope at none:0
└ @ Core none:0

Paul

The deprecation warnings of 0.7 are only available in 0.7, so no, there is no possibility to achieve this in 1.0. (0.7 is actually 1.0 + deprecation warnings)

It’s very bothersome for non heavy heavy users. It’s very bothersome for non heavy heavy users
I switched from 0.6 to 1.0 and must go back to 0.7. Think about the many many users who work every day. They will go to Python
Paul

Is there a performance cost to reporting warnings?

You don’t “have to” go back to 0.7. If anything, you should see Julia 0.7 as a convenience tool for porting your code more easily from 0.6 to 1.0.

2 Likes

I don’t know, but it could be an option!
I work on 0.7 which has a lot of problems and I can’t jump on 1.3 and more because I don’t know what is wrong in the code: /
How can I know which 0.6 parts of code are bad for 1.3 if not WARNING?
Paul

That’s precisely what Julia 0.7 is for. Take your code, run it with 0.7, and fix all the deprecation warnings. If your code works with 1.0 it also works with 1.3.

2 Likes

Deprecation warnings can cost performance, but I think the split between 0.7 and 1.0 was done to signal a clean start.

1 Like

I imagine that there is a spectrum of people between “heavy users” and those who switch to Julia 1.0 18 months after it was released, with 1.4 around the corner.

Good for them! Everyone should just use the language they find the most convenient.

I just wish people stopped using this argument whenever they encounter some minor inconvenience. It is unlikely to get them what they want, but may just lead people to ignore the whole discussion.

13 Likes

Makes sense. The deprecations I have seen are all pretty painless thus far. So its never been a big deal to just fix them. I wouldn’t switch languages over the fact that the language I was using improved, and I didn’t want to improve my code base. If it were that easy to start over in another language, it’d be 100x easier to just fix the warnings?

When I see “no possibility” regarding Julia, I pause. It seems everything is possible, in theory. Maybe it’s not a good idea to make a package to enable this possibility, but the OP probably could. I’m not even sure it’s too difficult. Another possibility, I brought up in another thread, was make it possible to call old Julia versions (like you call Python, e.g. through Polyglot.jl, I looked a bit into doing this). The downside brought up was old code might never get migrated then.

You’re right, “no possibility” should be extended to mean without any simple built in options. The deprecations were deliberately removed in 1.0, because otherwise, people would have written grumpy posts on the day of the 1.0.0 release that Julia can’t be a good language if they have deprecations on day zero.

And I wouldn’t go through the pain of trying to integrate an unsupported version of a pre-release language. Just porting code using 0.7 would be a better way to deal with the legacy work.

2 Likes

I’m not sure I understand the complaint. If I have some code that works for Julia 0.6, and I run it with Julia 0.7 to produce deprecation warnings, it should actually fail with an error on Julia 1.0, right?

3 Likes

Warnings in 0.7 are VERY USEFUL for both new and fear users. Experiences of advanced users have nothing to do with it. Why can’t they be an option in new eversions?

A simple example:
If I do not know that there is a Statistic(s?) package, then for user ‘mean’ does not exist in Julia

julia> mean(rand(10,10),1)
ERROR: UndefVarError: mean not defined
Stacktrace:
 [1] top-level scope at none:0

help?> mean
search: SegmentationFault macroexpand @macroexpand @macroexpand1 Meta numerator enumerate timedwait

Couldn't find mean
Perhaps you meant map, max, min, atan, read, real, tan, Real, Meta, merge, Main, map!, mark, mod, mod1 or modf
  No documentation found.

  Binding mean does not exist.

Perhaps you meant … max, min… but never mean ;/ my goodnes :wink:

Paul

Let’s see what happens in python…

4 Likes

:wink:

Search the julia documentation rather than the REPL. https://docs.julialang.org/en/v1/

These points were discussed in detail at the time when Statistics was moved out from Base. If you are interested, please look them up in the archives. There is very little point in restarting them 2 years later.

There is detailed advice on upgrading to 1.0, with

as a good starting point. Please respect the effort that people have put into these things by reading them first and following the advice there.

4 Likes

I work on 0.7 which has a lot of problems and I can’t jump on 1.3 and more because I don’t

uhhh, I do not understand. First, which problems 0.7 has? It should be basically equal to version 1.0 but with those warnings enabled, and 1.0 is the long term support version (it is the one I use to develop and most packages support it). You actually need the features of 1.3 or 1.4 in your code? If you do not, then I am not aware of any problems in developing using 0.7 until you feel confident in using versions 1.x.

If your code is valid 0.7/1.0 code, but you want to run with 1.x because of some optimization, then you may have multiple versions of Julia in your computer. You may have 0.7 and 1.3 installed, for example, and create links to them in your path as julia0.7 and julia1.3 and call the 0.7 version to check your code and the 1.3 to make use of any speedup improvements.

2 Likes

What you may be missing is that some things were deprecated so that the syntax can be reused for something else. So it is not possible to give warnings in later version, because that syntax is now valid.

An example is range, see

for details.

4 Likes