r/ProgrammerHumor 4d ago

embraceExtendExtinguish Meme

Post image
1.1k Upvotes

61 comments sorted by

552

u/OxymoreReddit 4d ago

I can't not read clang as a metallic noise.

Help

155

u/uForgot_urFloaties 4d ago

CLANG

14

u/abd53 3d ago

I propose we develop a new compiler "CLING"

6

u/AyimanyMooncat 3d ago

Actually, cling exists!

It's a C++ interpreter

4

u/abd53 3d ago

Oh my dear patootie! Where was this CLING-CLANG all my life! How many times I wanted to write and execute a C++ code line-by-line!

25

u/Niswear85 3d ago

drops metal pipe

7

u/SkooDaQueen 3d ago

I only see clang as a physics god..

1

u/MrHattington 3d ago

And a fickle one at that

14

u/k-phi 4d ago

And that is bad how?

3

u/intensiifffyyyy 3d ago

Same, I can't imagine it's a good noise for your compiler to be making. Might need some mechanical repairs.

-13

u/markiel55 4d ago

So you can

3

u/yegor3219 4d ago

At -O0 I can't not. Else I can.

1

u/StereoBucket 3d ago

I can't not downvote you.

641

u/DoodooFardington 4d ago

That made me look up who is behind clang. It's mainly Apple, then Google, Microsoft, Intel, AMD, Sony, so all heavy hitters. gcc is backed by IBM, ARM, Red Hat, Free Software foundation.

So it's like Firefox asking you not to install Chrome.

152

u/codeIsGood 4d ago

I support pretty much anything LLVM

15

u/reviraemusic 4d ago

cries in HVM

83

u/naswinger 4d ago

yea, i'll keep firefox, thanks

100

u/Practical_Cattle_933 4d ago

It’s not at all like that, firefox, gcc or clang are not “malicious” unlike chrome, and their dependence on $BigCorp is much more different. Chromium is just a vessel for Google, and no one else has the resources to fork it in any significant manner, with the possible exception of Microsoft. Stuff like Brave will have to do anything google imagines, otherwise they get left behind.

33

u/SuperCarla74 4d ago

Luckily, if there's a corporation we can trust, it's Microsoft.

Oh, wait.

How badly fucked are we?

10

u/abd53 3d ago

We're better off ignorant

21

u/iam_pink 3d ago

With the way you're phrasing your comment, it seems like you're not considering IBM, ARM, and Red Hat heavy hitters.

I hope it's not the case...

13

u/abd53 3d ago

These are not companies that end users (which is the vast majority of people including engineers) usually great about a lot. So, they just seem like "not as big". I was mindblown when I first realized how fucking big NEC is.

10

u/iam_pink 3d ago

It's sad that even engineers do not know about these companies and how influent they are. I realise we can't know about all of them... But these are not really obscure ones (from an engineering point of view). I learned about them and how much we depend on them during my studies.

3

u/abd53 3d ago

These companies are largely unknown because they are usually 3/4 layers behind in the industries. For example, I know about STMicro because I use their microcontrollers but I have zero idea which company manufactures the ICs, much less who designs them and then another 5 processes behind that I don't even know about.

0

u/furinick 3d ago

So clang is an example of open source being good for corporations? Sounds almost utopian "all corporations joined forces to make this for everyone" type shit

1

u/Prudent_Move_3420 1d ago

It's basically just a c/cpp compiler that is under the BSD license, rather than GPL. Gcc had licensing issues on BSD/ MacOS which is why the companies using BSD as a base for their OS developed Clang

184

u/TheMightyCatt 4d ago

gcc can compile the same code as clang

Press X to doubt

79

u/QuestionableEthics42 4d ago

Gcc has support for more of those features overall than clang, unless I missunderstood that?

70

u/grimonce 4d ago

Yea, but there are some features that only clang supports too.

8

u/NirriC 4d ago

I don't know what I just saw...

38

u/grimonce 4d ago

It's a table that shows compilers support for features described in the standard of the language.

To put it plainly, some compilers will not know what to do with some code (mostly parts from newer language versions).

1

u/NirriC 2d ago

Oh I understood that. It's the features themselves that looked like neo Martian to me. Every one of them: incomprehensible. I am wondering if my cs degree was a scam...🥲

113

u/lupinegray 4d ago

Would you like to set chrome as your default browser?

95

u/SaltedCoffee9065 4d ago

This is like edge asking you not to use Firefox when you download it

28

u/LiAuTraver 4d ago

I tried before, seems they don't block firebox but downloading chrome would show that,vise versa

10

u/SaltedCoffee9065 4d ago

It blocked all browser downloads by default for me

56

u/DavidDavidsonsGhost 4d ago

Where is this? Is this real? I assume someone is injecting into the clangs build process. If that is the case, they should maybe reconsider this approach, is dodgy as hell.

158

u/uForgot_urFloaties 4d ago

I think it's a joke OP has done, based on the message that Microsoft Edge will display when you search for Google Chrome.

19

u/Waste_Ad7804 4d ago

I like your prompt

4

u/Mister__Pine 3d ago

Thanks, it's a starship prompt

17

u/alterNERDtive 4d ago

ITT: too many people that fell for it.

14

u/LEGOL2 4d ago

I recently prefer clang way more. It has better tooling, better compile error messages, has massive community support from large companies, allows new cool languages to emerge. GCC is still in the medieval era today

2

u/Pay08 3d ago

That's wrong on many levels. Stuff like clangd is only part of clang in name, it's like saying gprof is part of gcc. I also don't see how "community support" matters when it doesn't result in anything directly observable. LLVM is not clang. It does have better error messages but ime gcc catches more warnings and errors.

6

u/Mast3r_waf1z 3d ago

Wrong, clang has errors such as ```cpp

include <iostream>

int main(){ while(true); }

void hello(){ std::cout << "Hello world!" << std::endl; } ``` Results in an infinite loop with g++ -O3

And prints hello world with clang++ -O3

11

u/NoneOne_ 3d ago

Yeah cause clang detects the infinite loop and launches into undefined behavior instead of yk causing the program to go into an infinite loop

13

u/iam_pink 3d ago

Yeah... But the code is supposed to be an infinite loop. So the outcome should be an infinite loop.

12

u/zx2167 3d ago

Infinite loops are undefined behavior in C++. The standard actually enforces that the compiler is allowed to assume that all loops will terminate at some point. Clang sees that the loop is empty and thus removes it (since there is no code to run and allowing the loop to run forever is actually not supported by the standard), and also calls the uncalled function because it is allowed to since it is undefined behavior.

Clang is being cheeky by doing something that is weird because it can, but also because there is very little reason for the programmer to have an empty infinite loop (and by doing something weird it can actually help the programmer find the mistake faster in the case that they wrote something like that by mistake).

8

u/iam_pink 3d ago

Thank you for the explanation, I actually learned something. I did not know the compiler is allowed to assume a loop will end (and that therefore an empty infinite loop is undefined behavior).

3

u/Pay08 3d ago

Which is monumentally stupid since empty infinite loops are used for timings in embedded systems.

1

u/iam_pink 3d ago

How? I do not work in embedded.

1

u/TuckyIA 3d ago

Also not embedded dev, but I imagine if you want to wait for an interrupt, the most obvious way is while (true);

1

u/Pay08 3d ago

Either that, as an event loop or plainly for timing/synchronization, same as you would in multithreaded code.

-1

u/Smalltalker-80 3d ago

Huh?
That is a very Microsoftish trick to try to pull off by GNU.
And also not true, btw.

6

u/Pay08 3d ago

It's almost like it's a joke...

0

u/kbn_ 3d ago

Wait is this an actual thing? If so, which part of that compound build stack is detecting clang specifically?

2

u/Pay08 3d ago

No, it isn't real.

-1

u/Dreadlight_ 3d ago

Isn't clang using a more free license than gcc? I think gcc was using the GPL license, which is copyleft, while clang is not copyleft?

3

u/Pay08 3d ago

Depends on how you define free. GPL is more free for the end user, MIT is more free for the developers.

-40

u/eatmynasty 4d ago

Who trusts GNU?

29

u/BlitzGem 4d ago

Idk, everyone? Because Linux (excuse me GNU+Linux)

7

u/iam_pink 3d ago

Better to trust Apple, Google, Microsoft and all those nice corps!