6 ms·
GCC can honestly only blame itself for its inevitable increasing obsolescence. LLVM only has the attention it has because it can be used as a building block in
by mort96 2y ago
GCC can honestly only blame itself for its inevitable increasing obsolescence. LLVM only has the attention it has because it can be used as a building block in other compilers. GCC could've made a tool and library which accepts IR, performs optimizations and emits machine code, but the project avoided that for ideological reasons, and as a result created a void in the ecosystem for a project like LLVM.
- Tpt 2y agoThere is now libgccjit that aims at allowing to embed gcc https://gcc.gnu.org/onlinedocs/jit/ https://gcc.gnu.org/onlinedocs/jit/ There is an alternative backend to rustc that relies on it.
- aengelke 2y agolibgccjit is, despite its name, just another front-end for GIMPLE. The JIT-part is realized through compiling the object file to a shared library and using dlopen on this. One big problem with libgccjit, despite its fairly bad compile-time performance, is that it's GPL-licensed and thereby makes the entire application GPL, which makes it impossible to use not just in proprietary use-cases but also in cases where incompatible licenses are involved.
- pjmlp 2y agoThe embedded compiler vendors, UNIX and consoles are quite happy with it. How much do you think they contribute back upstream regarding ISO compliance outside LLVM backend for their hardware and OS?
- mort96 2y agoEmbedded compiler vendors and UNIXes want a possibly slightly patched C or C++ compiler, maybe with an extra back-end bolted on. I'm talking about use-cases like Rust and Zig and Swift, projects which want a solid optimizing back-end but their own front-end and tooling.
- pjmlp 2y agoAnd FOSS folks most likely would like to enjoy those patches as well on their installations.
- School-Cotton 2y agoAnd they do! You can choose not to contribute your changes back to permissively-licensed software, but in actual practice most people do contribute them. It's not like the Rust compiler is proprietary software with their own closed-source fork of LLVM...
- trelane 2y ago> You can choose not to contribute your changes back to permissively-licensed software, but in actual practice most people do contribute them. They contribute some things, sure. But the also don't contribute some things. It is hard to know how much because it's kept secret from all of us, even their own customers. > "It's not like the Rust compiler is proprietary software with their own closed-source fork of LLVM..." Rust no, hut there are a lot of proprietary, semi-incompatible proprietary forks out there.
- mort96 2y agoI haven't advocated for re-licensing GCC to be permissively licensed. And patching GCC is necessarily going to be much easier for vendors than to build a new C front-end which generates GCC IR. So I'm not sure what difference you think what I'm proposing would make with regard to your concerns.
- vbezhenar 2y agogccrs is a rust implementation for gcc. Just because Rust developers don't want their users to be fully free doesn't mean there are any problems with gcc. And clang is developed by Apple which is a huge warning sign by itself.
- bigstrat2003 2y ago
- duped 2y agoIt's not like GCC or the embedded toolchains are a shining beacon of ISO compliance... and if you mean video game consoles, are any of them using GCC today? Sony and Nintendo are both LLVM and Microsoft is Microsoft
- pjmlp 2y agoThe difference being that vendors forks not compliant with GPL can be legally asked for the changes they haven't sent upstream.
- bobmcnamara 2y agoApple, Arm, OpenBSD, FreeBSD have all switched to Clang.
- pjmlp 2y agoSwichting wasn't the point.
- johnisgood 2y agoWhy did OpenBSD switch to clang? Licensing issues?
- bobmcnamara 2y agoCould be. They stuck with GPL2 GCC 4.x for a while. IIRC, they never switched to GPL3 GCC5+
- School-Cotton 2y agoWhat exactly do you mean by "UNIX"? Commercial UNIX vendors other than Apple have basically a rounding error from 0% of market share.
- anthk 2y agoAre 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.
- mort96 2y agoAre you calling Linux a UNIX? I mean GNU/Linux is certainly a UNIX-like system, but aren't "UNIXes" typically used to refer to operating systems which stem from AT&T's UNIX, such as the BSDs and Solaris and HP-UX and the like? GNU's Not UNIX after all
- johnisgood 2y agoI have fond memories associated with OpenSolaris. Oracle ruined it. I have not tried OpenIndiana, however.
- anthk 2y agoGNU isn't Unix as NT isn't Win32. Gnu promotes Unix, but also promotes Emacs on top. NT can run Win32 on top of it, but there's far more than Win32 with NT systems. Just get ReactOS and open the NT object explorer under explorer.exe. Far more advanced than Windows 95/98.
- mort96 2y agoWin32 is an API, while UNIX, NT and GNU are all operating systems made by AT&T, Microsoft and the GNU Project respectively. I agree that the GNU operating system isn't the UNIX operating system, and I agree that the NT operating system isn't the Win32 API, but I have no idea what comparison you're trying to draw. It almost sounds like you think UNIX is an API like Win32, and that GNU is an operating system which "implements UNIX" like NT is an operating system which "implements Win32"? Are you confusing UNIX with POSIX? GNU was made to replace UNIX, not to promote it.
- dralley 2y agoYet another reason why I'm not a fan of Richard Stallman. Most of the decisions he made over the past 25 years have been self-defeating and led directly to the decline of the influence of his own movement. It's not that "the GCC project" avoided that for ideological reason, Stallman was personally a veto on that issue for years, and his personal objection led to several people quitting the project for LLVM, with a couple saying as much directly to him. https://gcc.gnu.org/legacy-ml/gcc/2014-01/msg00247.html https://gcc.gnu.org/legacy-ml/gcc/2014-01/msg00247.html https://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00091.html https://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00... (both threads are interesting reading in their entirety, not just those specific emails)
- knowknow 2y agoKind like how GPL 3 makes it infeasible for most companies to use/support free software. At least Stallman gets to feel morally superior though
- dralley 2y agoAnd Free Software does not benefit from a morass of mutually-incompatible copyleft licenses that may as well have been proprietary since you can't use them together. None of the permissive licenses have this problem.
- codeshaunted 2y agoIs it still the case that the Linux kernel cannot be compiled using clang, or can you do that now?
- bombcar 2y agoI believe clang has worked for years now.
- codeshaunted 2y agoWhy would anyone bother with GCC then? :P
- bombcar 2y agoI believe GCC still wins by far on support for weird CPUs and embedded systems.
- codeshaunted 2y agoWith LLVM I doubt this will remain true. LLVM makes custom code generation far too easy for GCC to remain viable imo.
- jcranmer 2y agoI don't have much experience with writing a custom gcc backend, but my experience with LLVM is that its model ends up being a somewhat poor fit for smaller or weirder architectures. For example, LLVM has this annoying tendency to really aggressively promote the size of everything--if you have a 32-bit core with 64-bit memory indexing, LLVM tends to make anything that eventually becomes a memory index a 64-bit computation, even if it would be more efficient to keep everything as 32-bit.
- mort96 2y agoHm, is it so much easier to write an LLVM back-end than a GCC back-end? I haven't looked into GCC's code gen infrastructure that much, but I looked into making a new back-end to LLVM some time ago and it seemed extremely complex and entirely undocumented. All guidance I found on it basically amounted to, "copy an existing back-end and bang it against a rock until you've made it generate the machine code you need". And it certainly wasn't a case of having clean and simple enough code to make documentation unnecessary. It would honestly surprise me if GCC is more difficult to add a back-end to.
- aengelke 2y agoI'd add code quality as a reason. I find it much easier to understand and modify code in LLVM compared to GCC. Both have a fairly steep learning curve and not too much documentation, but often I (personally) find LLVM's architecture to be more thought out and easier to understand. GCC's age shows in the code base and it feels like many concepts and optimizations are just bolted on without "required" architectural changes for a proper integration.