Packages all should use, all the time (at least be aware of), to combine in one superpackage: Julia2.jl

I’m thinking of a curated list of packages, that (almost) all can agree on, to bring up to syntax-parity with e.g. Python (which has e.g. pattern matching), and so new users do not have to discover these packages for themselves. I’m not thinking of packages, such as Revise.jl, here, only helping development, but those for all to use at runtime, even hopefully in short-running scripts.

I’m ok with the package having some breaking changes, i.e. from the Julia 2.0 milestone. I’m thinking it would imply similar to Python’s from __future__ import, for all the stuff all can agree on anyway, thus an opt-in way to prepare for Julia 2.0 (the package would work identically in 1.x and 2.x).

Alternatively, the package could be a simple meta-package, only containing one long using statment, not adding (or dropping) 2.0 stuff, or messing with the included packages.

It’s likely a requirement the packages be at 1.0+, so e.g. DataStructures.jl is out (also not clear it should be on the list, anyway). I feel however justified that OrderedCollections.jl should be there for OrderedDict (Python’s, by now, default for their dictionaries).

This idea is sparked by e.g. most recently announced:

@fredrikekre With it a drop-in replacement for @enum and better, people shouldn’t have to search for alternative (or missing) “syntax”, already there in Julia. I don’t really know it that package could have overridden @enum in Base with its implementation. Even though that package doesn’t, Julia2.jl could. I’m not a huge fan of Julia codebases having inconsistencies, some using @enumx or other alternatives that exist, to stuff already in Julia (my exception is for Dict, but about semantics, not syntax).

For some reason the code is shorter at 165 lines than the code in Base at 225 lines: julia/Enums.jl at master · JuliaLang/julia · GitHub

If we can actually redefine what Base gives you then I (maybe controversially) suggest:

const Dict = OrderedDict
const UDict = Base.Dict # shorter than having to type UnorderedDict

My short-list of packages to include (what more?):

  • Match.jl
  • OrderedCollections.jl
  • EnumX.jl

See also my older (most answers where on development packages, or e.g. CSV.jl that not all would use, and is too heavy to include):

Could we also remove stuff from Julia in this package?
I’m thinking of from 2.0 milestone:
stop exporting HTML and Text from Base · Issue #29841 · JuliaLang/julia · GitHub and deprecate <<, >>, >>> on BitArray · Issue #30958 · JuliaLang/julia · GitHub

Even though I wish possible, some (parser) things can’t be changed(?) in a package: Parse 1 + 2 + 3 as +(1, +(2, 3)) · Issue #34999 · JuliaLang/julia · GitHub and .|> should have lower precedence than -> · Issue #38761 · JuliaLang/julia · GitHub

2 Likes

I was a bit intrigued finding a stdlib module Future in Julia. Maybe it could handle the Julia 2.0 part of my proposal.

It has only two functions, one already deprecated (or isn’t it already?) and seems the other randjump (because MersenneTwister is no longer the default and will go away in 2.0) should be too. What is this module for, i.e. which future does it refer to? Seemingly later 1.x; and/or Julia 2.0?