Why isn't ArgParse.jl part of Base?

The ArgParse package seems to work great, but it’s such an essential feature (maybe even more essential than Distributed?) that it seems weird not to be in Base.

My hunch is that since a lot of us use julia for scientific computing rather than systems level work, command line invocation tends to be very specialized (example in Background, below), therefore a more generic command line API is considered less essential than it is for eg python, c?

Background

I mainly develop julia in VS Code (thanks @davidanthoff et al for all the amazing work on this!), so I only do the following:

>julia <myscript>.jl

when on hpc. In this context, sbatch automatically populates the environment with info (eg ENV[SLURM_JOB_ID]) that makes it possible to structure function calls over job array indices. Therefore I’ve just defaulted to getting command line info from ENV[<my bash param>], which is working great.

In my opinion, there are clear reasons to maintain as much as possible as external packages.

  • First, the evolution of external packages is much easier if they are not in Base.
  • Second, alternative packages could be proposed more easily if there is not “official” package (puting in Base will do it the official way of working for many people).
  • Also, insert more functionality to Base implies to add more code for everyone, and many people could not be interested.

To summarise, it is normal to think that our favourite packages should be in Base, but because the Pkg work so nicely, it does not give real advantages, but only drawbacks. Only could be considerer to add packages to Base if it were very stable and with a clear basic functionality. But I think it is rarely the case.

7 Likes

Thanks @dmolina! This is a relief because honestly part of me just wanted to test if anyone replied like “ArgParse was more of a 1.3 thing, and is now deprecated, use ArgParse2 instead”, as I franticly revise all the ArgParse stuff I just wrote this morning, haha

Also, for many simple scripts, ArgParse induces too much overhead. I wrote a lot of scripts in Julia (trying to replace Bash in many cases), and outside of my largest and heaviest script (that is basically a fully fledged program at this point) I do not use ArgParse because it often takes more time to compile+run than the rest of the script will take to compile+run. ArgParse not being in Base allows for not having “one official solution” and people can use the argument parser more adequate for their script level of complexity.

4 Likes

+1 on the overhead point. There are lighter weight parsing libraries like ArgMacros (disclaimer, written by me) and Comonicon by Roger Luo which can do the job for simpler cases. The extra functionality of ArgParse is nice but as you said scientific computing usually doesn’t require the most robust CLI handling in basic scripts, so its extra weight is often not worth it.

6 Likes