Slashdot Mirror


Chrome On Windows Ditches Microsoft's Compiler, Now Uses Clang (arstechnica.com)

An anonymous reader quotes a report from Ars Technica: Google's Chrome browser is now built using the Clang compiler on Windows. Previously built using the Microsoft C++ compiler, Google is now using the same compiler for Windows, macOS, Linux, and Android, and the switch makes Chrome arguably the first major software project to use Clang on Windows. Chrome on macOS and Linux has long been built using the Clang compiler and the LLVM toolchain. The open-source compiler is the compiler of choice on macOS, making it the natural option there, and it's also a first-class choice for Linux; though the venerable GCC is still the primary compiler choice on Linux, by using Clang instead, Google ensured that it has only one set of compiler quirks and oddities to work with rather than two. But Chrome on Windows has instead used Microsoft's Visual C++ compiler. The Visual C++ compiler is the best-supported, most widely used compiler on Windows and, critically, is the compiler with the best support for Windows' wide range of debugging and diagnostic tools. The Visual Studio debugger is widely loved by the C++ community, and other tools, such as the WinDbg debugger (often used for analyzing crash dumps), are core parts of the Windows developer experience.

94 comments

  1. Performance by Anonymous Coward · · Score: 0, Flamebait

    So that's why Chrome's taking up 2GB or RAM and always running at 30% CPU?

    1. Re:Performance by Anonymous Coward · · Score: 0, Flamebait

      This is the case with many open source programs, there typically is very little effort made to minimize the footprint or optimize the code. Once it's running without constant crashes it's usually puked out to the web. There is no accountability for anything.

    2. Re:Performance by ArchieBunker · · Score: 1

      I never met a time traveler before. How is life in 2004 treating you? If my computer has 16Gb of memory why should I be upset that programs take advantage of it? Is that bragging rights or something? Oh look I have 64Gb and never use more than 6!

      --
      Only the State obtains its revenue by coercion. - Murray Rothbard
    3. Re:Performance by wed128 · · Score: 1

      no, that's mostly because of shitty javascript on the whiz-bang web-2.0 sites you're browsing.

      All of those videos on pornhub take up a lot of ram.

    4. Re:Performance by bluefoxlucid · · Score: 2

      My computer has 16GB of memory and keeps killing Chrome for using most of it. Shrug.

    5. Re:Performance by Anonymous Coward · · Score: 1

      Tablets and netbooks still usually come with 1-2GB of non upgradeable ram. Even the Surface Laptop, a relatively expensive laptop comes with only 4.

    6. Re:Performance by K.+S.+Kyosuke · · Score: 1

      Use Firefox, apply the proper config options for memory use limitation? (At least that's what worked for me in the moderately distant past...)

      --
      Ezekiel 23:20
    7. Re: Performance by Anonymous Coward · · Score: 0

      Not sure why you are marked as flamebait when you speak the truth.

    8. Re:Performance by bluefoxlucid · · Score: 1

      I tried that last year and that's how I ended up using Chrome.

    9. Re:Performance by ArchieBunker · · Score: 1

      You one of those nutjobs that keeps 400 tabs open? Chrome never uses more than 2-3Gb for me.

      --
      Only the State obtains its revenue by coercion. - Murray Rothbard
    10. Re:Performance by Anonymous Coward · · Score: 0

      I haven't used Windows in a decade, but I've been assuming it's still a multitasking operating system. You should be upset if a single application is using the majority of your RAM.

    11. Re:Performance by Excelcia · · Score: 1

      I have, unfortunately, met people like you before. People like you are the reason why it costs a gigabyte of RAM and requires a VM being spun up just to plop "Hello World" on a screen. Why am I upset when your inefficient program eats my RAM? I am upset because my computer's resources are not yours to waste. Read that again to yourself a few times for emphasis please.

      Good code is efficient with memory, CPU, and any other resource it makes use of. This is just simply programming best practice. Wasting resources because you have them to waste makes for programs that don't play well with others and it leads to a lackadaisical attitude in more than just resource usage. Plus, as much as you might think you've invented hard AI, or the software cure for cancer, people are going to want to run more than just your precious little brain child. In response to the Amiga, Bill Gates famously said "who will ever want to run more than one program at a time?". You seem to have that mentality. I like to use my RAM for my purposes. I load up huge images to photo edit while a kernel compiles in a virtualbox session and while I re-encode a video with a codex that works with my BlurRay player. I am also someone that likes to have 30+ tabs open as I work, and a browser built with an efficient compiler is appreciated.

    12. Re:Performance by MachineShedFred · · Score: 1

      Well, for one thing, it's nice to be able to run something besides a web browser in that 16GB of RAM at the same time. Like maybe an over-bloated email cllient. Or an over-bloated messaging app. Maybe even an application to get actual work done.

      We've had multitasking for over 30 years now, are you suggesting that we step back to the days of the Apple II and the original IBM PC? Except with pretty graphics and untold waste of system resources?

      --
      Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.
    13. Re:Performance by bluefoxlucid · · Score: 1

      I use tab discarding. Certain web sites seem to pile up the JavaScript if left open for a long time.

    14. Re:Performance by Anonymous Coward · · Score: 0

      I have, unfortunately, met people like you before. People like you are the reason why it costs a gigabyte of RAM and requires a VM being spun up just to plop "Hello World" on a screen. Why am I upset when your inefficient program eats my RAM? I am upset because my computer's resources are not yours to waste. Read that again to yourself a few times for emphasis please.

      Good code is efficient with memory, CPU, and any other resource it makes use of. This is just simply programming best practice. Wasting resources because you have them to waste makes for programs that don't play well with others and it leads to a lackadaisical attitude in more than just resource usage. Plus, as much as you might think you've invented hard AI, or the software cure for cancer, people are going to want to run more than just your precious little brain child. In response to the Amiga, Bill Gates famously said "who will ever want to run more than one program at a time?". You seem to have that mentality. I like to use my RAM for my purposes. I load up huge images to photo edit while a kernel compiles in a virtualbox session and while I re-encode a video with a codex that works with my BlurRay player. I am also someone that likes to have 30+ tabs open as I work, and a browser built with an efficient compiler is appreciated.

      Ok weirdo, honestly if you are upset that a program is using "all your resources", and that bothers you, then don't use it. You are going to be angry that something merely exists but isn't mandated?

      If you can't load "huge images" to "photo edit" while compiling a kernel in VirtualBox(why? You think your optimizations do something there vs. a typical virtual kernel?) while encoding a video with a "codex" that works on your bluray with 30 tabs open, you need a new computer. All of those things put together would take less than 2GB of ram. 30 tabs is pathetically small. Most people have hundreds open, on their smartphones...

    15. Re: Performance by Anonymous Coward · · Score: 0

      No, because it has always done that on every platform.

  2. Why not GCC???? by Anonymous Coward · · Score: 0

    Because the GNU folks screwed themselves over with their pompous, obstructive, anti-technical-excellent zealotry. They've since changed their ways a bit, but it's too late. People want freedom not "Freedom".

    1. Re:Why not GCC???? by jellomizer · · Score: 1

      The GNU folks have been too ambitious in their vision and many of its leaders didn't want to reconcile with its own problems in its vision. It was too easy to call people who disagreed with some of the GNU greedy corporate shills, where many the people were mostly on board however they had a few issues.

      The biggest issue I have with GNU is the lack of respect of the time and effort it goes into coding. It seemed that if you wanted to make money off of GNU software you were limited to Distributions and Consulting support. Other methods that followed the rules have been frond on or caused the GPL to change to prevent such actions (With the IBM Exception). So for many businesses who in general supported open source principals tend to shy away from GNU software as it may bite them in the future.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    2. Re:Why not GCC???? by 0100010001010011 · · Score: 1

      The biggest issue I have with GNU is the lack of respect of the time and effort it goes into coding.

      The biggest problem I've had with GNU/GPL software is two fold:

      • Avoiding breakage at all costs.
      • "I'm not getting paid to fix it, just use it as is" mentality.

      On top of that it seems like a lot of tools were developed in a weekend by a single individual to scratch an itch and move on. GNUMake seems to be one of the biggest ones that everyone runs into. No one wants to make any changes that break stuff because then people will complain, and at this point so much needs to be 'fixed' that it'll never happen. And no one wakes up thinking "I'll take time to do this right" because they won't ever get paid for any improvements they make.

      When I started doing FreeBSD development and working with BSD userspace it felt 'broken' at first, but after sitting down and RTFM, it feels like they actually put thought into some design decisions. And yes, sometimes stuff breaks. But they seem to give a fairly big heads up of any breaking changes.

      And if something is up to date and maintained it appears that people are being paid to fix it and keep it working. I dig through BSD project commits and a lot of individuals at big companies making small tweaks to keep things running. The nature of the license doesn't scare away the lawyers and when I see a BSD binary that does everything I need it to I kind of tell myself "This is what I'm *allowed* to see, the cool stuff must still be behind closed doors".

      How much cruft and dead weight is in GCC because of the myriad of platforms it needs to support and the way in which it supports them?

      LLVM started off as a graduate project where it looks like someone actually sat down and thought about use cases. If I want to port a new language to a platform I just have to make a $LANG to intermediate representation (IR) parser.

      The same thing goes for porting LLVM to a new architecture, I just need to make the IR to byte code part. I don't have to waste my time working out the C, C++, Fortran bits and can concentrate on supporting my architecture.

      I'm sure that Apple, IBM and Google have some incredibly awesome tools they can't or wont show us. Probably some stuff highly specific to what ever they need to support. And if that's what puts food on their table, it works for me.

    3. Re:Why not GCC???? by KiloByte · · Score: 1

      They've chosen Clang over GCC for political reasons: despite a codebase without historical baggage, Clang is at least several percent slower than GCC, it only compiles faster. A good rule of thumb is that Clang-built code executes as GCC at one optimization level less, with compilation speed being likewise faster. Obviously, this wildly differs per test case.

      Also, Clang's portability is pretty bad.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    4. Re:Why not GCC???? by SurenEnfiajyan · · Score: 0

      The generated binaries' performances are comparable in some cases clang is faster, in some cases gcc. Also gcc's optimizer is notorious for bugs and undefined behaviors. Just try this in optimized mode with any gcc version and compare it with other compilers:

      #include <iostream>
      int main()
      {
      for (int i = 0; i < 100; ++i)
      std::cout << 30000000 * i << std::endl;
      }

    5. Re:Why not GCC???? by ChunderDownunder · · Score: 1

      It's not about Clang, it's about LLVM.

      Google wants to commence re-implementing their browser in Rust, a thread-safe functional language. By using LLVM, they can cherrypick any code from the Servo project for incorporation into Chromium. And they save on R&D costs by letting Mozilla employees do most of the work.

    6. Re:Why not GCC???? by KiloByte · · Score: 1

      Also gcc's optimizer is notorious for bugs and undefined behaviors. Just try this in optimized mode with any gcc version and compare it with other compilers:

      Your code is buggy; gcc notices the bug and issues a diagnostic, while clang happily produces incorrect output.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    7. Re:Why not GCC???? by SurenEnfiajyan · · Score: 0

      gcc notices the bug, issues a diagnostic and happily generates shit code, while clang generates the correct code, printing the products (perhaps overflowed) 100 times which most sane people would expect.

  3. How well optimized is CLANG vs Visual C++ Compiler by jellomizer · · Score: 2

    Being that Google Chrome is in a constant speed race with Edge and Firefox all trying to be the fastest full featured browser out there. These guys need every advantage they can get to inch out on the benchmarks to claim they are the fastest. The general rule of thumb is tools made to run on many platforms tend to run more slowly then tools made for a particular platform.

    Is Google going to stop in the benchmark war? Is CLang optimized enough for windows platforms to allow time saved in compiler compatibility to be used in better speed algorithms. Is CLang objectively equal or better then Visual C++ (As Microsoft sometimes sacrifices performance, for legacy support that Chrome may not be worried about)

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  4. Re:How well optimized is CLANG vs Visual C++ Compi by Anonymous Coward · · Score: 0

    Yes.

  5. Standard C++ support in Visual C++ lagging behind? by Anonymous Coward · · Score: 0

    Otherwise I will always recommend using more than one compiler to help standardize the code.
    Of course, when you have automatic CI it sucks also having to have Windows build servers and not just Unix, depending on your build system. You still need Windows test machines for automated testing, though.

  6. Re:How well optimized is CLANG vs Visual C++ Compi by Anonymous Coward · · Score: 0

    They probably want to have a more consistent build environment to reduce the impact of compiler bugs and differences in standard support. Also, automatic test suites are likely cheaper to build and run with Clang than with any commercial compiler. This should make the Chrome Experience(tm) more consistent across the platforms in terms of speed as well.

  7. No, that's typical of commercial software. by Anonymous Coward · · Score: 2, Insightful

    Commercial software is written for profit; the programmers don't do shit to improve it unless there's a paying customer.

    In contrast, open-source programs are written largely by people who are trying to scratch their own itches, including performance itches.

    Good luck re-programming Microsoft Edge when you're unhappy with its performance.

    1. Re:No, that's typical of commercial software. by Anonymous Coward · · Score: 0, Troll

      Good luck re-programming Microsoft Edge when you're unhappy with its performance.

      I have just as much with any open-source thing you could name. I literally have no skill-set in those endeavors, no desire to have it, and almost as little ability to articulate any problems.

      I can't even get people along with my real life situation, what makes you think it'd be better on a computer?

    2. Re:No, that's typical of commercial software. by alexo · · Score: 1

      Allow me to fix that for you:

      Commercial software is written for profit; the programmers don't do shit to improve it unless there's a paying customer.

      In contrast, open-source programs are written largely by people who are trying to scratch their own itches, which may or may not coincide with yours

      If you are lucky to find open-source software whose authors' "vision" co-align with yours, that's great. If you have the skills and the free time to hack on the code yourself, even better. Otherwise, you pay for what you want/need.

    3. Re:No, that's typical of commercial software. by Anonymous Coward · · Score: 0

      Basically, yes. Mostly a Linux guy, but was a sysadmin for a very large application which was strictly written for Microsoft only. (The back end servers were unix, the front-end was MS). The per-seat cost was around $2500 US (per year). Each license counted one point. If you had a paid-for admin terminal it also counted as a point. Every year, you could put your points on what you wanted the vendor to fix. There was a pool of bugs that you could put them into, or various new features. They allocated programmer resources based on the total number of points each area received from all the licensees. Since it was all proprietary, all end administrators could do was tweak the user interface a bit. The back end was compiled binary that came out once a year. If something you really needed at your site, but no one else was interested in, you had to do something on your own (an external piece of software that could feed some parts of their system). If it was integral to the system, and you were the only one who wanted it, and didn't have very many points, you did without. Open source means you have a chance of doing modifications you want, closed source means the hood on your car is welded shut, with a sticker that says if you try to grind it open or take the sticker off, you don't get warranty, and are open to litigation.

  8. Re:How well optimized is CLANG vs Visual C++ Compi by countach · · Score: 2

    Just guessing here, but I doubt the compiler makes any difference to speed whatsoever. Why? Because modern javascript browsers are just-in-time compiling the javascript into native code. So the native code is 2 levels removed from the C++, and the code your compiler generated.

  9. LLVM Project Blog says by TimSSG · · Score: 3, Informative

    http://blog.llvm.org/2018/03/c...

    I read LLVM Project Blog; I think it said it was done partly for code maintenance issues. As, in it should be faster to add patches for Windows using the same Compiler over all platforms.

    Note: They are still using Microsoft linker.

    Tim S.

    1. Re:LLVM Project Blog says by Anonymous Coward · · Score: 0

      Note: They are still using Microsoft linker.

      The gnu linker is not used on OSX, Solaris, or AIX, either, it's pretty much a linux thing

  10. Structured Exception Handling by Anonymous Coward · · Score: 0

    Does Clang support Windows SEH (a proprietary feature of Windows NT)? I have to admit I don't see that used very often, but I bet they use it all the time in Redmond.

    1. Re: Structured Exception Handling by Anonymous Coward · · Score: 0

      Per the LLVM blog entry, yes:

      âJuly 2015 the first fallback-free build of 32-bit Chrome (32-bit SEH was difficult).â(TM)

    2. Re:Structured Exception Handling by DCFusor · · Score: 1

      Why would google care? The entire point is to support more platforms.

      --
      Why guess when you can know? Measure!
    3. Re:Structured Exception Handling by Anonymous Coward · · Score: 0

      Control Flow Guard is the now-fashionable compiler dependent security thingy and a progeny of the SEHOP. Mozilla Nightly got that only recently probably due to a compiler change. Opera has had that for a while, so Chrome likely as well. Clang CFG support status on Windows is unknown to me.

  11. Re:How well optimized is CLANG vs Visual C++ Compi by Anonymous Coward · · Score: 0

    Google is using inline asm for those parts where CLang is falling behind, so it's not an issue.

  12. Lol CLang by Anonymous Coward · · Score: 0

    Sounds like some kind of Klingon name.

    1. Re: Lol CLang by Anonymous Coward · · Score: 0

      Klingon software developers are among the most lethal and strongest.

      It's not uncommon for them to kill the QA team.

    2. Re:Lol CLang by Anonymous Coward · · Score: 0

      Modern app appers only app MS Visual C++ apps and appy app apps, NOT LUDDITE CLang!

      Apps!

  13. Re:How well optimized is CLANG vs Visual C++ Compi by angel'o'sphere · · Score: 1

    Why would a tool that emits x86 code on macOS do anything different on windows/x86?

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  14. Re:Not the smartest move. by wed128 · · Score: 1

    Not on debian -- chrome only updates when i run apt-get update. just like everything else. Why give any program permission to overwrite itself?

  15. illustrating the power of open source by e**(i+pi)-1 · · Score: 3, Insightful

    Open source projects like Clang is what brings us forward. Especially in the long term. Open source has enabled and improved many commercial products. The current case that Microsoft uses it as part of their development illustrates this very well.

  16. Clang Clang Clang whent the, um, whent the, um by Anonymous Coward · · Score: 0

    What?

    1. Re:Clang Clang Clang whent the, um, whent the, um by tsqr · · Score: 1

      According to Judy Garland, the trolley. The trolley went clang, clang, clang.

  17. Re:How well optimized is CLANG vs Visual C++ Compi by Anonymous Coward · · Score: 0

    Google said that Clang vs MSVC is within 5% performance (faster in parts, slower in parts). And that's Clang without PGO vs MSVC with PGO, so enabling PGO in Clang might make the Clang version even faster.

    It's also much easier to optimize for a single compiler - e.g. they were already using Clang for some libraries, because Clang does inline x64 assembly, which MSVC doesn't support, and that brings significant performance gains to certain bits of code.

  18. Vivaldi by ledow · · Score: 3, Informative

    Er... Vivaldi has used Chrome as a base and been compiled with clang for a while now, I think:

    Vivaldi 1.14.1077.55 (Stable channel) (32-bit)
    Revision 46ff8f974f033190bbae67a70c7809ee15bc2353-
    OS Windows
    JavaScript V8 6.4.388.46
    Flash (Disabled)
    User Agent Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.189 Safari/537.36 Vivaldi/1.95.1077.55
    Command Line "C:\Users\ldowling\AppData\Local\Vivaldi\Application\vivaldi.exe" --always-authorize-plugins --enable-blink-features=ResizeObserver --flag-switches-begin --flag-switches-end https://vivaldi.com/newfeature...
    Executable Path C:\Users\ldowling\AppData\Local\Vivaldi\Application\vivaldi.exe
    Profile Path C:\Users\ldowling\AppData\Local\Vivaldi\User Data\Default
    Compiler clang

    1. Re:Vivaldi by istartedi · · Score: 3, Insightful

      The option to use a 3rd party compiler for the release has always been there. The big news in TFA is that Microsoft helped them with the PDB format so that you could compile *and* debug with Clang.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  19. Re: How well optimized is CLANG vs Visual C++ Comp by SirSlud · · Score: 1

    This is some very poor guessing.

    --
    "Old man yells at systemd"
  20. Re: How well optimized is CLANG vs Visual C++ Comp by Anonymous Coward · · Score: 0

    Hes not wrong though. The place where you could maybe see a difference is in the layout and rendering engines, but even then i doubt clang is any noticeable faster OR slower than msvc.

  21. Re:Not the smartest move. by Anonymous Coward · · Score: 0

    In the article they talk about how updating to a new release of MSVC takes them a year, because their huge codebase full of cutting-edge complicated code usually triggers lots of bugs (internal compiler errors etc) in new MSVC releases. They have to report them and get them fixed.

    Clang probably has the same number of bugs - writing a good compiler is hard - but Clang is open source so Google set up a build server to compile the latest dev version of Chrome with the latest dev version of Clang, so such bugs get caught straight away and fixed quickly.

  22. Re: Not the smartest move. by Anonymous Coward · · Score: 0

    Sometimes ya gotta just shit your pants and jump into the water. Google can afford that.

    Agree with you "buggy" comment.

  23. Re: How well optimized is CLANG vs Visual C++ Comp by K.+S.+Kyosuke · · Score: 1

    Maybe poor guessing but correct reasoning. If a large portion of the performance of a modern browser depends on its Javascript implementation, then switching C++ compilers makes much less difference because it doesn't change the Javascript compiler's logic. You'd have to rewrite the JS implementation instead of compiling it with a different compiler.

    --
    Ezekiel 23:20
  24. Re:How well optimized is CLANG vs Visual C++ Compi by jellomizer · · Score: 1

    A big part of a browser is its displaying of the page and details. A lot of this is actually calling the OS layers to do the work. Input Output, Drawing graphics, handling fonts, mouse input... All this stuff is on the OS layer which different compilers may have different tricks to call.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  25. Re:How well optimized is CLANG vs Visual C++ Compi by angel'o'sphere · · Score: 0

    There is no trick in calling OS layers.
    How should that work?

    If your C++ code says: drawRect(r); assuming r is of type Rect, it will be the exact same code regardless what OS.

    For everything that actually is calling the OS a thin C layer in the libraries is used, because it is a difference if you need to to do an "interrupt" or some other way to call the kernel.

    Above the C layers, there is hardly any reason to arrange code different because of different OS's

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  26. Re:How well optimized is CLANG vs Visual C++ Compi by DCFusor · · Score: 1

    They're all optimized for x86...the opsys less so - what func to call in what library to do something is likely done by #ifdef, certainly not the compiler. To the extent there's more than one way to do it, my bet is that the code organization is optimized for Windows, at a design level well above the compilation stage. You might more-usefully wonder how compilers compare on say, ARM...

    --
    Why guess when you can know? Measure!
  27. Maybe that makes technical sense, these days. by Anonymous Coward · · Score: 0

    The choice to use clang makes sense if the following 2 statements are both true:

    * Most end users have more computing power than is being utilized; they won't notice less optimized code.

    * It's important to be able to be able to run the edit-compile-test cycle rapidly; this includes being able to concentrate on ONE development environment.

    1. Re:Maybe that makes technical sense, these days. by KiloByte · · Score: 1

      It's important to be able to be able to run the edit-compile-test cycle rapidly

      Please remind me: which company has the biggest computing power on the planet? And even on a single beefy machine, you can have enough cores to make final link the slowest part. Chrome still uses system linker both on Linux and Windows.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    2. Re:Maybe that makes technical sense, these days. by Bert64 · · Score: 1

      There will be many more users than developers, wasted processor cycles have to be multiplied by the number of users out there...
      This translates to a significant amount of power wasted when spread over millions of devices.
      This also adds up in virtualized environments, if you're running many instances of something than any inefficiencies are multiplied.

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
  28. Historical by Anonymous Coward · · Score: 0

    Isn't that how it's usually been done? I vaguely remember installing an old version of SunOS and, by default, it came with a linker (maybe even an assembler) but no compiler, which was sold separately.

    1. Re:Historical by Anonymous Coward · · Score: 0

      Same as MS-DOS, which came with LINK, EXE2BIN and DEBUG, but not a C compiler.

  29. SPARC by emil · · Score: 1

    Google ought to pour a LOT of love into a SPARC port. The best-situated would be OpenBSD.

    Why, you ask? For the same reason that Microsoft's original target for the NT kernel was MIPS, and x86 was specifically secondary - oddball architectures will force you to clean up your code.

    OpenBSD is also vicious in showing you your use-after-free mistakes since malloc() uses mmap() instead of sbrk() on their platform.

    The other architectures that OpenBSD supports have benefited because some kinds of bugs are exposed more often by the 64-bit big endian nature of UltraSPARC.

  30. Re: Not the smartest move. by Anonymous Coward · · Score: 0

    What kind of analogy is that?!

  31. Re:How well optimized is CLANG vs Visual C++ Compi by Anonymous Coward · · Score: 0

    Calling conventions are different for Windows and Mac OS. This may make some difference in register allocations.

  32. Compilers are like beer... by Anonymous Coward · · Score: 0

    ... so many options and it makes such little difference.

  33. Re:How well optimized is CLANG vs Visual C++ Compi by tlhIngan · · Score: 1

    Why would a tool that emits x86 code on macOS do anything different on windows/x86?

    Because there are platform dependencies. The LLVM backend and annotators are different for Linux, macOS and WIndows, because they use different executable formats (ELF, MachO, and PE). And likewise, debug symbols are stored differently in each format - ELF can be self-contained, I believe MachO has external symbols, and PEs use PDBs (program database) generated during the build.

    PDB support is interesting, because apparently it wasn't well documented, yet used by practically every debugger available for Windows. This resulted in Microsoft actually documenting the format and releasing PDB source code implementation for Clang/LLVM so it can generate files that any Windows debugger can use.

    And there are plenty of Windows debuggers out there so being able to leverage them is quite useful on the platform.

  34. Re:How well optimized is CLANG vs Visual C++ Compi by erapert · · Score: 1

    For everything that actually is calling the OS a thin C layer in the libraries is used, because it is a difference if you need to to do an "interrupt" or some other way to call the kernel.

    There's absolutely zero need to use C. C++ will do exactly the same things (possibly in exactly the same ways) with absolutely no extra overhead compared to C and C++ will do so in an easier, safer, and more readable fashion than C.

    Do not misconstrue my statements to be derogatory toward C or C programmers! I'm simply trying to pedantically point out that there's no need to have a "thin layer of C" between C++ and the kernel.

  35. Re:Not the smartest move. by UnknowingFool · · Score: 1

    I suspect the ability to optimize/fix anything they want with the compiler is a needed feature for them. They can do the same thing with gcc? Not really as it takes a major act of blood sacrifice to change things with gcc.

    --
    Well, there's spam egg sausage and spam, that's not got much spam in it.
  36. Re:How well optimized is CLANG vs Visual C++ Compi by angel'o'sphere · · Score: 1

    And a binary format again has what exactly to do with the llvm code or x86 code emitted by clang?

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  37. Re:How well optimized is CLANG vs Visual C++ Compi by angel'o'sphere · · Score: 1

    Ofc. C and C++ are the same in that area.
    But the libraries wrapping system calls are usually C because they then link with both.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  38. The bazaar of MS-OS compilers by munch117 · · Score: 1

    There always was a plethora of compilers on Microsofts operating systems: Watcom, Intel, Borland, Digital Mars, various gcc ports, and many others long forgotten, not to mention Microsoft's offerings.

    But these days people seem to have borrowed a notion from Unix: "The platform compiler", and have gotten into their heads that Microsoft(tm) Visual Studio(tm) is just that.

    But it isn't! There's no such thing! You just pick whichever compiler you feel feeds the needs of your project. For all the things that suck about Windows development, this is not one of them. There's choice and competition and that is a thing to rejoice about. Do not succumb to the fallacy that because Linux is good, then the cathedral of Linux compiler monoculture is also good.

    And yes, I realise that a lot of these compilers also run on Linux, including Clang, which is sort of the point of the article. I'm just ranting because I'm getting sick and tired of OSS projects that on Windows only works with the latest edition of Microsoft(tm) Visual Studio(tm), because that's what the lead developer happens to use, and the lead developer can't be bothered to write portable code, because apparently Windows is such a magical special case that the normal rules of good software development practices don't apply.

    End of rant. Diversity good! Monoculture bad! Ugh!

  39. Re:How well optimized is CLANG vs Visual C++ Compi by Anonymous Coward · · Score: 0

    About 1/4 the way down the page in that link is "Performance" where they talk about a +/- 5% performance difference depending on the benchmark. So if you trust what they said the performance trade-offs are negligible.

  40. Re:How well optimized is CLANG vs Visual C++ Compi by Dutch+Gun · · Score: 1

    I found Google's motivations here to be a bit interesting. They apparently wanted to use Clang across all their platforms.

    I'm writing a cross-platform PC game using my own game engine. It runs natively on Windows desktop, UWP, Mac, and Linux. About 95% of it is written in portable ANSI C++, and the other 5% interfacing with native APIs. I actually use three different compilers, one for each OS, and I consider this a GOOD thing, not a bad thing. Compiling the same code against three compilers gives me a lot of confidence that when I hit a bug, it's because of my code, not some weird compiler-specific thing. The different compilers also have very minor differences in conformance to the standard, so again, I like having three different compilers check my code for conformance and correctness.

    I understand that it may be nice to be able to use the exact same tools across platforms, but there are also some benefits to avoiding homogeneity.

    Note: as to your question:

    We conducted extensive A/B testing of performance. Performance telemetry numbers are about the same for MSVC-built and clang-built Chrome – some metrics get better, some get worse, but all of them are within 5% of each other. The official MSVC builds used LTCG and PGO, while the Clang builds currently use neither of these. This is potential for improvement that we look forward to exploring. The PGO builds took a very long time to build due to the need for collecting profiles and then building again, and as a result, the configuration was not enabled on our performance-measurement buildbots. Now that we use Clang, the perf bots again track the configuration that we ship.

    --
    Irony: Agile development has too much intertia to be abandoned now.
  41. Now I get the strategic move by 140Mandak262Jamuna · · Score: 1
    I was wondering why Microsoft would help Google help with PDB formats and explain the internals to make it inter operate with Clang. MS does not like other tools to interoperate with MS. It is always one way street,

    Now the strategy is clearer. It is an attempt to dislodge gcc from its perch in the Linux world. One of the very few standard things in Linux is the gcc. Fragment it, tout, one source both linux and windows as target binaries as benefit to woo people away from gcc. They think they MsDev is so good it can take Clang.

    Clever move by Microsoft.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    1. Re:Now I get the strategic move by fxbar · · Score: 1

      Clang will become the standard on linux too I am sure. It is opensource, and the code has a nice modular architecture (gcc architecture is directly from hell, good luck if you want to reuse parts of it for something different, e.g. to create a static analyzer or a refactoring tool).
      Also compare template error messages between gcc/VC++ and Clang. It is just no competition.
      Finally a modular compiler chain so people with more complex problems can adapt the stack as needed. I am happy the 2 monolithic monstrosities (gcc & VC++) we had for at least 10 years too long are finally dying.

  42. Re:How well optimized is CLANG vs Visual C++ Compi by erapert · · Score: 1

    So by "thin C layer" you meant the libs that the OS comes with not a layer within the program?
    I guess I misunderstood you. I'm sorry.

  43. Re:How well optimized is CLANG vs Visual C++ Compi by nadaou · · Score: 1

    Want to know the answer? There's an easy way. RTFA and find out! Amazing but true!

    tl;dr +/- 5%. In some areas Clang does better, in others worse.

    --
    ~.~
    I'm a peripheral visionary.
  44. Re:How well optimized is CLANG vs Visual C++ Compi by angel'o'sphere · · Score: 1

    Yes, suppose you call fopen() in the C library, that boils down to an system call in unix/linux, not sure if they call it system call in Windows, too.
    The calling conventions to the respective "kernels" might be different, the system libraries take care for that.
    Well, in simple words :D

    No offense taken if you misunderstood me, I was bad in explaining.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  45. Re:How well optimized is CLANG vs Visual C++ Compi by complete+loony · · Score: 1

    The point is that chrome dev's can write *and debug* code using visual studio if that's what they prefer. While developers for all supported platforms can submit patches that are less likely to break when compiled for another platform, as they are using the exact same compiler.

    Writing C++ code that works with microsoft's compiler on windows and clang on other platforms adds significant overheads. Microsoft has historically been slow to implement new C++ features completely and correctly in the past, making it much more likely that developers will submit patches that fail to compile on windows.

    --
    09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
  46. Re:How well optimized is CLANG vs Visual C++ Compi by angel'o'sphere · · Score: 1

    You don't need to do anything special to be able to debug any program with visual studio. The binaries only ned debug info.

    Writing C++ code that works with microsoft's compiler on windows and clang on other platforms adds significant overheads.
    For whom? The Clang developers, no.
    The Chrome developers, yes. But that has nothing to do with Clang but with the names of the functions of the system libraries and their parameters.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  47. Re:How well optimized is CLANG vs Visual C++ Compi by complete+loony · · Score: 1

    The binaries only need debug info

    Yes they do, and now clang can produce that debug info in a format that visual studio can read. That was a key piece of development that allowed this change to happen.

    but with the names of the functions of the system libraries and their parameters

    Any developer should be hiding platform differences in isolated code that is only compiled for that platform. If you aren't touching that kind of code, your patch shouldn't break any other platform. The problems of supporting multiple compilers can be much more subtle than that.

    C++ is a complex language, with many small behaviour details either left up to the compiler to define or deliberately left undefined. If you are restricting your code to behaviour that is well defined, you should be fine. However, different compilers sometimes interpret the language spec differently, and exploit the freedom that undefined behaviour gives them in different ways. Code that works fine when compiled with MSVC, might raise an error when compiled with clang, breaking the build for other developers. Developing any large C++ software, and supporting compiling it with multiple different C++ compilers, adds overhead to the day-to-day development of that software.

    --
    09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
  48. Re:How well optimized is CLANG vs Visual C++ Compi by Bert64 · · Score: 1

    Which makes for less portable code...
    You'll have to maintain multiple versions for different architectures (x86, amd64, arm, arm64 etc), and it won't support other architectures unless you also implement a C version as well. Porting to a new architecture becomes a lot more work.

    --
    http://spamdecoy.net - free throwaway anonymous email - avoid spam!
  49. That's not Google's problem. by Anonymous Coward · · Score: 0

    You're not wrong, it just doesn't matter to Google.

  50. VC++ compiler is total shit, happy to ditch it by Anonymous Coward · · Score: 0

    Compare template error messages between VC++ and Clang and you will never want to use VC++ again. Also MS is notoriously slow in getting the new C++ standards implemented right (but at least they got much better at it).
    Finally a modular compiler chain so people with more complex problems can adapt the stack as needed. I am happy the 2 monolithic monstrosities (gcc & VC++) we had for at least 10 years too long are finally dying.

  51. Re: How well optimized is CLANG vs Visual C++ Comp by Anonymous Coward · · Score: 0

    C++ will do so in an easier, safer, and more readable fashion than C.

    You have never actually used C++ apparently and you most certainly haven't had to deal with other people's C++ code. Readability is not a strong point of C++ and is not actually easier to do anything meaningful compared to C.

  52. Re:How well optimized is CLANG vs Visual C++ Compi by angel'o'sphere · · Score: 1

    Code that works fine when compiled with MSVC, might raise an error when compiled with clang, breaking the build for other developers. Developing any large C++ software, and supporting compiling it with multiple different C++ compilers, adds overhead to the day-to-day development of that software.
    Yes, and that is why many companies actually do compile the code with different compilers on build farms to see if it compiles and run the tests against different binaries. Heck, many even use just one compiler but try to see if the tests run on all optimization levels.

    My point was: as soon as you have a platform specific binary (e.g. windows or linux), then all debuggers on that platform can debug it. So there is nothing special missing or suddenly there.

    Clang runs in windows since quite a while, probably since 2014 or even before. That was not the news.

    The news is: Chrome is now build with Clang and no longer with MVC++ ...

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.