Hacker Newsnew | past | comments | ask | show | jobs | submit | teh's commentslogin

I feel almost every single point in this article. I spent the last 5 years of my life fighting c++ in a finance place. Something that should be a 20 minute job becomes 20 minutes & several hours of cmake because abseil in some deep dependency does c++ version detection and segfaults because std::string_view isn't compatible with its own version.

What makes this worse in finance is that you sometimes only get a binary library to link against so you have to add another 2 days to run the library in a subprocess with some kind of rpc interface on top because it's not link compatible.

I can't speak to the standardization saga but IMHO that really feels like they are arguing over areas that ultimately should be in libraries and where the exact details don't matter that much. There are interesting areas like verification (rust verus e.g.) where c++ contracts might help but by the time I'm getting value from that years will have passed when I can have 3 different tools right now in rust.

c++ has the weight of history and many large projects like llvm etc I can really tell the dam finally broke. I am currently interviewing and number of companies now have or are starting rust teams to replace their internal c++.

I think the author thinks it's possible for c++ to catch up but IMHO it's too late for that now. There are too many people like me who have burnt years on c++ and don't really want to go back.


> Something that should be a 20 minute job becomes 20 minutes & several hours of cmake because abseil in some deep dependency does c++ version detection and segfaults because std::string_view isn't compatible with its own version.

> I can't speak to the standardization saga but IMHO that really feels like they are arguing over areas that ultimately should be in libraries and where the exact details don't matter that much.

The string_view issue is directly related to the lack of common functionality in the standard library. Holes like that deeply damage the ability for libraries to interoperate.


As polyglot dev, I think hardcore C++ devs, don't really get how much better it could have been, if there was more effort placed into ergonomics.

What made me like C++, coming from Turbo Pascal, was the mix of Borland IDEs, the C++ frameworks, and how to have something closer to Smalltalk ideas, while having performance and being at home in UNIX environments without having to deal with the usual C issues.

Frameworks like OWL, CSet++, VCL, show how to have a .NET/Java like productivity, years before they were invented, while using C++.

However that isn't where the hardcode community wants to be, thus those of us that care find home elsewhere.

Additionally, AI agents make the desire to control every bit on application executable now seem out of place.


> c++ has the weight of history

It's a heavy burden. On the road to mastery, every apprentice developer must learn to manage the flaws of the tool chain and language.


I think it's less about having to learn, and more about having to re-do the work for every project. It's not like you just master CMake once, and from then on adding any new dependency with proper cross-compilation, incremental linking, test suite integration, static analysis, etc. only takes 5 seconds.

