Slashdot Mirror


LLVM's Libc++ Now Has C++1Y Standard Library Support

An anonymous reader writes "LLVM's libc++ standard library (an alternative to GNU libstdc++) now has full support for C++1y, which is expected to become C++14 next year. Code merged this week implements the full C++1y standard library, with support for new language features in the Clang compiler frontend nearly complete." GCC has some support for the soon-to-be standard too. The C++ standards committee is expected to produce a more or less final draft in just a few weeks. The LLVM and GCC C++14 status pages both have links to the proposals for the new features.

19 of 161 comments (clear)

  1. !GNU/Linux by Dimwit · · Score: 5, Insightful

    Now that Clang/LLVM has got this finished, I'm wondering what a system would look like with:

        * Linux as the kernel
        * Clang/LLVM as the system C/C++ compiler
        * Heirloom Toolchest as the basic userland toolchain
        * Wayland as the underlying display system
        * musl as the system C library

    That would be Linux, but would contain almost no GNU code. Not that I have anything against GNU, but the Heirloom Toolchest, Clang, and musl are all more standards compliant, smaller, and often faster than their GNU counterparts. I wonder what a Linux distribution like that would look like. I'd use it.

    (I hate how "GNU's Not Unix!" is really becoming more and more true. Unix was about minimalism, and sometimes GNU seems like it's about stuffing everything possible into every tool.)

    --
    ...but it's being eaten...by some...Linux or something...
    1. Re:!GNU/Linux by iluvcapra · · Score: 4, Interesting

      (I hate how "GNU's Not Unix!" is really becoming more and more true. Unix was about minimalism, and sometimes GNU seems like it's about stuffing everything possible into every tool.)

      If they didn't, it'd be easier for people from the proprietary and BSD-compliant-license land (like Apple and Google) to circumvent the spirit of the GPL. As long as you have to link into their code, or copy and paste it, they control what you can do with it. If you can just invoke whatever little piece of GPL code you want with arguments, you can progressively replace their tools without adding anything back to the original GCC tools -- if you can code around a bug in GNU project without submitting a patch to that project, that's adverse to the opening of the code in the first place. GCCs middle end is intentionally blurry, and not modularized into a separate tool, to keep people from taking their own parser and bolting GCC's optimizations onto it, just as an example.

      It follows that that changes to the tools, and the process of creating the tools, thus stays under the political thumb of various FSF-aligned BDFLs.

      --
      Don't blame me, I voted for Baltar.
    2. Re:!GNU/Linux by sl4shd0rk · · Score: 2

      I'm wondering what a system would look like with

      Sounds like your describing OSX

      --
      Join the Slashcott! Feb 10 thru Feb 17!
    3. Re:!GNU/Linux by TheRealMindChild · · Score: 2

      And GNU/Linux was a term coined by Stallman, probably because he may have been getting antsy about there not being an official GNU kernel yet, and so he figured he'd just appropriate another one without actually asking anybody

      It is very appropriate, but at the time, a whole lot of people counldn't understand why. Now you have Android. Linux kernel without the GNU userland. GNU/Linux and Android are not compatible

      --

      "When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
    4. Re:!GNU/Linux by mark-t · · Score: 2

      No... it's not appropriate. It completely misrepresents the origins of LInux as having anything to do with the GNU project.

      Linux was GNU licensed, but was not *ever* part of the GNU project. If GNU made a distro of LInux it would be reasonable to call that distro GNU/Linux, but afaik they do not. The term would still be inapplicable to other distros, however.

    5. Re:!GNU/Linux by mark-t · · Score: 2

      Nobody will argue that the utilities that came with Linux were all GNU, but that does not make it GNU/Linux any more than the system that I used while I was at university should have been called GNU/HPUX because the system administrator had replaced all the standard HPUX tools with GNU ones.

      Linux was originally developed with and for the tools that came with Minix at the time... almost all of which were also GNU, but nobody ever called Minux GNU/Minix. It's more the case that the GNU tools were ported to Linux just as they were to Minix.

    6. Re:!GNU/Linux by stenvar · · Score: 2

      Not that I have anything against GNU, but the Heirloom Toolchest, Clang, and musl are all more standards compliant, smaller, and often faster than their GNU counterparts

      They also lack tons of useful features, and a lot of stuff simply wouldn't run on such a system.

    7. Re:!GNU/Linux by lgw · · Score: 2

      The GNU project is forcing a separation between the GPL world and the BSD world. Mainstream Linux will follow the BSD path. That will marginalize the GPL world over time, IMO.

      It follows that that changes to the tools, and the process of creating the tools, thus stays under the political thumb of various FSF-aligned BDFLs.

      I believe a heavy hammer is descending towards said thumb.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    8. Re:!GNU/Linux by iluvcapra · · Score: 2

      I think it was always contingent on who uses the software and who develops it. For a long time GPL-land was superior because it could collect a lot of small developers' free time, and these people were developing tools for their own use, thus they all had incentives to stay within the ecosystem and they all benefited.

      In a world where large corporations are pouring hundreds of paid developers into OSS projects, using the OSS licensing not for ideological reasons but for business model reasons, the GPL paradigm has a lot of trouble competing, particularly on tools where the set of people who are users is much larger, or mostly disjoint, from the set of people who are developers.

      The political stuff in GPL-land is a symptom of the ideological mission, and the perception on the part of many misguided BDFLs (by no means all of them) that they're the only game in town and they don't have to compete for coder-hours with other projects.

      --
      Don't blame me, I voted for Baltar.
    9. Re:!GNU/Linux by Zero__Kelvin · · Score: 2

      You're logged into it.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    10. Re:!GNU/Linux by dfghjk · · Score: 2

      Nothing in the GPL stipulates that the FSF gets to rename your project if you use some of their code. It has only occurred in this case due to Stallman's jealousy and no one should entertain his ego. GNU/Linux is a term that should be universally rejected, software freedom demands it.

  2. Re:Until it's ubiquitous, it's still a no go... by ledow · · Score: 2

    Surely those sort of decisions first need a case where - despite all efforts to the contrary - there's something that can't be done as easily any other way as it could if you moved to a new C++ standard.

    That's my biggest problem with most of these standards - quite what they add is hard to define, especially when the problems you point out are taken into account. Is there really anything in such a standard that couldn't be replicated by the programmers quite easily enough (or close enough), and would actually save more effort that it would take to create?

    Until you find a use case that is advantageous for the exact type of things you do everyday (and which you cannot replicate simply via alternate methods), it's probably best to stay where you are.

  3. Re:GNU excitement by Anonymous Coward · · Score: 3, Informative

    Faster at compiling at least. And there's lots of code floating around that was compiled in GCC version 4.3 or earlier - Clang/LLVM-compiled code runs circles around that. GCC had a huge speed boost at version 4.4 which took time for LLVM to catch up to. The latest version of LLVM is actually very competitive against the latest GCC except where the GCC code makes use of OpenMP (which LLVM is still busy implementing).

  4. Re:GNU excitement by KiloByte · · Score: 2

    The latest version of LLVM is actually very competitive against the latest GCC except where the GCC code makes use of OpenMP (which LLVM is still busy implementing).

    For the values of "competitive" of "around 1 level of optimization slower" on the average (although particular cases vary widely). Granted, gcc tends to compile around that level of optimization slower in return, but for production code, you compile once run many.

    And on the high end of optimizations... gcc compiles one piece of code with LTO in 40 minutes on a 256MB raspberry pi, while clang OOMed after several hours on my main box (8MB ram + 8MB ssd swap).

    And comparing current clang with ancient gcc... what's the point? Newsflash: modern gcc runs circles around that too.

    --
    The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
  5. Re:GNU excitement by Sectrish · · Score: 5, Interesting

    Now that Clang/LLVM has got this finished, I'm wondering what a system would look like with:

    ... * Clang/LLVM as the system C/C++ compiler

    Slower

    I'm developing a tiny game engine in C(11) and I've built profiling into the core, and I profile many of the math-heavy parts separately as well. Clang 3.3 actually almost always does better than gcc 4.8 here. Not by much, but there you have it. You should take a look at the SLP vectorizer, which will come enabled in -O3 as of Clang 3.4 but can already be enable separately with -fslp-vectorize.

    So for single threaded code I'm already leaning towards Clang. OpenMP is going to get integrated as well, as of then, all bets are off. Exiting times to be a C/C++ dev... (or any other kind, for that matter, LuaJIT never ceases to amaze me).

  6. Re:Everytime I read about C++1Y.. by K.+S.+Kyosuke · · Score: 2

    .. I want to start hacking around with it. But then I remember how much I love and I just don't care anymore.

    I gave up on C++ after I realized how much it confuses the problem of writing efficient software with the problem of giving you individually very efficient components that you're free to combine in ways that are either elegant, or efficient, but not both at once. I feel like it's 1970's all over again when I look at C++ code. Virtually *any* piece of C++ code, for that matter. There are better things one can do with one's life than endless psychological self-harm.

    --
    Ezekiel 23:20
  7. A wrap-up of new features by jones_supa · · Score: 3, Informative

    If you are interested, the GoingNative 2013 talks include a C++11/14 Sampler by Scott Meyers.

  8. Cat on the keyboard by xQx · · Score: 3, Funny

    "LLVM's Libc++ Now Has C++1Y Standard Library Support"

    Seriously, is that a real headline, or did your cat just walk across the keyboard?!

  9. short term thinking is stupid by cas2000 · · Score: 4, Insightful

    it really doesn't matter whether clang/llvm catches up to gcc or not in terms of speed or any other feature.

    the crucial issue is what's strategically best for the long term interests of free software, and there is no way in hell that a compiler developed by the Lords of the Walled Garden at Apple is ever going to be a good thing for free software.

    Apple's agenda is to sabotage copyleft and the GPL, because they want the benefits they can get from free code from tens of thousands of developers but without having to pay the entirely reasonable price of distributing and freely licensing the source along with any modified binaries.

    The fact that Apple has been - and still is - smarter than Microsoft in their anti-free-software campaign just highlights how dangerous they are. Microsoft took the stupid head-on approach to attacking free software. Apple's method has been stealthy subversion and erosion of principles. smart, competent evil is far worse than stupid, incompetent evil.