Skip to content

Maturing out the package (Path to DataStructures.jl v1.0) #479

Open

Description

@oxinabox

What do we need to do before we would be happy to tag DataStructures.jl v1.0?
I mean, we are one of the most common dependencies in the package ecosystem,
and julia 1.0 is out.

My thoughts;

It hurts people when we break things, and while we are good at deprecating,
getting on the the "strict" side of semver is something we need to do for the sake of the ecosystem

Activity

  1. pinned this issue on Jan 9, 2019
  2. oxinabox commented on Aug 28, 2020

    @oxinabox
    MemberAuthor

    People keep asking when will DataStructures 1.0 come out.
    The answer is as soon as we completely audit the package to make sure there is nothing that needs to be removed/corrected to follow modern julia conventions.
    And have actioned those corrections.
    A lot of the code in the package is pretty old, and follows e.g. conventions from julia 0.3.
    We need to identify and correct these.

    I will post a list of files at the bottom of this post.
    Then people can go through this and use the checklist to make sure everything is good, one file at a time.

    How to audit a file to check if 1.0 ready

    • Answer the question of should we even keep this in the package. E.g. no data structure that somone just kind of made up (like the now removed `Classifier Collection). If ours is is a worse version of something in another package it should also go.
    • Type Names Correct/Sensible: for example make sure we don't have a type called MagicVectors that is a subtype of vector. That should be called MagicVector (singular).
    • No constructors taking types as positional arguments. For example there should not be MagicVector(::Type{T}) where T, instead there should just be MagicVector{T}().
    • No functions that duplicate constructors. For example there should not be a function magic_vector(xs), only MagicVector(xs).
    • No functions that are improperly cased and pretend to be constructors.
      • E.g. no MagicVector(xs) = Vector(xs) .* "Magic", that should just be a normal function magic_vector(xs) = Vector(xs) .* "Magic"
      • E.g. no MagicVector(xs)=Vector{Magic}(xs), that should be a const type alias const MagicVector=Vector{Magic}
    • No exported functions that could be just done with overloads of Base. E.g. don't need top, peak, head all of which act the same as first but on a particular data structure.
    •  No internal helpers exported. If something isn't useful to the end user it should not be exported. In general The vast majority of the public API should be constructor or overloads of Base functions. Thus any export should be looked at closely.
    • Correct return types push! and empty! and delete! should return the collection. (this is relatively minor as it would be a bug if they didn't so it isn't breaking for use to fix it later.)
    • No defining methods in ways that disagree with Base: for example because Base has insert!(xs, index, value) we should not have no instert!(xs, val) (push! is for that). Conversely we should not have push!(xs, key, value) ( we dio both of these right now in various trees, and in accumulators respectively)

    All these things are things that have changed during the life-time of this package.

    List of files that need to be checked

    (Checking each will also require checking the top-level file for relevant exports)

    • accumulator.jl
    • default_dict.jl
    • robin_dict.jl
    • dict_support.jl

    • trie.jl
    • balanced_tree.jl
    • circ_deque.jl
    • circular_buffer.jl
    • dibit_vector.jl

    • disjoint_set.jl
    • fenwick.jl
    • int_set.jl
    • sparse_int_set.jl

    • list.jl
    • multi_dict.jl
    • mutable_list.jl

    • deque.jl
    • queue.jl
    • stack.jl

    • sorted_dict.jl
    • sorted_multi_dict.jl
    • sorted_set.jl
    • tokens.jl
    • tokens2.jl

    • priorityqueue.jl
    • heaps.jl
    • heaps/arrays_as_heaps.jl
    • heaps/binary_heap.jl
    • heaps/minmax_heap.jl
    • heaps/mutable_binary_heap.jl

    • container_loops.jl
    • delegate.jl

    Many of these should be easy, because they have kind of already been done.
    E.g. Heaps were done for 0.18; robindict was created after julia 1.0 and so should follow conventions.
    But lets get them all and check them off using the list criteria listed above.

    Higher level process:

    0.19 will be the last release before 1.0.
    0.19 will be the same as 1.0 but with deprecations.
    1.0 will come out the same day as 0.19

    We will stick to making patch releases on 0.18 with deprecations while we can.
    But once we can't we will swap master to 0.19-DEV, and say on that until we can release it and 1.0.
    That might take a 6 or more months; depends how many (if any) people are about to spend time helping with the audit.
    If necessary we will have a backport branch for 0.18 bug-fixes

    Once @eulerkochy's GSOC work is complete we will not accept any new data structures until after 1.0 released.

    If anyone want to help out, please feel strongly encouraged to do so.

  3. nickrobinson251 commented on Aug 30, 2020

    @nickrobinson251
    Member

    No exported functions that could be just done with overloads of Base

    How about reverse_iter? Can this just be Iterators.reverse? The only issue i see is that reverse_iter(s::Stack) returns a DequeIterator, not a Iterators.Reverse, but idk if Iterator's API is really supposed to guarantee Iterators.reverse(::T) -> Iterators.Reverse{T} or not. (edit: no it's not, that's why we have reverse, rather than just Reverse, so we don't have to guarantee returning a Reverse)

  4. nickrobinson251 commented on Sep 4, 2020

    @nickrobinson251
    Member
    • No exported functions that could be just done with overloads of Base.

    • No defining methods in ways that disagree with Base

    I think this suggests we should make a call on which side this falls: #296

  5. added this to the 1.0 milestone on Sep 4, 2020
  6. StephenVavasis commented on Dec 31, 2021

    @StephenVavasis
    Contributor

    Could anyone explain in more detail the above-mentioned recommendation regarding the insert! function? In particular, does the recommendation mean that insert!(ss, k), where ss is a SortedSet and k is a new key, should be deprecated? Note that push! does not replicate this functionality because insert!(ss,k) returns a bool to indicate whether the item was already present and a semitoken indexing the newly inserted item, whereas push!(ss,k) returns the container.

  7. oxinabox commented on Jan 11, 2022

    @oxinabox
    MemberAuthor

    Could anyone explain in more detail the above-mentioned recommendation regarding the insert! function?

    Base defines insert! as:

    insert!(a::Vector, index::Integer, item)

    Insert an item into a at the given index. index is the index of item in the resulting a.

    and it returns the collection.

    In particular, does the recommendation mean that insert!(ss, k), where ss is a SortedSet and k is a new key, should be deprecated?

    yes, it doesn't match the description of the Base function.

    Note that push! does not replicate this functionality because insert!(ss,k) returns a bool to indicate whether the item was already present and a semitoken indexing the newly inserted item, whereas push!(ss,k) returns the container.

    Yeah, so in that case we can't deprecate it for push!.
    We would need to make some other plan.
    Like st_push! or something? or a submodule that defines a bunch of function names for things that return subtokens?
    Maybe a case could be made for push!(::Type(SemiToken),::SortedSet, x) or something?

  8. StephenVavasis commented on Jan 12, 2022

    @StephenVavasis
    Contributor

    Here is a more serious conflict with Base: according to the Base docs, pop!(s) is supposed to return the last item in s if s is an ordered collection. However, pop! on the sorted containers currently returns the first item. Which is the lesser of two evils, a breaking change for the package or doing the opposite of the Base documentation?

  9. StephenVavasis commented on Jan 12, 2022

    @StephenVavasis
    Contributor

    Maybe deprecate pop!(s) for sorted containers to popfirst!(s), and introduce new functionality poplast!(s) (the latter not present in Base)? Then, several years in the future, deprecate poplast!(s) to just pop!(s)?

  10. oxinabox commented on Jan 12, 2022

    @oxinabox
    MemberAuthor

    Maybe deprecate pop!(s) for sorted containers to popfirst!(s), and introduce new functionality poplast!(s) (the latter not present in Base)? Then, several years in the future, deprecate poplast!(s) to just pop!(s)?

    yeah this, sounds right.
    but I would argue for putting a deprecation warning in poplast! in 0.19 as it is defined saying this will just be pop! in 1.0, which will be released not years in the future but rather days.

  11. StephenVavasis commented on Jan 12, 2022

    @StephenVavasis
    Contributor

    Doesn't this approach for deprecating pop!(s) mean that everyone who upgrades from 0.18 to 1.0, skipping 0.19, will encounter a breaking change that is also silent?

    With regard to renaming insert!: since insert! currently has a different API for each of the three containers, how about if we choose the three names ss_push!, sd_push! and smd_push! ?

  12. oxinabox commented on Jan 12, 2022

    @oxinabox
    MemberAuthor

    Doesn't this approach for deprecating pop!(s) mean that everyone who upgrades from 0.18 to 1.0, skipping 0.19, will encounter a breaking change that is also silent?

    yes, that is what they get for skipping versions. But we will write release notes etc.

    With regard to renaming insert!: since insert! currently has a different API for each of the three containers, how about if we choose the three names ss_push!, sd_push! and smd_push! ?

    Lets split this off to another issue or a PR and we can think about our options.

  13. StephenVavasis commented on Jan 12, 2022

    @StephenVavasis
    Contributor

    OK. I am currently working on a major overhaul of the sorted containers to address a number of open issues at once. I will include these new names in my forthcoming PR; and then you or another reviewer can comment on them.

  14. 6 remaining items

  15. ChrisRackauckas commented on Sep 2, 2024

    @ChrisRackauckas
    Contributor

    You went from v0.12 to v0.18 in the span of 2 years (some of those shouldn't've been marked as breaking probably?), and now this one is 5 years in the making. There's a middle ground.

  16. fingolfin commented on Mar 17, 2025

    @fingolfin
    Member

    I would generally support taking the plunge and getting master release as 1.0...

    Except that of course due to semver's limitation it will probably be a long and arduous treck to get everyone switched to 1.0: Essentially for package like this with soooo many other package depending on it, a breaking release risks re-creating the python 2->3 problem each time.

    To avoid this, I think the most critical bit are thorough release notes that describe what exactly are the breaking changes, ideally including recipes for how to deal with them.

    And possibly encouraging downstream packages (i.e. packages depending on DataStructures.jl) to try and support both 0.18.x and 1.0.x in parallel, at least for a while, to minimize suffering ("my dependency A still requires DS 0.18, but dependency B only support DS 1.0, so I need to keep B at an older version until they change that").

  17. AzamatB commented on Mar 23, 2025

    @AzamatB
    Contributor

    Can we tag a new release of DataStructures.jl? I need to use a non-string version of the Tries, which has been added ~4 years ago, but it is still not in the latest version for some reason. It does not need to be 1.0. It can be just 0.19 or something.

  18. oxinabox commented on Mar 24, 2025

    @oxinabox
    MemberAuthor

    We probably should. It would have been nice to hold off to proper 1.0 was ready but it isn't going to happen anytime soon.

    Maybe just 0.19

  19. jonas-schulze commented on Mar 24, 2025

    @jonas-schulze
    Contributor

    See #769

  20. AzamatB commented on Mar 24, 2025

    @AzamatB
    Contributor

    Can we get #933 merged before tagging the new release?

  21. stevengj commented on Mar 26, 2025

    @stevengj

    Maybe just 0.19

    semver will also treat this as breaking, so I don't see any advantage in marking a new release as 0.19 vs. 1.0. Whereas 1.0 has the advantage of providing strictly more information to downstream users for subsequent 1.x.y releases.

    670 packages already depend on this package. Not using 1.x releases actively harms their ability to keep up with non-breaking updates.

  22. StephenVavasis commented on Mar 30, 2025

    @StephenVavasis
    Contributor

    There was a plan with @oxinabox regarding the corner of this package that I maintain (the sorted containers) to, in one release, deprecate some of the functionality that corresponds to Base functionality but with different names or API details, and then, in a subsequent release, drop those inconsistent names or APIs entirely. See: #787 This conversation took place three years ago, so my recollection is a bit fuzzy.

  23. AzamatB commented on Jul 15, 2025

    @AzamatB
    Contributor

    Can we please tag a new release of DataStructures.jl?
    I don't care if it's v. 0.19 or v. 1.0 at this point...

  24. Krastanov commented on Jul 15, 2025

    @Krastanov
    Contributor

    If you prepare a release branch, that probably would happen, but a volunteer needs to do the work. My guess is that:

    • if you backport non-breaking stuff to 0.18 and prepare a branch with what you need, a release will be done without much discussion
    • if you finish all of the work required for a 1.0 (a lot of work!!!) a release will be done without too much discussion (but with a lot of praise from the rest of the community)
    • if you want a breaking release of what is basically the current state of the repo, that would not be much work. However, reading through this thread there might be some opposition to this approach (although I would be on favor)

    The main thing that is lacking is someone to do the work in all of these cases.

  25. oxinabox commented on Jul 16, 2025

    @oxinabox
    MemberAuthor

    Honestly i am infavor of option 3.
    But yes it is just lacking someone to do that work.
    E.g. even for 3 we would want to prep some release notes,
    and at this point it would require detective work.

    Re: point 1.
    Most of the non-breaking stuff has been backported to the 0.18.
    I have been fairly diligent about that.

  26. stevengj commented on Jul 16, 2025

    @stevengj

    Yes, please just make a release from the current repo state, and call it 1.0 for the reasons noted above.

  27. PallHaraldsson commented on Aug 3, 2025

    @PallHaraldsson
    Contributor

    I see lots of support for my #946 (mostly redundant issue with later discussion here like):
    #479 (comment)

    In short I feel 1.0 needs not be fully mature, but if people are hesitant of 1.0 right now, pushing it off for more years, potentially, because something is less perfect, can those datastructures be moved to UnstableDataStructures.jl with pre-1.0 version number that depends on this new 1.0 (since a breaking version number, dropping those lesser used/developed ones)?

  28. oxinabox commented on Aug 4, 2025

    @oxinabox
    MemberAuthor

    We put off making breaking changes for 5 years.
    And the vast majority of the changes were backwards compatible deprecations.
    I think we did also delete some things that were deprecated sveral years ago.

  29. oxinabox commented on Jun 26, 2026

    @oxinabox
    MemberAuthor

    So the reason this hasn't made much progress in last 7 years , despite the fact that is the plan is fairly straight forward.
    But actually doing it requires 2 or 3 people to sit down who really care to do it, and the review each other's code.

    I made a start in #837
    but felt like i didn't get enough feedback to really come to conclusion on what is best.

    Finding 2-3 people who really care and getting them to dedicate a week to this is hard.
    I certainly have better things to do with my time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions