Revise 2.3.0: improved safety and performance, new features

I’m pleased to announce the release of Revise 2.3.0. This is a major update with sweeping changes. In brief, it aims to capitalize on the advantages of the redesign introduced in Revise 2.0 while also mitigating or eliminating the most serious problems of that design.

Major changes:

  • The most fundamental change is a much-improved internal analysis of source code. This is leveraged to robustly differentiate between “statements that contribute to defining methods” and “code that ‘just’ does work.” Method-defining code is run in the interpreter, as is necessary to compute method signatures which serve as a relocatable identifier for methods. Work-performing code is now either not run at all (if Revise is just parsing an already-loaded package to extract expressions and their corresponding method signatures) or run by the compiler (for, e.g., includet). This should solve many problems:
    • it should improve performance if you includet files that contain a mixture of method definitions and computation-heavy analysis code
    • it should improve performance for packages that do significant top-level initialization
    • it should be much safer, largely or completely resolving concerns I raised in my JuliaCon 2019 talk regarding double-evaluation
  • It switches to an O(N) algorithm for renaming frame methods to match their running variants (note breaking changes in LoweredCodeUtils). This probably affects very few packages, but for those that generate large expression blocks with many methods the performance improvement is dramatic.
  • Revise now supports addition and deletion of source files. Hands-free integration with Requires.jl should also come soon.
  • It significantly improves handling and printing of errors. The error messages are now more consistent, more informative, and much shorter.

Such major changes introduce multiple risks; for example, implementing file-deletion means that all methods defined in that file get deleted. If I’ve gotten, say, the path logic wrong and Revise mistakenly thinks you’ve deleted one of the stdlibs, rather bad things will happen to your session :laughing:. As always, please report any problems you encounter as issues with a reproducible test case, and I will try to fix them. If this isn’t already an improvement, after a few cycles of bug fixing it should be a welcome upgrade for almost all users.

59 Likes

In SemVer major updates increments the first digit, not the second one.

1 Like

It’s major in the sense of a major improvement. There’s nothing exported that’s breaking.

7 Likes

Of course, you will decide yourself your package version numbers. This is just my friendly attempt to point out that you have written yourself that this upgrade likely causes breakage.

And to add I am not expecting any changes maybe just a good learning opportunity for whole community.

1 Like

It’s not likely breakage, it’s possible breakage. The 3000 lines of test code in Revise go a long ways towards catching problems. I just want people to be aware that a x.x.0 release could have unexpected bugs that should be reported.

By analogy, Julia 1.2->Julia 1.3 reworks many of Julia’s internals and thus has the same potential risk for problems that I cite above. Anytime you make fundamental changes you might introduce bugs.

Give it a whirl and see if it causes problems. No new bugs reported yet :smile:.

13 Likes

Tim means breakage due to bugs (because of the big rework of internals). Only breakage due to API changes need a major version increase. Note that the latter is an intended breakage.

10 Likes

Started to use Revise…

:+1:

Thanks for this ingenious tool!

2 Likes