Live data from Hacker News

Usability Improvements in GCC 15

developers.redhat.com

101–110 of 231 posts

Re: Usability Improvements in GCC 15

#101

Using a hierarchy to show template errors is brilliant and I'm sort of surprised compilers haven't always done that. I was investigating C++-style templates for a hobby language of mine and SFINAE is an important property to make them work in realistic codebases, but leads to exactly this problem. When a compile error occurs, there isn't a single cause, or even a linear chain of causes, but an potentially arbitrarily…

I really wish templates didn't work on a dumb "replace at call site until something compiles" manner. All template requirements should be verified at the function definition, not at every call site. There is concepts. But they are so unwieldy.

It's honestly a seriously hard problem.

Yes, it's definitely nice to be able to typecheck generic code before instantiation. But supporting that ends up adding a lot of complexity to the typesystem.

C++-style templates are sort of like "compile-time dynamic types" where the type system is much simpler because you can just write templates that try to do stuff and if the instantiation works, it works.

C++ templates are more powerful than generics in most other languages, while not having to deal with covariance/contravariance, bounded quantification, F-bounded quantification, traits, and all sorts of other complex machinery that Java, C#, etc. have.

I still generally prefer languages that do the type-checking before instantiation, but I think C++ picks a really interesting point in the design space.

Re: Usability Improvements in GCC 15

#102
post #95

Earlier quoted context omitted.

What exactly do you mean by "UNIX"? Commercial UNIX vendors other than Apple have basically a rounding error from 0% of market share.

Are you from 2001? Sorry, but Apple at servers' market it's non-existent. RH and Canonical make tons of money thanks to being THE platform of the ubiquituous internet. Support is not free.

Gnu/Linux and UNIX are not the same thing. Yes I understand that RHEL and Ubuntu are popular.

Re: Usability Improvements in GCC 15

#103
post #74

Earlier quoted context omitted.

How do you grep for it without taking your hands off the keyboard?

Windows key + dot, then type in warning / if it was among the last ones you used, use the arrow keys, and hit Enter to insert it. If you use whatever OS other than Windows, I'm sure there are similar flows available if you search for it. And since it's just Unicode, I'm sure there are numpad based keybinds available too.

why shouldn't i just type grep warning instead of bringing up some GUI that possibly takes forever to initialize?

how does it work over ssh? :)

Re: Usability Improvements in GCC 15

#104
post #61

Big fan of all of this except for the emojis in my console

It should be easy to patch out or possibly add a command line switch to disable it if desired.

Already exists : -fdiagnostics-text-art-charset=[none|ascii|unicode|emoji]

Re: Usability Improvements in GCC 15

#105
post #88
post #4

I hope gcc remains the default in Linux due to the GPL. But I expect someday clang will become the default. Plus I heard COBOL was merged in with the compiler collection, nice!

> I expect someday clang will become the default [compiler for the Linux kernel]. Why? I don't personally use GCC except to compile other people's projects in a way that's mostly invisible to me, but it seems like it's still widely used and constantly improving, thanks in part to competition with LLVM/Clang. Is the situation really so dire?

> Is the situation really so dire?

I for one don't think so. From my perspective, there's at least as much momentum in GCC as clang/LLVM, especially on the static analysis and diagnostics front over the past 5 or so years. That was originally one of the selling points for clang, and GCC really took it to heart. It's been 10 years since GCC adopted ASAN, and after playing catchup GCC never stopped upping their game.

Perhaps the image problem is that LLVM seems to be preferred more often for interesting research projects, drawing more eyeballs. But by and large these are ephemeral; the activity is somewhat illusory, at least when comparing the liveliness of the LLVM and GCC communities.

For example, both clang/LLVM and GCC have seen significant work on addressing array semantics in the language, as part of the effort to address buffer overflows and improve static analysis. But GCC is arguably farther along in terms of comprehensive integration, with a clearer path forward, including for ISO standardization.

