You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here I describe some ideas, thoughts, resources and possible design decisions I
gathered during a brainstorm session to help developing a new crate design for version-compare in the future. It lists things I like to have, some facts we
can use, a simple list of existing version schemes and so on.
I hope this helps to shed light on all desired features in a new design, by
distilling what is used currently.
Some things may not be implementable, might be incorrect and I'm probably
missing a lot. That's something to look into later.
Like to have
Here are some ideas I'd like to have:
Version & Ver to represent comparable version numbers
Like String and str, owned and referenced
Easily compare Version and Ver instances
Implement comparison traits, and useful helper functions,
similar easy-to-use API to version-compare 0.0.10
Version schemes, for different version parsing and comparison logic (semver, gnu, ...)
Generic Version & Ver to compare on, do not use different structs for all
kinds of different schemes
Great extensibility
Allow users to externally define their own version schemes, to be a framework
to compare different version styles as well. Good implementations could be
merged into this crate later on.
Also allow minimal configurability on some existing schemes, such as the
generic/default scheme used for comparison to tweak sorting.
Stream the parsing version number components:
Could speed things up when comparing large version strings
Validity checking
Allow checking whether a version string is valid given a version scheme.
Configure comparison logic between each component type 1! > 2: Epoch(1) > Major(2)
Compare across different version schemes (would this even even be possible?)
Support version operator expressions (Rust, npm)
Testing operators such as > ,>=, !, *, ^, ~ >=1.2, ^1, ~1.2.3, 1.2.*
Design facts
Here are some design facts/choices that I think will be assumed/used for the
redesign of this crate. This could be used to build the core Version and Ver
structs upon, allowing support for a large spectrum of version numbers:
Some version schemes that were mentioned and used right now. Could be used to
source mechanics from to validate a new crate design is sufficient, and version
schemes could be implemented for it:
Here I describe some ideas, thoughts, resources and possible design decisions I
gathered during a brainstorm session to help developing a new crate design for
version-comparein the future. It lists things I like to have, some facts wecan use, a simple list of existing version schemes and so on.
I hope this helps to shed light on all desired features in a new design, by
distilling what is used currently.
Some things may not be implementable, might be incorrect and I'm probably
missing a lot. That's something to look into later.
Like to have
Here are some ideas I'd like to have:
Version&Verto represent comparable version numbersLike
Stringandstr, owned and referencedVersionandVerinstancesImplement comparison traits, and useful helper functions,
similar easy-to-use API to
version-compare 0.0.10Version&Verto compare on, do not use different structs for allkinds of different schemes
Allow users to externally define their own version schemes, to be a framework
to compare different version styles as well. Good implementations could be
merged into this crate later on.
Also allow minimal configurability on some existing schemes, such as the
generic/default scheme used for comparison to tweak sorting.
Could speed things up when comparing large version strings
Allow checking whether a version string is valid given a version scheme.
1! > 2:Epoch(1) > Major(2)Testing operators such as
>,>=,!,*,^,~>=1.2,^1,~1.2.3,1.2.*Design facts
Here are some design facts/choices that I think will be assumed/used for the
redesign of this crate. This could be used to build the core
VersionandVerstructs upon, allowing support for a large spectrum of version numbers:
Not compatible with everything in ..., but compromises must be made:
https://xenoterracide.com/post/falsehoods-programmers-believe-about-versions/
Existing version schemes
Some version schemes that were mentioned and used right now. Could be used to
source mechanics from to validate a new crate design is sufficient, and version
schemes could be implemented for it:
1:epochs-debian-revision: suffix5:5.0.3-4ubuntu0.11:epochs1!: EpochsCore version components
Component types that might be used globally in the core of the crate:
dev: always lower than other releasespost: always higher than otherwise similar releasesSpecial version components
Component types that might be a version scheme specific implementation:
1!: conda1:: RPMExamples
Some version numbers I'd like to support, in different styles:
11.2.31.2.alpha.32.0.0-rc.2: semver1:1.2.3-debian2: Debian1!1.2.3-post: PEP440/conda1.0a0: conda: the a0 is separate from the 1 and 0 parts. Pre-release indicator.1.0.2b12: used by Applev1.2.3: common in tags19999.00071YYYY-mm-dd: datesYYYYmmdd: dates0.8.1+git.20100810t184654.ab580f4-0ubuntu2: dpkg package for git on UbuntuMyApp 3.2.0 / build 09321.0.2d: openssl, which has releases with & without the letter, but will gain sanity soon.And some components as well:
1!: epoch in Conda1:: epoch in RPM~suffix:~is lowest when sorting in Debian.suffix-suffix1a: letters in components-1.2.3: negative components1.-2.3: negative componentsOther resources
Some other useful resources, not really covered yet:
Edit: added suggestions from #20 (comment)