question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Finer-grained compiler names ordering

See original GitHub issue

Compiler 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:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
DrPizzacommented, Jan 19, 2018

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.

1reaction
RubenRBScommented, Jun 19, 2018

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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Quil Compiler — pyQuil 3.3.2 documentation
The interface to the Quil compiler from pyQuil is under construction, and some of the PRAGMA directives will soon be replaced by finer-grained...
Read more >
Ceedling/CeedlingPacket.md at master - GitHub
Ceedling knows what files to compile and link into each individual test executable by way of the #include list contained in each test...
Read more >
TI Arm Clang Compiler Tools User's Guide v2.1
The C++ name demangler, tiarmdem, is a debugging aid that converts names that have been mangled by the compiler back to their original...
Read more >
4. Building Executable Programs with GNAT - Documentation
When linking an executable, create a map file with the specified name. ... The ability of GNAT to compile in any order is...
Read more >
c++ - Inversion of generated vtable functions order for ...
If I differentiate names (like foo1 and foo2), the order in generated code is the same as in my declaration. Is this normal...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found