C++ Needs to Catch Up, and Fast

(vinniefalco.com)

63 points | by simonask 1 hour ago

12 comments

  • nly 45 minutes ago
    C has most of the same problems raised in the article. You'll notice there's no "C SDK" on all those third party SDK lists either. There's no universal package manager for C. No standard library worth a damn.

    My personal view is APIs and behaviours should be standardized, not libraries. In that respect C++s efforts to figure out universal async I/O is a noble one unmatched by other languages. And it's a hard problem.

    That's not to say it hasn't gone off the rails. The Sender-Receiver model has never 'clicked' for me. I think the ideas is alien and overly abstract and I've never seen anything elegant fall out of it on a single page. Coroutines on the other hand make sense. The C++ language implementation of them is elegant and versatile.

    std::execution is a verbose mess.

    At my employer pretty much all of our code is C++ and threads aren't used anywhere. As a result, I/O tends to go through our own APIs written to use an Linux ioring backend behind C++ coroutines, which yield to our own main event loop.

    • whizzter 11 minutes ago
      Kinda disagree here about the "elegantness", superficially it's an elegant abstraction to unify generator-like coroutines and "tasks".

      In practice it's bad, a generator (co_yield) is often an encapsulated object that will have a non-deterministic lifetime, thus it cannot be put into a fifo.

      "Tasks" however (co_await / co_return) often live on a stack-fifo that could've been mixed with partial bump-allocators to allow pointer-stability for the stack-frame (there is kind of the machinery via the new overloading for the promise), but due to varying lifetimes it easily becomes a mess (Looked at some other task library that seemingly had low allocations like this but it feels like the entire machinery can easily break with "careless" usage).

      And I think that's a part of why std::execution feels like a mess, it tries to make coroutines in task settings more "usable" for those writing things around tasks, but it doesn't really decide on a coherent direction for tasks (since the language primitive was left too abstract/messy).

      • nly 3 minutes ago
        I'm not really familiar with the generator use case. I've never really had much use for them. I've used co_yield once successfully to interleave two separate tree recursions in lock-step and I don't remember any issues.

        It's also not at clear to me why you'd want to put a generator into a fifo. Any succinct code snippets that demonstrate the issue?

  • filipdobro 1 hour ago
    > Dependency friction in C++ is so punishing that authors advertise “header-only, zero dependencies!”

    This article kinda sums up all frustrations I have with C++. Vcpkg seemed like a good fix at the time, but it needs so much more improvement and adoption.

    A lot of good solutions to the raised issues in the article require us to rip the bandaid off, however I believe the community built around C++ has built their systems around the premise that it must remain stable and predictable.

    • mort96 33 minutes ago
      I can not express how disinterested I am in using a Microsoft Visual C++ package manager. There will always be a large contingent of C++ users who won't touch vcpkg with a 10 foot pole.

      Anyway I don't understand the aversion to just using submodules. What we need is a decent standard build system, not a package manager. We have CMake which is wide-spread but garbage, and we have Meson which is pretty good but not as widely adopted. If every library had a meson.build file I'd be mostly happy with just having submodules to them in my subprojects/ dir.

    • happyweasel 10 minutes ago
      Vcpkg solved most of my problems in a windows env - vs+msbuild+vcpkg in manifest mode. It is also not really intrusive, just one json file. Auto link is very useful. I am very happy when I see a dependency is available via vcpkg.
    • egorfine 6 minutes ago
      Unfortunately, vcpkg is not available for operating systems, it's a windows-only solution.
    • pjmlp 52 minutes ago
      My only pain point with vcpkg is the team's reluctance, or lack of resources (in a 4 trillion valued company(!)), to make the experience at least as nice as using NuGET, across VS and VSCode.

      Note that Clion does exactly this for vcpkg.

  • IshKebab 2 minutes ago
    Let it die.
  • im3w1l 1 hour ago
    One approach to consider for C++ would be for the community to adopt nix as the unofficial package manager. I think it could work very well for this. AI is like a gift from heavens for Nix, much more accessible now that you can ask for help with changing your config. And if you are a windows shop, maybe try wsl out its pretty good.

    > Wiring axum, reqwest, serde, jsonschema, and rmcp takes 300 lines of idiomatic glue and compiles before lunch;

    Ironically I have much higher expectations nowadays. When telling a model to make a hello world-tier project with some technology I expect it to add the dependencies compile and run in like 5 minutes tops

    • arximboldi 31 minutes ago
      dunno why you were downvoted, I agree with you and really wish this happened.

      but to he fair, the Windows story would really need to improve for this to be realistic---one would need to be able to build Windows native packages, not just WSL. even the OpenGL story is unsatisfactory when developing graphical apps to be distributed as binaries on Linux. these are sadly not easy to fix and it would require a company to really believe in the vision and drive these investments.

      • im3w1l 21 minutes ago
        You could cross compile I guess. I haven't actually tried that though, so I can't speak for how smooth the experience would be.
  • throw93933944 17 minutes ago
    I tried Rust for GUI dev (mainly QT) and quickly gave up. With LLM there is no need to migrate from C++ or Python, I barely read code, and it is memory safe by code audits.

    I do not want to fight with half baked alpha quality libraries and bindings.

    • adrianN 15 minutes ago
      code audits do not make code safe
      • throw93933944 6 minutes ago
        I replaced borrow checker in rust with small markdown file, code annotations, python script, and LLM pass. It costs $5 per build on 200k lines. I will leave it there.
  • Woshiwuja 28 minutes ago
    [dead]
  • 3form 8 minutes ago
    Seeing the article title I was wondering, why do we need C++ to become another language like the others?

    After opening the article, to paraphrase: "we need it so that it's easier to write the code that doesn't need reading".

    I would say that if that's the premise, why would anyone need C++ to begin with? Just write the whole thing in Rust then like you did? There are many good changes mentioned and many I would like to see happen, but just because they are good changes, not because the language should work better with AI.

  • pjmlp 1 hour ago
    C++ had a sweet frameworks spot when I learnt, Turbo Vision, Object Windows Framework, MacApp, PowerPlant, CSet++, Motif++, Tools.h++, POET,...

    The ISO C++ group decided on a bare bones standard library for C++98, a thin layer on top of POSIX, with iostreams, and a last minute addition of Stepanov's HP STL on top, that only became developer friendly with C++11 lambdas instead of C++98 functor approach with operator() overloading.

    To this day people are fighting to add into the standard library, basic stuff already covered by those 1990's C++ compiler frameworks, like string handling, networking protocols, UI frameworks,....

    If only we had some kind of package management systems that could sort it out instead, and we do, but since ISO C++ does not acknowledge their existence, neither do most C++ shops, each project keeps their own approach, thus library writers have to decide with bubble their want to sponsor, or neither of them, leaving the integration challenge to the users themselves.

    However, how much of this is still relevant when we have a tiny offshore team inside our graphics card, remains to be seen.

    • raverbashing 29 minutes ago
      > a thin layer on top of POSIX, with iostreams

      Honestly iostreams was the writing on the wall on how C++ would fail

      That thing is horrendous

      Yes the proprietary libs were done (mostly) ok, and Borland outshone there (no wonder Anders went to work on C# later)

    • drysine 1 hour ago
      >To this day people are fighting to add into the standard library

      Why would anyone want to fossilize libraries they use by codifying them in the standard?

      • pjmlp 54 minutes ago
        Because in many companies that is the only way around procurement for third party dependencies, there is no cowboy programming "something install".

        And in C++ case, due to how package managers have grown up between OS package managers, conan, vcpkg, CMake find package,.... it adds yet another set of variables besides legal, IT, availability on Artifactory/Nexus/....

        Also fossilised libraries are better than having none at all.

        • tialaramex 25 minutes ago
          Not just companies. FreeBSD takes C++ in base, and so if you can cram your Rubik's Cube solver into the C++ standard library, maybe just by issuing a new paper proposing the same Rubik's Cube solver for every. single. WG21. meet-up until they relent and add it to the library, now every single FreeBSD install has your Rubik's Cube solver as a core feature. Hilarious.
  • attila-lendvai 1 hour ago
    i used to know everything about C++... what a waste!
    • drysine 1 hour ago
      Nobody knows everything about C++
  • mk89 33 minutes ago
    My experience with LLMs: by default they choose Rust (backends, clis, etc.), Javascript (front-end), or Python (scripts, etc). .

    It's hard to catch up when new software is vibecoded.

    • unglaublich 20 minutes ago
      And why wouldn't they? All these languages have quite good error-reporting, linting and static analysis, debugging and runtime introspection features.

      With C++, you first have to resolve your linker and crypting template compilation errors, wait forever to build an app, get a debug build, attach a debugger, and navigate even more cryptic symbols and stacktraces.

      The core language requirement for agentic software development is that the iterative loop is fast and informative. Apply small delta; feedback; loop. The loop in C++ is too involved, slow, and uninformative.

  • tontinton 56 minutes ago
    Or not? who cares about deprecated tech?
    • dwb 21 minutes ago
      Deprecated by who?
    • adev_ 45 minutes ago
      > who cares about deprecated tech?

      The "deprecated tech" is probably powering multiple devices with you in your room right now. Multiple airplane passing ion top of your head right now and the cars in front of your street.

      There is tremendous incentive to modernize and support C++ for the next 20y.

      The world is more complex than "Judt rewrite in Rust".

      • TuxSH 10 minutes ago
        Also the Nintendo 3DS and Nintendo Switch 1 and 2.

        It's pretty nice for dependency-less monorepos.

    • WelkinFolk 53 minutes ago
      Tonnes of people do. Some, purely so because they love it.

      Strange POV to have towards anything.

      • rapsey 43 minutes ago
        I think most are bitter for developing skills over decades that have been made irrelevant in Rust based codebases that are becoming ever more popular.
        • hnav 24 minutes ago
          Knowing C++ is a huge leg up when picking up Rust since you already understand memory ownership. There's also a problem in the Rust community in the sense that a lot of it is dilettantes from the ruby-on-rails world.