Finer-grained compiler names ordering
See original GitHub issueCompiler Explorer sorts compiler names by simple lexicographical string comparison. As I see, all compiler strings are of form “binary_name + version”, so they can be split up and be sorted firstly by binary_name, then by version.
Compiler list for Rust as shown at https://rust.godbolt.org:
rustc 1.0.0
rustc 1.1.0
rustc 1.10.0
rustc 1.11.0
rustc 1.12.0
rustc 1.13.0
rustc 1.14.0
rustc 1.15.0
rustc 1.16.0
rustc 1.17.0
rustc 1.18.0
rustc 1.2.0
rustc 1.3.0
rustc 1.4.0
rustc 1.5.0
rustc 1.6.0
rustc 1.7.0
rustc 1.8.0
rustc 1.9.0
rustc beta
rustc nightly
Expected output:
rustc 1.0.0
rustc 1.1.0
rustc 1.2.0
rustc 1.3.0
rustc 1.4.0
rustc 1.5.0
rustc 1.6.0
rustc 1.7.0
rustc 1.8.0
rustc 1.9.0
rustc 1.10.0
rustc 1.11.0
rustc 1.12.0
rustc 1.13.0
rustc 1.14.0
rustc 1.15.0
rustc 1.16.0
rustc 1.17.0
rustc 1.18.0
rustc beta
rustc nightly
UPD: seems like this is the function responsible for comparing strings. Please correct me if am wrong.
UPD2: https://gcc.godbolt.org/ holds (most?) compiler names of form “architecture + binary_name + version”, so the comparison function is going to be either language-specific or generic. It still can be made generic though, for Rust with arch = undefined
comparator parameter for example.
UPD3: fortunately, currently there are only 2 representations shown above:
- “binary_name + version” (D, ispc, Rust)
- “architecture + binary_name + version” (C++, Go, Haskell)
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
The way I think about this is to think about the kinds of comparisons I tend to want to make. I’m usually interested either cross-compiler, or latest compiler versus older version of the same.
I also generally don’t care about very old compilers.
To that end; yes, ‘trunk’ should sort as “higher” than any stable release; I think it would also make sense to sort in reverse order, so trunk is the first of each compiler family, then the latest stable, and so on.
As for architecture; I think it would usually make sense to group by arch before grouping by compiler. Personally I virtually never want to see ARM or x86 results, so having them mingled with the x64 compilers that I care about would be a huge step backwards.
Hi! Just dropping in here to let you know that, even if it’s not as in-depth as we would like, semver ordering for most compilers will be implemented in the next release, which should happen “soon” We’re still looking into improving the experience, but right now, this is a good first step 😃