(Also, let's not have "you just have to master the toolchain" and "every language has its flaws" stand in the way of making a better toolchain)


> several hours of cmake because abseil in some deep dependency

The hours I've spent in CMake trying to get an instance of Abseil to play nice with an instance of Protobuf (which uses Abseil), an instance of gRPC (which uses Protobuf), and an instance of LibTorch (which uses Protobuf)... To this day, I don't know if my CMake was bad or if theirs was. Maybe both.


Sounds like you’re reconstructing a snapshot of google3

cmake is just a wrapper that generates build commands. If it's not working for you, you can use something else

I was at an LLVM contributor dinner party the other day, build systems came up in conversation, and nobody but me seemed familiar with XMake. The consensus was that the best options are either CMake or Bazel, both of which have many haters and lack each other's features. I think XMake today is mostly really good, very close to being objectively the best in the ways I care about, but if most experts don't know it well, surely beginners will not usually discover it.

Like any abstraction, you should start by doing it manually until you understand how it works, then automate it

I know a ton of people doing buck2.

>If it's not working for you, you can use something else

That's one of the points made by TFA: cmake sucks and is annoying, and every library seems to use it, so by and large people are choosing to use something else. The something else they're choosing, however, is a different programming language with better build and packaging ergonomics.


"Claude, deal with this shit" works just fine. Usually.

ive gone to war with cmake to the point that i was convinced there was some deep temp cache file hidden on the pc that nobody knew about.

Ive had cmake problems that werent fixed by a clean and rebuild, or a nuke of the entire cmakecache, but instead by re-cloning the entire project. it make no sense.


Sound about right.

I once couldn't get latest - 4 CMake to find OpenGL on Ubuntu latest - 2. Not latest stuff granted, but OpenGL's location on Linux is pretty clear-cut - I checked the CMake built-in stuff to find it and it all looked fine, but no luck, so I just hard-coded an extra path.


I'm 99% sure this was because of some errant generated file that was placed deep in your source directories due to a badly written cmakelist.

If you ran git clean -fdx (careful, this nukes everything untracked in your tree) that would have fixed the build.

Then next step would be to find that bad cmakelist and make it generated files in the build directory instead and not the source dir, so it wouldn't interfere with the build.


Sounds like a way to subtly mess up CI.

The funny thing is that after ALL that hoopla, C++ stdlib is actually smaller than Rust std. Rust has TCP networking, UDP networking, IP address manipulation, Child process management, Environment variables, Concurrent channels, Unicode-aware strings, proper Futures, limited Date and calendar operations, Lazy iterator pipelines.

Incoming: Rust allocators, std::random, std::simd, ByteStr, ByteString, zerocopy (longer term)

Rust just moves far faster than C++ standardization.



Yes, C++ by design wants to keep its standard library small and tractable, and for the most part agnostic of volatile parts such as hardware or OS kernel advancements. In a programming language that is laser focused on high-performance this is a feature.

And you really try to make it sound as if having those libraries in stdlib is something extremely special. It is not. Two different trade-offs. One just needs to pick one that suits themselves more.


TBH however C++ has locales, time, random, regex, multi-dimensional array spans, simd and more.

std::chrono is genuinely good C++! Very well designed.

So is std::mdspan - another well-designed abstraction. (Just wish it did more like NumPy-style broadcasting or array expressions, but probably asking for too much)

std::locale has poor antiquated design (even when it was introduced!) and inadequate Unicode support. Nobody uses it.

std::random - very poor. No guaranteed cryptographically secure random-number generator. Outperformed by most implementations. And a bunch of other issues that I don't quite recall now. (seeding, etc))

std::regex - the biggest and saddest joke of the programming world, even when it came out! Beaten by the slowest, interpreted languages. A high-schooler could write a more performant library even without AI support. Feels like it got approved when someone was on a bender.

(std::simd - can't really comment, since I am yet to personally use the shiny C++ 26 feature. However, some people hate it https://lucisqr.substack.com/p/c26-shipped-a-simd-library-no...)

This is why C++ desperately needs a deprecation and "mythical-ABI break" release, where the only thing that happens is that legacy features are removed and fixes are made..


The function of std random is primarily to describe the grammar of RNG, and imo it gets this right where almost everybody else gets it wrong. It doesn't compose with SIMD unfortunately, and it would be nice if it provided useful generators out of the box, maybe even cryptographic ones too, but it's still important that it tells C++ users not to make some global rand() function.

Nothing your criticizing requires an ABI break

Inline namespaces mean all of those libraries could be replaced/improved in a binary compatible fashion.


Unfortunately it does, because some of them are exposed in C++ standard libraries used as dynamic libraries, and then you have vendors like Microsoft that since 2015 refuse to break ABI.

There are even C++ features not implemented in VC++, because they would break VC++ ABI in doing so.


The rust "editions" solution would probably work with C++. Make a new 202x edition which removes broken APIs, but keep the old editions around in the compiler because you have to. Add features to new editions and not old editions.

I've got no confidence, though, that C++ can make such a change. It's leadership is just too fragmented and has a lot of old leaders that likely don't agree that any of this is a real problem.


From what I've heard then you break ABI compatibility, which is a no-no for compiled binaries, but not an issue when you compile from source.

C++ doesn't have ABI compatibility, except via C externs.

And since you'd still be maintaining those old APIs, it's not as if they disappear, they'll still be ever present in libc++. The main difference is that the compiler will reject new code which tries to reach for those old APIs.


C++ ABI allows to ship shared/dynamic libraries with C++ classes, virtual methods and template implementations. Rust besides using C-ABI does not have a good story preventing using Rust in quite few niches.

The C++ ABI is only somewhat guaranteed by the specific compiler used. You can't, for example, use C++ classes that were compiled by GCC in MSVC.

Heck, you often can't do things like use C++ classes compiled by GCC 13 in GCC 16. This is the reason the likes of COM [1] exist.

Having editions does not change this reality.

What rust is doing that C++ isn't is frequent releases that change the dynamic semi-regularly. GCC 16 will stick around for a few years and will largely be compatible between minor releases. Rust 1.100 and 1.101 can be completely incompatible if they, for example, bump up the llvm version used under the covers.

[1] https://en.wikipedia.org/wiki/Component_Object_Model


> Heck, you often can't do things like use C++ classes compiled by GCC 13 in GCC 16.

That's patently false.

In practice, there are two extant C++ ABIs, the MSVC ABI (used by, uh, MSVC, and clang when compiling for MSVC compatibility) and the Itanium ABI (used by everybody else). Historically, compilers used their own ABI, but when Intel was pushing hard for Itanium, one of the things they did was make the C++ ABI part of the platform ABI (hence why it's called the Itanium ABI), and since gcc was already looking to tweak their ABI for other reasons, they adopted Itanium ABI for all the architectures in GCC 3, about 25 years ago.

Now, there's definitely going to be bugs if you do weird ABI stuff, especially with compiler extensions in the mix, but you can expect the vast majority of C++ code to be ABI-compatible between, say, GCC 4.1 and GCC 30 and everything in between. (And yes, I'm aware GCC 30 doesn't exist yet.)


To be fair to gp, ABI commonly not only refers to the Itanium/MSVC ABI but also to the binary interface derived from the standard libraries via those system ABI specficications. And that binary inteface depends on both the ABI specification as well as the standard library types. It's the latter where incompatible changes have been made much more recently, the "recent" really noticeable one being std::string breaking compatibility for libstdc++ with C++11 and of course MSVC never made any ABI compatibility between their major compiler versions until reltively recently.

It was proposed several years ago, using Rust’s original name, “epochs.” The authors burned out.

Do you even understand what it means to break the ABI in a programming language that has been used to write 100+ billions LoC which serve as the backbone for the most crucial production systems nowadays?

Production software that depends on "slow" std::regex or "slow" std::unordered_map or "poor" std::random or <insert your favorite C++ pet peeve>, will, I assure you, under right incentives replace it with their own mechanism at any given time because (1) production cannot wait for the next incantation of std library implementation, (2) production is not a playground for a rolling-wheel like distribution games, and (3) who guarantees that the next version you're waiting for is going to be fit for your problem at hand anyway?

All this break-the-ABI bs really makes no sense for production grade software that runs at scale, and arguably this is all that it matters within this context.


The Standardization Committee needs to get its priorities in line and solve problems that people actually have, instead of niche problems that corporations have. "Contracts" and "std::execution" are not going to help us build the tower of library abstractions.

The chances of the former happening after the latter has become common is pretty low. This is what regulatory capture looks like when it hits a standards body.

Have you heard of C++ Frequently Questioned Answers [sic] and how exceptions from STL constructors can force you to leak memory? The C++ rabbit holes fold in on themselves.

Now Abseil is a kind of loopy rabbit hole, as well.

At least C++ will trap AGI. No way to escape.


why go back when zig and odin are excellent? besides theyre going to run out of characters for syntax soon

The readme says: "Small and dependency-light. Pure Rust, built on lopdf, pdf_oxide, rten, and friends.", and paperpilot-pdf/Cargo.toml confirms that.


FWIW I am using gnome 49 and 3 finger swipe works out of the box on my asahi macbook linux.


benbye - do you have any intuition why the model only needs 4 frames to work? I played with LeWorldModel and I am mystified why the latent prediction frame number is so small. It's an almost Markov like property where a short history is packaged as state.


I sometimes wonder how much of intelligence is being good with tools.

I feel pretty averagely smart but give me some good tooling like a good editor, a good type system, semantic grep, good testing and some solvers and I can actually deliver some work.

Maybe the trick isn't 500 billion parameters but a model super integrated with the task at hand for iteration and debugging?

FWIW the article really mirrors my own experience. I can run a small gemma4 for quick edits (and it's fast!) or data cleanup but for other tasks you do need a different tool (claude).


Another useful "Emergency exit" is CTRL+Z which stops the process and cannot be intercepted.

It's often faster than hitting CTRL+C and waiting for process cleanup, especially when many resources are used. Then you can do e.g. `kill -9 $(jobs -p)` to kill the stopped tasks.


All of the keyboard-driven terminal signals can be intercepted; catching INT (^C) for cleanup is just more common than the others. Only KILL and STOP cannot be caught.

^Z sends TSTP (not STOP, though they have the same default behavior) to suspend; some programs catch this to do terminal state cleanup before re-raising it to accept the suspension. Catching it to do full backout doesn't make as much sense because the program anticipates being resumed.

^\ sends QUIT, which normally causes a core dump and is rarely caught. If you have core dumps disabled (via ulimit -c 0 or other system configuration) then you can often use it as a harder version of ^C; this is how I would tend to get out of ‘sl’ in places where I found it unwantedly installed.


ctrl-z pauses the process, it doesn't terminate. I think of z as in zombie as you can then run fg to bring it back from paused state or as you suggested kill in it for good


For the most simple case of a single job, I use the job number (`[1]` in the example) with %-notation for the background jobs in kill (which is typically a shell builtin):

    $ cat
    ^Z[1] + Stopped                    cat
    $ kill %1


Super useful tool but need to be aware that this is reading potentially untrusted input (e.g. in the case of http request logs) and written in c++, so a possible attack vector. I use lnav where I trust the logs, but do wish a safe implementation existed.


Memory safety doesn't mean it's safe. And C++ doesn't mean it's unsafe.

Browsers are in C++, do you not use them? Curl is in C, do you not use it? Kernel is C...


"Memory safe" means that there are no memory safety issues. One of the most critical areas targeted by exploits is just gone. And this in turn leads -- according to the numbers published by Google -- to a severe reduction of exploitable issues.

C++ means you can not know whether code is safe or not. That does not mean it is unsafe, but assuming it is is the only sane way to handle this. Incidentally this is exactly what browsers do: They typically require two out of these three to be true for any new piece of code: "written in a memory-safe languge", "sandboxed" and "no untrusted inputs". This blocks C++ from some areas in a browser completely.


Chrome uses sandboxing and a lot of safe tooling (wuffs, rust) for untrusted data.

curl is heavily fuzzed and you still mostly control what you are downloading unless the target is compromised.

With logs the attacker controls what goes into your logs.

And you don't need to really look very hard, there are a fair number of very recent stack and heap overflows: https://github.com/tstack/lnav/issues?q=is%3Aissue%20heap%20...


There is precedent: with type checkers like pyright you can opt into specific checks, or have a basic, standard, strict setting, each expanding the set of checks done.

How would dependencies work in this schism? E.g. if serde starts using named impls, do all dependencies have to use named impls?


I can't fully answer your question but I did once spend about a week porting plain internal configuration to cue, jsonnet, dhall and a few related tools (a few thousand lines).

I was initially most excited by cue but the novelty friction turned out to be too high. After presenting the various approaches the team agreed as well.

In the end we used jsonnet which turned out to be a safe choice. It's not been a source of bugs and no one complained so far that it's difficult to understand its behaviour.


I feel you (like many people) got burned by the steep learning curve. Empirically some pretty high powered companies use nix successfully. It's of course always difficult to know the counterfactual (would they have been fine with ubuntu) but the power to get SBOMs, patch a dependencies deep in the dependency stack, roll back entire server installs etc. really helps these people scale.

nixpkgs is also the largest and most up to date package set (followed by arch) so there's clearly something in the technology that allows a loosely organised group of people to scale to that level.


NixOS has very limited usage, with few companies adopting it for critical or commercial tasks. It is more common in experimental niches.

One of the main issues with nixpkgs is that users have to rely on overlays for a package. This can lead to obscure errors because if something fails in the original package or a Nix module, it's hard to pinpoint the problem. Additionally, the overuse of links in the directory hierarchy further complicates things, giving the impression that NixOS is a patched and poorly designed structure.

As someone who has tried Nix, uses NixOS, and created my own modular configuration, I made optimizations and wrote some modules to scratch my own itch. I realized I was wasting time trying to make one tool configure other tools. That’s essentially what NixOS does through Nix. Why complicate a Linux system when I can just write bash scripts and automate my tasks without hassle? Sure, they might say it’s reproducible, but it really isn’t. Several packages in NixOS can fail because a developer redefined a variable; this then affects another part of the module and misconfigures the upstream package. So, you end up struggling with something that should be simple and straightforward to diagnose.


I know it's not a proper measurement, but I can't remember the last time I missed something in AUR, but in my short time on NixOS I missed 2 apps and 1 app that disappeared in the NixOS channel upgrade.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: