Live data from Hacker News

Android NDK: GCC is now deprecated, everyone should be switching to Clang

android.googlesource.com

181–190 of 259 posts

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#181
post #157

Earlier quoted context omitted.

Python is not licensed under the GPL, and it is not clear to me that they care about this sort of thing. As for Mono, I was there at the conception of the project, and can thereby tell you off the top of my head that if you go to the History section of the documentation they have an archived copy of the premise, and it is dropping with "free as in freedom" language. http://www.mono-project.com/archived/mailpostlongre…

So they in fact talk about freedom with using the word on their home page. That is exactly my point.

rms' statement was

> The Clang and LLVM developers reach different conclusions from ours because they do not share our values and goals. They object to the measures we have taken to defend freedom because they see the inconvenience of them and do not recognize (or don't care about) the need for them. I would guess they describe their work as "open source" and do not talk about freedom.

If you're objecting to that, well, where do they talk about freedom? I'm saying rms appears to be correct because I can't find anything they have to say about the issue. I searched more than the homepage.

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#182

Earlier quoted context omitted.

> How is iostream any better than [ ]printf? What consistent mechanism do you use to printf an instance of an arbitrary user-defined type? With ostream, you implement ostream& operator and you're done. with printf, you have to have a convention and remember to stick to it. (Do I call .toString(), .stringize(), .getString()... ??) For one-off things, printf is great . You take it from me when you pry it from my goddam…

noob question - what is the use case for a program that operates on arbitrary user defined types? Dynamic typing sounds lazy and slow in my head, might as well use python at this point

> ...what is the use case for a program that operates on arbitrary user defined types?

That's not what's going on. Neither C nor C++ really permits that.

We're just talking about the relative merits of using printf and friends vs. using iostream to format data for the console or disk.

In either case, you have to write the code for your class that massages the class's internals correctly, but the question is, do you write to the ostream extraction and istream insertion API, or do you write to the substantially less well defined printf-and-friends API?

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#183

The sad thing is that "easy to link and embed" and "permissive license" really didn't have to go together like they did in LLVM. GCC could have provided a library that made it easy to do code generation or compiler development. That library could still have used the GPL, so that only Free Software could use it. Some of the work that has happened around LLVM wouldn't have happened around such a library, but some of it…

What GCC and RMS did (and I suspect their goal was all along) was to change the Overton Window [1] of acceptability for open source. Remember this was still the time that Solaris was not open source, and Microsoft was borging competitors . It was not definitely the Visual-Studio-is-open-source time.

By creating a hard line, and building a compelling alternative to proprietary compilers, he introduced a seed of change in the minds of young programmers at that time .... All of whom are senior management now and share a belief that things like Protocol Buffers should be open source.

In fact, its interesting that Android is inducing this change all over again (not Linux). Its a viable answer to "its not as good as an iPhone,why should I buy it".

[1] https://en.m.wikipedia.org/wiki/Overton_window

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#184

Earlier quoted context omitted.

I don't know much about Android NDK, but in general, people use clang because: - Clear and readable diagnostics -- especially useful when debugging nasty C++ template stuff where the type signature is a page long. (GCC is catching up in this area) - Modular design -- if an IDE wants to have syntax highlighting or an Xcode/Eclipse/IntelliJ like "fix it" feature, they can use the clang frontend to parse the code. Also,…

FWIW, GCC has ASan too. [0] I'm not sure how it compares to the LLVM implementation, I've only tried LLVM's (with good results). Having said that, I hack on LLVM daily and would not relish having to use GCC to the same effect. LLVM really does shine when used as a library! [0]: https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html

ASan and UBSan are the same in the two; both the GCC and clang instrumentation shims were contributed by Google, and the resulting instrumentation is the same.

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#185

Earlier quoted context omitted.

Some people will never admit they are wrong...

Richard Stallman, however, is correct. (I'm going to get that on a t-shirt, printed in block letters: "Stallman is correct.")

Isn't the argument above that he was wrong? He may have been morally right that free software is an inherent good over proprietary software, but that's sort of a given for this discussion.

He was tactically wrong in taking an expansive view of both what free software licenses should enforce and what fell within their realm of enforcement. He was hoping that GCC would be so much better than the competition that people would use it despite it being GPL, and for a long while (e.g., NeXT's Objective-C patches) it was. But the GPL, especially the GPLv3, was perceived as way more onerous than Stallman expected it would be, and eventually it became worth people investing heavily in a competitor just to avoid the GPL. If he had aimed a little less high with the GPL and admitted a plugin architecture / documented IR for GCC earlier, then LLVM may never have taken off.

Alternatively, he was tactically wrong in thinking that strong copyleft was required to achieve the goal of software freedom. Note that the clang in the NDK "is now a nearly pure upstream clang," not because they're required to, but because the pace of modern software development makes it genuinely easier to voluntarily submit changes upstream.

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#186

Earlier quoted context omitted.

Some people will never admit they are wrong...

Richard Stallman, however, is correct. (I'm going to get that on a t-shirt, printed in block letters: "Stallman is correct.")

People make the mistake of assuming Stallman or the FSF cares about "market share".

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#187
post #77

Earlier quoted context omitted.

It, sadly, goes deeper than that, past architecture to philosophy. LLVM is designed to be modularized and embedded in other binaries and toolchains, which makes it easier to build extensions and tooling around it. In addition to having a mountain of legacy code, gcc's project steering is philosophically opposed to allowing non-free (as in GPL) plugins [ https://lwn.net/Articles/582242/ ]. Because of this, developers…

I think you have a typo in exist -> exits? Either that or I couldn't understand the sentence.

Yep. Thanks for catching. :)

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#188
post #175

Earlier quoted context omitted.

> gcc's project steering is philosophically opposed to allowing non-free (as in GPL) plugins I think that's the right philosophy. Why shouldn't you be contributing your plugin if you derive value from it, so that other people can derive value from it just as you did with GCC (if you distribute it that is - if you wrote it inhouse for internal use, then it doesn't matter at all!). It's not like the code generated by G…

The philosophy went farther than, "We want GCC plugins to be free." It went to, "We want GCC plugins to be basically impossible, because otherwise the risk of non-free plugins is too high." So, the FSF sacrificed technical needs in order to serve philosophical goals.

And in essence, the market is interpreting onerous licensing as damage and routing around it (to bastardize a famous quote about Usenet) ;)

Re: Android NDK: GCC is now deprecated, everyone should be switching to Clang

#189
post #55
post #12

Earlier quoted context omitted.

As someone messing with LLVM a lot.. basically LLVM is where a ton of development effort is going. GCC is a dead end it seems like. LLVM is designed to be extended where as GCC.. well, usually doesn't really seem to have been designed.

GCC has been designed specifically NOT to be extended. Richard Stallman reasoned that by exposing an interface to other applications, or allowing other applications to access or modify intermediate code/trees, closed source proprietary applications could be built around GCC. He was probably right ... but we all ended up with a worse compiler.

More than that; we ended up with a crippled Emacs. What could and should be a full-featured IDE built into a self-documenting programmable Lisp-derivative virtual machine is instead a continuation of the "good-enough" conglomeration of regexp-driven hacks that continues to drive new engineers to real and productive solutions produced by the likes of Microsoft.

https://lwn.net/Articles/629259/

Post reply on HN