News for hackers. Stuff that matters.
Re:Using Clang on Windows by chris_wot on Thursday August 03, 2017 @07:47PM (#14925100)
What are the advantages of using clang-cl over the Microsoft c++ compiler?
Re:Using Clang on Windows by martell on Thursday August 03, 2017 @08:14PM (#14925275)
By using clang-cl you are getting the advantage of the LLVM backend.

LLVM/Clang can target many different platforms besides windows and it is open source so it is sponsored by many large companies including Google Apple etc.

Google use it for Chrome for example (which includes windows) and have engineers working full time to meet their needs.

Intel, ARM, AMD and co have upstreamed many optimisations into LLVM also.

If you have a bug it probably will be resolved faster. Instead of waiting months for the next Visual Studio Release etc

In general, LLVM because of the intermediate bytecode language and well made libraries like libclang enables new kind of tooling.

Microsoft actually use LLVM themselves in many places and have a bunch of open source projects that use it, which is great

The would actually probably be better off retiring MSVC's c++ compiler and focus on clang along with everyone else because other companies are basically paying for the engineering for their platform with clang.

Unlike gcc the license for llvm/clang is more liberal so if they want private internal tooling they can still do that also.

Re:Using Clang on Windows by chii on Thursday August 03, 2017 @11:14PM (#14926067)
> Unlike gcc the license for llvm/clang is more liberal so if they want private internal tooling they can still do that also.

How can that be true? The definition of private internal tooling is that it's not publically distributed, and therefore, GPL isn't a concern.

Unless you distribute the result of your modifications to GCC, both clang and GCC are viable bases from which you make your internal tooling.

Re:Using Clang on Windows by wildmusings on Thursday August 03, 2017 @11:25PM (#14926104)
Wanting to distribute something externally does not mean that you want to release it publicly. Lots of "internal" tools are distributed to teams at partner companies and contractors, for example.

And more generally, the internal tool of today can become the hit add-on to your existing product of tomorrow, or a new product line. You want to retain flexibility.

Legal departments aren't just being paranoid when they insist on avoiding GPL-licensed code if at all possible.

Re:Using Clang on Windows by pjmlp on Friday August 04, 2017 @01:25AM (#14926511)
Which is why the *BSDs have a bigger amount of contributions than GPL-licensed operating systems.
Re:Using Clang on Windows by wolfpld on Friday August 04, 2017 @10:37AM (#14928948)
> both clang and GCC are viable bases from which you make your internal tooling.

License is not the only factor determining usability of a compiler wrt interfacing with external tools. GCC was deliberately designed to prevent such usage.

See https://www.youtube.com/watch?v=NURiiQatBXA at 2:22 for a direct quote from RMS on this topic.

Re:Using Clang on Windows by johncolanduoni on Thursday August 03, 2017 @08:40PM (#14925411)
An (unusual) case I've found it useful for is doing LTO across boundaries with other languages whose compilers use LLVM. I've used it to enable inlining of C++ methods called from Rust (the C++ code in question was V8).
Re:Using Clang on Windows by martell on Thursday August 03, 2017 @09:16PM (#14925580)
This seems super interesting, I am currently looking at building the whole mingw-w64 crt as LTO libs.

I wonder if this would be applicable with that in combination with gcc-rs.

Disclaimer: I'm also on that rust hype train :)

Re:Using Clang on Windows by jftuga on Thursday August 03, 2017 @08:00PM (#14925206)
You can add features or fix bugs since it is open source. It might be easier for cross-platform code.