home.social

#compilerexplorer — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #compilerexplorer, aggregated by home.social.

fetched live
  1. A new #FreePascal lesson, thanks to #CompilerExplorer.

    Incrementing a number by an ordinal can be done in a few ways in Free Pascal, but they result in a different number of lines of x86_64 assembly.

    Let's say we want to increment i by 1.

    PASCAL:
    i := i + 1; // ... and ...
    i += 1; // produce identical assembly

    ASSEMBLY:
    movl -16(%rbp),%eax
    leal 1(%eax),%eax
    movl %eax,-16(%rbp)

    However...

    PASCAL:
    Inc(i);

    ASSEMBLY:
    addl $1,-16(%rbp)

    Granted, this might be before any optimisation takes place, but it's still very interesting to see!

    I hadn't realised before today that Inc() will work with numbers other than one. So...

    PASCAL:
    Inc(i, 2);

    ASSEMBLY:
    addl $2,-16(%rbp)

    It will also work with variables.

    Let's say we want to increment i by AInt, an incoming argument.

    PASCAL:
    i := i + AInt; // ... and ...
    i += AInt; // produce identical assembly

    ASSEMBLY:
    movl -16(%rbp),%eax
    movl -8(%rbp),%edx
    leal (%eax,%edx),%eax
    movl %eax,-16(%rbp)

    However...

    PASCAL:
    Inc(i, AInt);

    ASSEMBLY:
    movl -8(%rbp),%eax
    addl %eax,-16(%rbp)
  2. Playing with #FreePascal in #CompilerExplorer.

    Lines 22 and 23 produce less machine code than lines 25 and 26, yet end up with the same result - trimming the last character from the last item in a TStringList.

  3. Also, I wonder how this stuff smashes into the automagic -ification that modern compilers do. I'm not sure that those expose carry flags. I suppose I need to fling a test case at . Also, I wish it was called . 5/4

  4. Ever wanted to know who's that great chap running Compiler Explorer? Mike Godbolt gave a talk:

    youtu.be/3W0vE_VKokY

    #Godbolt #CompilerExplorer #CPlusPlus

  5. [#Compiler] Day 1 of Study Notes

    While the original uses , I wanted to replicate the analysis locally.

    In this post, I have used , , llvm-objdump and to analyze.

    Read more here: gapry.github.io/2026/01/01/Adv

  6. RE: hachyderm.io/@mattgodbolt/1156

    Another from @mattgodbolt's Advent of Compiler Optimisations, in which the compiler knows when to stop being clever because it knows modern CPUs with all their mad out-of-order pipelining jibber-jabber don't need any help - and he shows us a tool on for looking into that. Read this one, but then watch the video too.

  7. @uecker @Codeberg @mattgodbolt
    Wat?

    As a Codeberg member myself, I checked your example here as well. The @compiler_explorer UI seems to handle the link just fine: if you click on the offered link, the raw file content is shown as you would expect. Then, the compiler is complaining about the file where the CE-internal machinery has supposedly put down the source text that it has downloaded from Codeberg.

    So, there seem to be two different code paths in play. One, close to the UI, that works. And another one, hidden in the background, that doesn't.

    #CompilerExplorer #Codeberg

  8. More thanks to Matt Godbolt for today's episode of , where the only horrors are in the tortured C code that gets turned into beautiful elegant assembler. The golden moment was the footnote alerting me to the existence of 's "optimisation pipeline explorer".

    xania.org/202512/03-more-addin

  9. I didn’t realize that #CompilerExplorer had become this…complicated 😰 — kudos to Matt Godbolt, et al for running it:

    “How Compiler Explorer Works In 2025”, Matt Godbolt (xania.org/202506/how-compiler-).

    On HN: news.ycombinator.com/item?id=4

    On Lobsters: lobste.rs/s/ocu642/how_compile

    #Compilers

  10. 🥳🎉 In the dystopian wonderland of 2025, Compiler Explorer is the AI overlord, churning out 92 million compilations like it's flipping burgers 🍔. Who'd have thought a hacky weekend project would grow into Skynet's compiler? 🙃
    xania.org/202506/how-compiler- #dystopianfuture #AIoverlord #CompilerExplorer #techtrends #weekendproject #HackerNews #ngated

  11. Consider: semi-offline #CompilerExplorer that lazily downloads compilers using #Nix or #Guix .

  12. On my recent India visit, I visited multiple academic campuses and addressed over 200 CS students (and 30 faculty). Regrettably, I did not once use Compiler Explorer (not even mention it) in any of my talks. 🥺

    The topics of the talks just did not lend themselves to bringing up Compiler Explorer, but still I feel so ungrateful, like I let down someone. 😳

    #sorry #CompilerExplorer

  13. I was so hoping I could include JUnit with Java compiler/executor on Compiler Explorer, but alas. 😞

    I don't know how hard it is to accomplish, but I filed a library request. Please vote and opine:

    github.com/compiler-explorer/c

    #Java #JUnit #CompilerExplorer

  14. This is a Compiler Explorer appreciation post. Again. Because I can't say it enough.

    #cpp #gratitude #CompilerExplorer

  15. @scottmichaud @smurthys I had a colleague who declined to use 'nullptr' in C++11 for "performance concerns". I wish we had had #CompilerExplorer back then.

  16. I filed a feature request for #CompilerExplorer to "Add Executor" to "Conformance View" to make it easier and use less screen space.

    The current approach requires three clicks and opens two windows going from a compiler in the list to seeing execution results. Adding an executor directly would change that to one click and opens just one window.

    As an educator, I know students mostly need/want to see execution results, not assembly.

    Comments welcome. 🙏🏽

    github.com/compiler-explorer/c

    #cpp

  17. Reply from a #CompilerExplorer team member on the name "Conformance View":

    github.com/compiler-explorer/c

    IMO, users may use the feature to test "conformance", however they define that term, but CE itself does not do anything about conformance.

    Instead, the feature lets users build a "compiler list" and adds a high-level indication of at least one compilation error (red) or no compilation error (green) with each compiler.

    So "Compiler List" is a better name and it does not set higher expectation.

  18. Have I mentioned in the last few weeks how much I love #CompilerExplorer? ❤️

    BTW, I went to CE repo to learn about "Conformance View" and reading an existing issue there makes me ask:

    Does Conformance View do things other than let me build a list of compilers and then show the fail/pass state of the code for each listed compiler?

    DGMW that view is quite helpful, but does it do anything on its own about "conformance"? If yes, conformance to what? If not, is it misnamed?

    github.com/compiler-explorer/c