More importantly, the "competition" between GCC and clang/LLVM is mutually beneficial. GCC losing prominence would not be good for LLVM long-term, just as GCC arguably languished in the period after the egcs merger.

Re: Usability Improvements in GCC 15

#106
post #96

Earlier quoted context omitted.

And then the world started moving on, with other licenses that gave even more freedom and flexibility. It was a great start, but you need to adapt or you perish.

When VSCode et all beging shipping DRM and who knows what in their extensions, then we'll se what with happens with these half-shareware semilibre projects. Specially when propietary dependencies kill thousands of projects at once.

Well, you are already unable to get most of the functionality out of vscode without Microsoft's extension store.

I, for one, am happy that there are still a couple of people here and there that you can really trust on this stuff.

Re: Usability Improvements in GCC 15

#108

Earlier quoted context omitted.

Why?

Well, other than the fact that it's hard to search for, things should be kept as simple as possible to improve reliability/interoperability. Are you confident that multi-column-wide non-ASCII characters work reliably without causing rendering issues on every possible combination of terminal/shell/OS, including over SSH? I'm certainly not.

They are quite easy to search for actually, because they are sparse and you tend to not get so many spurious results due hitting things that contain your query as a substring. Even then, the glyphs appear inline in the warning message, they are not the anchor, you could still just search for "warning:" like you or your editor have been doing for years. Every operating system comes with an emoji picker, it takes like 2 seconds to use. I'm not sympathetic, tbqh.

Re: Usability Improvements in GCC 15

#109
post #42
post #17

Earlier quoted context omitted.

The difference being that vendors forks not compliant with GPL can be legally asked for the changes they haven't sent upstream.

With LLVM they don't need to fork it in the first place. But still, it doesn't matter because ISO compliance is a frontend problem. The one vendor who forks LLVM and doesn't contribute their biggest patches back is Apple, and if you want bleeding edge or compliance you're not using Apple Clang at all. If you say "isn't it great vendor toolchains have to contribute back to upstream?" I'm going to say "no, it sucks tha…

Forcing vendors to contribute back upstream is an attempt at making vendor toolchains not exist.

If a company makes a new MCU with some exciting new instruction set, they need to make a compiler available which supports that instruction set and make that compiler available to their customers.

With LLVM as the base, the vendor could make their toolchain proprietary, making it impossible to integrate it back into LLVM, which means the vendor toolchain will exist until the ISA gets wide-spread enough for volunteers to invest the time required to make a separate production-quality LLVM back-end from scratch.

With GCC as the base, the vendor must at least make their GCC fork available to their customers under the GPL. This, in theory, allows the GCC community to "just" integrate the back-end developed by the vendor into GCC rather than starting from scratch.

Now I don't know how effective this is, or how much it happens in practice that the GCC project integrates back-ends from vendor toolchains. But in principle, it's great that vendors have to make their toolchains FOSS because it reduces the need for vendor toolchains.

Re: Usability Improvements in GCC 15

#110
post #7

Usability improvement request for this article: don't hijack the browser back button :P

Browser makers should straight up remove the JS API for interacting with history. There are legitimate uses for it, but the malicious actors far outweigh the good ones at this point. Just remove it.

I mean, without `history.pushState()` and `window.onpopstate` things wouldn't be as nice. Ok, I guess one could do about everything with `location.hash = ...` and `window.onhashchange`, like in the before times. But the server will not get the hash part of the URL so a link to such an page can't be server side rendered and has to fetch the actual page content in JavaScript, evaluating the hash. When I browse things like image search it is really handy that you can use the browsers back button to close an opened image without loosing any dynamic state of the page and that the x button on the page will close the image and remove the history entry just the same way, so a later back won't re-open that image.

For me the back button wasn't hijacked.

But I am for disallowing the use of `history.go()` or any kind of navigation inside of `onpopstate`, `onhashchange`, `onbeforeunload` or similar or from a timer started from one of those.

Post reply on HN