Top
Best
New

Posted by simonask 9 hours ago

C++ Needs to Catch Up(www.vinniefalco.com)
185 points | 188 commentspage 2
naikon 6 hours ago|
I agree completely.

Memory safety is low on the totem pole for usability. I mean sure, it would be nice to have, but it doesn't reduce development friction in a meaningful way.

Standardization around the distribution of libraries and build process would be a game changer for C++.

My preferred stack right now is cmake/vcpkg/Qt + vendored in libraries for anything else, in which I am super productive, once scaffolding is set up. This is not a "plug and play" solution at all.

In my experience, as C++ projects become bigger, less and less of the standard library is used. In that sense, some of the largest projects I work on basically just use the C standard library, concepts, smart pointers, vector, algorithms and not much else. No std::threads, no coroutines, no std::(unordered_)map, etc, etc. Why? Because I need extension points in almost all of these, and the standard library is very hard to customize mainly because it is not build as part of the project.

What if the standard library (the non-compiler dependent part) was just another library on github? Then we could split it up, make it composable, and VERSION IT. Put the interface behind std::v1, std::v2 or whatever to prevent source conflicts and we're off to the races. No more locked-in useless regex, std::list etc.

htfy96 18 minutes ago||
Unfortunately this post was removed from r/cpp due to being marked as AI slop
steve1977 5 minutes ago|
I mean it's literally in the title of his blog...

(do we still say blog?)

Surac 5 hours ago||
The try to put everything and the kitchen sink into C++ in a most confusing syntax has made me flee to ansi c for performance and c# for luxury. C++ is not needed in my way of coding. Also most c++ are compiler specific and cmake makes everything even more complex
jillesvangurp 7 hours ago||
I'm kind of curious to see if somebody will come up with new languages and tools that are optimized for LLM usage. Rust and Go accidentally go in the right direction (strong typing, good development tools, etc.) but they are still optimized for people writing code manually. If you let go of that, the requirements could change.

It seems to me like a logical next step to start engineering tools and languages for a world where we don't have people tinkering with code bases anymore. What matters when working with LLMs is fast tools, strong typing and safety, etc. You want fast feedback loops that catches/pre-empts a lot of issues. The cliche of a Rust program that compiles probably working as intended is one of the big reasons it works so well with LLMs. But modern languages also have a lot of the syntactic sugar that makes things nice for people (sometimes at the cost of adding ambiguity) that is less relevant for LLMs.

audunw 7 hours ago||
Ironically (considering Andrew’s negative attitude to LLMs), I think Zig will be great for AIs once the language is stable.

LLMs will probably keep getting faster, meaning the compiler might be holding the LLM back. Zigs focus on blazing fast compilation speeds and hot swapping could become a big advantage.

I think Rusts borrow checker will become a mistake. The right solution is to be able to plug into the compiler and add all kinds of static analysis depending on your needs. There is already a project to add memory lifetime checking which is more powerful than Rust in Zig. Limiting us to checking what can be declared in a function/type signature is a mistake.

The LLM can probably reliably figure out which kinds of static analysis needs to be done for a particular commit.

I think the focus Zig has on having a straightforward and explicit mapping from the code you see to the results/instructions you get can be an advantage for LLMs too.

Should be said he had a recent shift in stance w.r.t. LLM driven testing

roflcopter69 5 hours ago||
> Should be said he had a recent shift in stance w.r.t. LLM driven testing

Source please?

mike_hearn 4 hours ago||
That's basically a language like Java or Kotlin. Fast compiles and turnaround times, for Kotlin a pretty strong type system. I don't think Rust is meaningfully more "if it compiles it works", that's a meme and not a real comparison versus the alternatives.
mirmor23 5 hours ago||
(Ignoring legacy codebases); Even today, for a new project, C++ is likely the only cross-platform option if a rich desktop GUI is critical (EDA/CAD/GIS/Video etc).

Slint is still not professional grade (tried it over a year ago, and also its lack of widget variety and graphics toolkit is a big hole).

Avalonia might work if performance and footprint is acceptable to the app, and I'm not sure about the breadth of their native OS hooks, and window manager quirks.

