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
Suggestion: Require a Julia Header with Version in Shebang #29640
Comments
No. The majority of such changes will be impossible to support this way (or they won't/shouldn't be a breaking change in the first place). And any such backward compatibility can be provided by macro/function wrappers (similar to
is the correct solution, since packages are semantically significant.
Just use |
And as a even bigger 👎, this is not what |
elaborate? |
Which part? |
oh, I see. The rest of the shebang line is also interpreted. So, change this to but there is a real problem here. I write a user program in 2018 to analyze my data. the program is not a package for use by others. In 2028, someone asks me for the program that produced my Nobel-prize winning thesis on astrology. I bet that julia programs that are written today will no longer run under julia 2028. I won't remember what the prevailing julia version was for my program. Did I write it under 0.6.3? Under 1.0.0? 1.0.1? Having a near-mandatory mechanism to designate the julia version under which a program is supposed to be able to run is very useful. In LaTeX, they did this (belatedly) with documentclass and documentstyle. In Perl, they have something like 'use v5.6.1`. I don't care about exactly how this is done, but without a standard mechanism to designate the code compatibility of code today, few users will put it into the code today. The julia developers will need to be more paranoid about breaking 1.0.0 compatibility for end users. Many users will curse any changes of julia in the future that might break their old programs (which they will not have touched in years, and do not want to check everytime the version increases). with a .jl file designation, end users could at least download old julia versions to run their programs. there were fewer screams in latex2e, because latex is smart enough to understand that documentstyle code is supposed to run on a "relic" latex. R has fewer problems, because it is now more stable than julia. Julia will still be changing quite a bit. /iaw |
No, that doesn't help.
It should still run under
I never, ever find that an issue, with document and version control. (e.g. saved command line (potentially in shebang) to run the script, date of creation etc.)
As I said, that's just impossible for most features.
Then just download the old version of julia.
This is very good.
Without it, end users can still download old julia versions.
Well, the two systems are completely different in complexity. They are not comparable at all.
Not being a package really doesn't stop you from doing anything. Also, everything you mentioned above are strictly only for scripts that you run directly without any consideration on multiple files. If that's your usecase, just put I'll just repeat that you are proposing a solution to a non-problem, in a way that wouldn't work due to the complexity. It's wrong both in the object it is applied on (file, rather than module/package) and in that you are comparing a full programing language that is designed to be extensible to other languages that are much closer to data files than a language in this metric. Data files, of course, is very easy to have version dependent behavior but any direct interaction between code in a programing language will just expose the version dependency to the user with no way to hide it at all. |
with respect, how often have you been asked to explain a paper that you wrote 30 years ago? I think you underestimate the seriousness of the problem of preservation of scientific programs that were used only in your own project, and that a graduate student now wants to check, possibly even for integrity. of course, nobody stops you (or me) from taking all necessary precautionary steps today. I am only suggesting a crutch. some of the pain in moving from 0.6.3 to 1.0.0 in packages shows how difficult a small transition without indicated version numbers was, and this even for packages that were designed from the outset to be shared by others. now try the same thing for julia code written in 0.6.3 when we are in 5.0.0, for code that you wrote not for sharing, and often not even with great documentation, but to solve your problem as quickly as possibly. /iaw |
Isn't the solution to the problem of Julia being v5.0.0 and your code only working on v0.6.3 that of documenting the environment in which your script runs in your published work, and, as mentioned above, keeping the previous versions of Julia available? After all, many things about your environment can affect the output of any given script, but Julia v0.6.3 is as close at hand your git repository and
|
Well, that was before I was born so none. However, I have had need to run code from years ago and with version control of my code, that is never an issue.
Well, I fully appreciate that. And I don't think your statement of the problem is correct and neither is your solution. All papers I've seen that provide code also give a full description of all relavant info (version, system, even OS sometimes) to run the program. Any less than that the code is useless anyway. For non-published code, that's why lab notebook exist and that's exactly how we use it.
None of what you suggested will help with that. Breaking change that are hard to fix won't be easier for the compiler. They are hard exactly because they can't be fixed automatically. So yes, the pain shows that what your suggested is not useful.
Again, running the code with a flag and expect it to work under 5.0.0 is impossible. No matter what feature you add to the language. If you want it to be possible, that you are giving the developers much less freedom to introduce breaking changes. Excatly what you want to avoid, i.e.
And yet again, downloading 0.6.3 should be possible. Since it's a pre-release, a pre-compiled binary might not be available for download in years, though as mentioned above, nothing you can do to the new version of the language will ever help. |
Reproducibility is done by providing a Project + Manifest file. This already takes care of recording the exact version of all the packages that are used which is just as important as the julia version. We just need to record the julia version as well. Feel free to open an issue on Pkg.jl about this. |
And as for why requiring a flag like this won't really help, your argument for making it mandatory is basically to combat human laziness, yet the solution isn't lazy-proof. I bet if this is required, people that don't feel like testing will just copy-and-paste I know this because this is exactly what happens in |
yes, they are all crutches and they all are designed to help combat human laziness. and they never succeed fully. with respect, you have some good points; but you also display a confidence in knowing the correct perspective--not on technical matters but on scientific needs and matters--that is astounding. you have never had to deal with these problems and thus could not have developed so profound a perspective on the human tradeoffs with code. I cannot speak for all scientists, either, but I can speak for some of them in my neck of the woods. you may speak for some in your's, but not for all. |
It IS a technical issue that I'm talking about. It's the selection of tool and using the right tool to do the right thing rather than partially duplicating functions everywhere.
And I've given examples for all my claims. In case it's not clear, I've also acknowledged the issue with running old code and only have problem with the tool you use in this case. If there's any case where a (fully) versioned controlled and (partially) documented code base not providing enough information to allow the user to easily guess what the version of the language being used is, I'd be interested to know. (I said "guess" since I've used commit date to narrow down the version info to 1 or 2 a few times.) |
apologies. my tone was a little too sharp, too. |
There's definitely a problem to be considered and an potential idea for a solution here. What you want to be able to do is to declare that a certain bit of code should be interpreted according to the rules of Julia 1.5 or something, and then be able to use it with code that's using other rules. One way to accomplish that is to have newer Julia versions—say Julia 2.1— know how to behave as if they were older versions of Julia like Julia 1.5. The massive downside to that is that you have to drag along all the code needed to implement the behaviors of older versions and test that entire combined language surface. We deleted some 16,000 lines of code when we got rid of the deprecations from 0.7 in 1.0. And that was only from a single release. Imagine how much extra junk we'd be carrying around across many different major versions? I really have no inclination to maintain that mess. There are other potential ways to support this, however. If we had a separate compilation model—and this would require two different modules (or whatever unit we would want) being able to collaborate through some protocol to generate efficient compositional code—then, as long as two different Julia versions agree on their calling conventions and composition protocol, you could compile them with different versions of Julia and still get a correctly working result. I think there are a few problems with this specific proposal:
I do think that saving the Julia version in the |
hi stefan---my specific suggestion (as yichuan pointed out) where indeed terrible. but the problem is real. I would not drag along the old julia compiler, but keep the old julia compilers on the website. so, I would not keep this as a first-class feature, but as a second-class feature...presumably as a last resort when user code has broken a long time ago without anytime noticing. (continuously used code is typically updated fairly soon.) again, this is not for me (I already have the checks in my own startup.jl, which I do with:
the whole idea is to plan ahead to make it easier for you to deprecate features in the future and face less wrath by your users, because they can backtrack. |
If what one wants is per-process Julia versioning then I think that the manifest file is the right place to record this information. That's already where we store all the precise versioning information for packages, so it's a natural place. |
https://discourse.julialang.org/t/suggestion-julia-version-header-in-jl-files/16316
strongly suggest a header in .jl files that indicates the version under which the file is running. issue a warning if this is not the first line in the .jl file. I would suggest
where the first version on which this .jl was tested on is 1.0.0 and the last version is 1.0.1.
In the distant future, such a requirement will help you by making it easier for you to deprecate and break features without incurring the wrath of every user who has ever written a julia program. I understand that packages have some REQUIRE aspects already, but this is different. the shebang line should be in every .jl file, user or packaged.
a secondary minor advantage is easier recognition for unix
file
.regards,
/iaw
The text was updated successfully, but these errors were encountered: