Why hasnt llvm replaced gcc yet?

Why hasnt llvm replaced gcc yet?

Attached: LLVM-Logo-Derivative-4.png (225x250, 18K)

GCC produces faster, better optimized binaries.
LLVM compiles faster will less resources.

LLVM/TCC for testing, GCC for final build.

few years and it will
Linux is pretty much the only big project relying on GCC and everyone is sick of GCC's bullcrap

math student here
can you explain me the basic purpose of LLVM?
the wiki is not really clear about this

Because LLVM has a cuck license and as a result lots of users don't share their improvements or contribute them back.

Go away apple shill.

>GCC produces faster, better optimized binaries.
I really want to see this claim backed up sometimes

It used to be backed up when it was actually true. Now that it's not, you either get no proof or proof from years ago that's no longer relevant. All modern comparisons show GCC and Clang producing pretty much the same quality binaries

I haven't encountered motivation to actually change compilers.

All I can say as a Windows guy is that GCC/MinGW is OK on Windows and Clang/LLVM is shit on Windows.

clang.exe: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]
a.c:1:10: fatal error: 'stdio.h' file not found
#include
^~~~~~~~~
1 error generated.

you're retarded

I could get it to work if I really wanted to. The point is that GCC and Clang are very similar functionality-wise. And when they are similar after the install, that means what I care about is which is easier to install. If Windows came pre-installed with Clang, I'd happily use that. I just don't want to dick around with weird env vars and ad-hoc build systems (Hey GLEW!).

>few years and it will
Been hearing this was almost a decade, still GCC creates faster binaries and is in strong development.

And I really like Clang/LLVM as well, and the current situation of two free state of the art compiler toolchains in competition is a fantastic situation.

Actually I would want another competitor to emerge as well.

I will never understand people who want either to disappear.

it's a pretty big project that does a lot of things

LLVM as it's own intermediate programming language and libraries with objects for representing this language. This language has strict set of types, is strongly types (no generics, polymorphism or such) and has very little abstraction, it provides integer types, arrays, strings, pointers, structs, functions.
Surprisingly it abstracts memory away as it's a static single assignment form.

Front-end (e.g. clang as front-end for C/C++) has it's own sets of rules and takes care of parsing and semantic analysis. If it has some templates or code generation then it generates the specific code, if it has classes then it translates to that. Functional programming languages would do a lot with their type systems there.

When it translates all the code into LLVM IR language. LLVM does all sorts of high-level optimizations. As a mathfag you could actually be interested in SSA form - it's an abstraction where each variable is assigned only once, most of the algorithms to fork with it are graph algorithms.
Then it should do code generation. LLVM has a collection of backends for individual machine architectures/targets and each has a different resources to use, thus each needs a different low level optimizations. And finally linking into executable binary.

Then there are smaller parts for features such as JIT compilation, multiple stacks (used for user-space threads as Go does), garbage collections, exceptions, and more.
LLVM has very complex architecture and is a very big project. I guess it could take years for one to really understand each part of it. I don't

>Because LLVM has a cuck license and as a result lots of users don't share their improvements or contribute them back.
GNU does not require you to share your own modifications back, it only requires you to do this if you plan to distribute.
Where are all these non-free modifications of LLVM being distributed?

if you installed raw GCC you would have the same issue. mingw or cygwin do a lot other than just shipping a compiler.

it has on my machine

Attached: Screenshot_20190316_180039.png (430x174, 13K)

It has

Attached: Screen Shot 2019-03-16 at 11.04.21 AM.png (250x54, 8K)

>still GCC creates faster binaries and is in strong development.
Been hearing this was almost a decade. It's on par really. There is no significant difference. Sometimes GCC produces few percent faster code, sometimes clang does.
ThinLTO might be a big win of LLVM for some, I've heard a lots of new CPU arch designers to shit on GCC for making it hard to write a new backend in comparison.

I don't want GCC to disappear neither, but they have been just behind on everything in last several years and only copied clang/llvm with new features to catch up. All relevant innovation happened in the LLVM island.

Cool dragon

>Where are all these non-free modifications of LLVM being distributed?
unironically, in Apple products

But Google works on clang/llvm very hard and even GCC benefits from it. The whole thing is industry-driven anyway, presenting GNU as good commies and BSD as corporate cucks is laughable.

No support for gcc-specific extension bloat

LLVMs cuck license makes me weary. Hell I was googling for some c to universal bytecode compilers and stumbled across a ton of embedded compiler companies reselling their nonfree LLVM based compiler. If you want to be some loser who waits a few years after Microsoft or apple add some nextgen compiler feature in their nonfree llvm toolchains, go for it, but I'd rather support a GPLd toolchain instead.

Links

I guess you're right. But MinGW/Cygwin ship with GCC -- if they'd ship with Clang I'd be okay, too. Again, from my point of view GCC and Clang are very similar. Their main difference to me is the Windows support.
And don't forget that most people on Windows don't even bother with MinGW/Cygwin and just straight up use VS. People don't give a shit about the actual compiler (as long as they're standards compliant and somewhat optimizing). They just want it to work after the install.

The free software community relies on a bunch of nonstandard GNU extensions.
LLVM essentially adopted alot of that bloat just to be able to compete.

Lack of certain features gives opportunity for new developers to implement them.

behold the Windows user

gnuisms

musl when? I need to be free from the GNU bloat tyranny.

from what I've read, you just need to add both clang and mingw/bin to PATH for it to work
(and have version on-sync - 32-bit clang for 32-bit mingw or both 64 bits)
should be easy

does llvm compile Linux (the kernel) now?

i think i'll just start filtering posts with cuck license in them since they never have anything intelligent to say

>fuckups are features
Fuck off Tim Cook.

Attached: drugs.png (462x384, 274K)

to be fair, American government made some crazy money on selling drugs and making them illegal just increased their price and consumption

>People don't give a shit about the actual compiler (as long as they're standards compliant and somewhat optimizing).
People don't even give a shit about standards in Windows. VS can't even into C99, kek.

clang on windows is meant to be used with the visual studio command line package at a minimum

>Why hasnt llvm replaced gcc yet?
It has in some places. In others, it hasn't. There are differences in what exact language dialects the two accept.

Oh fuck off, Jow Forums

I'm not from Jow Forums.

retard

It's purpose is to translate other languages into an intermediary LLVM language, which it then compiles to binary.
You can write your own new langages in it if you wanted.
Basically it's a non-System 7 derived version of lex/yacc/cc/etc.
Apparently it as cleaned up some of the piled up bullshit from 50+ years of c-family compiler development, but it's only a matter of time before you'll need custom llvm flags in your builds as well.

It will. It's a great project worked on by incredibly bright people.

It can't compile Linux (and Coreboot) yet, and it seems that its output doesn't have a significant advantage over optimized builds from GCC. The effort required to get it to work in your build system isn't worth it at the moment.

>testing with a different compiler
Are you fucking retarded?

I wish they implemented -Wlogical-op flag

I think I'll just start filtering LLVM posters since it's clear they are trying to take my compiler optimizations and never give back to the community

Allowing big companies to use your code and not give anything back at all is literal cuckoldry.

And as the output of LLVM improved, it also lost its "compiles faster with less resources" status.

>they never have anything intelligent to say
where do you think you are

This, turns out, optimizations aren't free and from some point optimizations aren't worth it.

Jow Forums wasn't this bad before

you are really stupid
visual studio uses a .bat script to setup most of the environment variables needed to compile via the command line
microsoft's compiler will probably spit out a similar area if you try it without running from a developer prompt
the only thing that requires effort to get around is the fact that you can't easily get a powershell developer prompt and powershell is objectively superior to cmd.exe

I've been here since before this board was a board.
It has always been this bad.

I make sure my stuff compiles with GCC because LLVM isn't trustworthy since it isn't FOSS (doesn't have patent protection). Even though the source code is "FOSS", if you compile it and use it Apple can still legally sue you for violating their patents since you don't have a patent grant for patents on the source code and the license doesn't give you an explicit patent grant unlike GPLv3.

because people don't want CIA nigger code injected into their binaries

>ThinLTO might be a big win of LLVM for some
ThinLTO sacrifices LTO efficiency for speed of compilation, GCC instead sacrifices memory usage while not skimping on optimization quality (ThinLTO is needed for LLVM because normal LLVM LTO is single threaded and thus slow as f*ck, GCC allows you to use multiple threads with -flto=n to speed up compilation)

>I don't want GCC to disappear neither, but they have been just behind on everything in last several years
Not performance of generated code. For computationally intense code GCC practically always wins, and particularly with floating point math.

This continues when you use more 'exotic' optimization like PGO, also at the PGO instrumentation stage (runtime data gathering) LLVM is REALLY slow for some reason compared to GCC, and it still results in worse performing code.

Note that this is Clang/LLVM 7, 8 should be out any day now and could change this (then again GCC 9 is soon to be released as well).

clang might be production ready but some things in the llvm toolchain certainly isn't, for example, linking mpv with lld results in a segfaulting binary

that's msvc not clang

mingw-w64 v6 is the first release capable of being bootstrapped solely with clang+binutils

they're cutting over to the Apache-II licence soon

Doesn't LLVM use Apache 2 which should do that as well?

ok on trunk branch, so what said

Because C is a shitshow and real world programs depend on gnu extensions to C.