sandos 4 hours ago|
I was surprised when my LLM managed to make a very nice Avalonia app supporting 1M lines of scrollback without any issues.

Its faster than our old legacy win32 application, even if that might not mean much. We did have to implement our own bitmapped font rendering though :(

im3w1l 8 hours 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

daemin 5 hours ago||
Does it support pre-compiled binary packages?
neobrain 33 minutes ago|||
Yes, this is supported and actively used in nixpkgs for proprietary programs and for things where maintaining source-builds would be unfeasible.

`patchelf` is the keyword that makes them fit into the nix store system.

im3w1l 5 hours ago|||
I believe so. Ideally they should be prebuilt with nix in mind though.
curt15 7 hours ago|||
Does adopting nix also require subscribing to nixpkgs?
fc417fc802 6 hours ago||
Theoretically no, but if you don't you will have to package and build the entire world (ie your full toolchain) yourself. So ... actually now that we have AI I guess no, it isn't required. You could realistically turn a model loose to package everything for you and throw it all at CI.

Or you could just use nixpkgs. Is there any particular reason you don't like it?

arximboldi 8 hours 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 8 hours 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.
Gibbon1 7 hours ago||
Small data point. One time needing a dll for windows. Faced with a build system for that dll that used auto tools. I punted and compiled gcc as a cross compiler to build the windows dll under linux and it worked.

My impression cross compiling C/C++ works fairly well.

whizzter 7 hours ago||
The core we've always fought with is that most *nix tools (both package managers and build tools) cares about "building for home on my machine" (nix does seem to have some separation at least) whilst many developers target crossplatform or multi-targets.

C/C++ has many Windows (where Release / Debug are different build profiles for better or worse), Embedded and Console developers. All of the latter require not only platform support (Nix on Windows is recommended via WSL) and more or less support for programs/libraries to multi-target.

An local developer here in Stockholm did a deep dive with package managers a few years back and it was a depressing watch since only VcPkg seemed to particularly care about the multi-targeting (No idea if Nix handles this well? but it was eliminated due to not even supporting Windows) and a package manager looking to be even unofficial will have a hard time "winning" without filling both parts.

And I do recognize that while vc-pkg was best on paper in many ways, the GNU community would never adopt it.... and here we are still years later.

Personally at this point I think we should maybe just put a thin shim to make compilers/tools recognize git submodules officially and let those become packages because people won't agree on anything anyhow.

(Package managers video) https://www.youtube.com/watch?v=C1m-Uy4nuQA

motbus3 7 hours ago||
It is probably a skill issue, but it is much harder to learn c++ today.

You can read Stroustroup book and still got no idea on lots of important features.

I am not fond of this model to update the language every 2 years without providing resources to properly use it.

If are a cpp veteran you probably can find your way, but if you are not, it seems to me that the language makes the path to become one much harder now.

throw93933944 8 hours 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 8 hours ago||
code audits do not make code safe
throw93933944 7 hours 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.
adrianN 7 hours ago||
Godspeed
short_sells_poo 7 hours ago|||
Then you are a non-developer and perhaps this is not for you.
fc417fc802 6 hours ago|||
How many developers by your definition do you predict will exist 5 years from now?
throw93933944 6 hours ago|||
Whatever, I maintain old apps within constraints and budget.

Rewriting old apps into typescript, and downloading executables from random people on internet On every build, does not work for everyone.

> a strict TypeScript UI

Even article agrees Rust sucks in several cases, including GUI!

arendjr 5 hours ago||
I tried Rust with Qt too and quickly gave up as well. By that I mean I quickly gave up on Qt, and am using different UI tools with Rust instead.

I had fond memories of Qt from back in my C++ days, but its Rust bindings are indeed poor alpha quality, and I suspect it will feel out-of-place forever. If they built a true QML engine natively in Rust I might check it out again, but juggling QML/JS <-> C++ <-> Rust will never become a happy flow, I’m afraid.

HeavyStorm 5 hours ago||
Maybe it's time to move on?
darkurge 5 hours ago|
I do not understand all the fuss to "save" a programming language. If a programming language is not "good" enough will not survive and another will come. What's the problem with that?
More comments...