by tazjin · 1mo ago · 0 comments
Man, I remember back in the days when the cppnext team was refusing to even consider Rust, instead looking at absurd stuff like Carbon and Swift (!), even though half of the engineering staff already knew where this was headed. I hope they got a few good promos out of the delays at least.
And static analysis + agents are good enough at keeping the memory management in check. Compared to Rust, there's no magic so it's easy for devs and agents to reason about.
If you're curious: https://github.com/okcontract/oksolc
Many pieces of software are going to be just blackboxes worked by AI. You will be maintaining output quality and stability and that's it.
Maybe we should let them do their thing and instead focus our attention on the higher-level stuff like specifications and testing.
https://www.ll.mit.edu/r-d/projects/translating-all-c-rust-t...
I'm not saying we blindly vibe convert Linux to Rust, but I think it could be a valid idea to start converting small parts and carefully auditing them.
I am hopeful we can bring in an age of much more efficient software rather than fully prioritizing developer convenience.
and start everything all over again? current c/c++ tools have been audited for years
Also the internal tooling culture there is just insane. I'll never forget the day the last SUPER_ESSENTIAL_TOOL was marked as "Deprecated - do not use!" while the only replacement was still marked "Pre-release -- use at your own risk!". I can't pretend to know what dynamics led to that cause it was so far from my org, but I can't imagine they were healthy ones!
I was excited to see what it would be. But I don't think I can argue that it makes as much sense anymore.
The only somewhat realistic proposal in this space is Herb Sutter's cpp2, which is arguably a massive improvement and I'm puzzled why nobody in the standard thought to give it a spin, there's just to much cruft they'll never be able to get rid of unless they make an alternate yet backward compatible syntax with C++ that changes the defaults from "random 80s nonsense" to something better
Not saying you're wrong, just curious if there are numbers backing this up.
The best models can still make sense of it[2], though the tasks so far have been pretty basic. But I do think it gives some evidence that languages which aren’t well represented in an LLM’s training can still be reasoned about and written well by LLMs.
I don't think Carbon is dead, it just all depends on how easy it actually is to rewrite "all of C++" in Rust. (The jury is still out on this one, but it's not looking good.)
> Existing modern languages already provide an excellent developer experience: Go, Swift, Kotlin, Rust, and many more. Developers that can use one of these existing languages should.
So the reason for Carbon to exist is gone. C++ code can be migrated straight to Rust without Carbon's stopgap.
LLMs are very good now, but they are still stochastic (when temp > 0), and Google has a lot of code -- i.e., many rolls of the die.
LLMs are fuzzy when generating, but such conversions aren't done one-shot. Review and test feedback loops are there to catch the random errors. The frontier models are getting good enough at this.
When LLM is instructed to generate idiomatic safe Rust (rather than literal 1:1 unsafe translation), it benefits from a lot of feedback from the compiler.
Whatever QA there was to ensure C++ was good enough can be applied to the Rust version too.
Does it deliver?
Can all existing C++ code be ported to Carbon without refactoring?
It's DOA because Google doesn't have any idea of what Carbon should be, and to be completely honest, at least 80% of what they currently use C++ for should be rewritten Go, you know, that language developed specifically because of the issues with C++ by teams within Google.
It was clearly done because some PL guys at google really wanted to make a new cool language and Google was the perfect place to incubate it without it getting axed. Probably got a couple of promos out of it too. This is clearly not the best use of time or money, but I guess if you're google you have so much of both it probably doesn't really make a dent, and you can keep a few very smart people happy with shiny new projects.
Also, LLMs being used for a large portion of coding nowadays sort of remove the need for these types of languages, IMO. They make less "silly" bugs (both logical and structural) that languages like this are meant to catch, and they are much better at languages that are better represented in the training corpus. This somewhat obviates the need for very niche "type/dummy-safe" languages like carbon (and even rust/zig, imo). So even if you did want to use Carbon, you'd likely have to bootstrap a decent amount of your own "good" carbon code to post train an LLM, and even then, it likely won't have that big of a gain vs just having an LLM write C++ or even Rust. If you are a company that still reviews code, you should just have an LLM code in a language most people can understand anyway to make verifiability tractable.
Such rewrites will contain judicious uses of Cell, RefCell, unwrap() etc. which make for ugly code that's not exactly simple to understand and might even have some landmines (crashes).
Getting rid of these requires a subtantial amount of engineering effort, which I'm not sure how well these LLM manage.
Given the nigh-universal experience of LLMs producing an ungodly mess when left to their own devices, I have my concerns.
They did that for Go and it seems to have worked out for them though.
Google themselves to this day aren't big Go users outside Kubernetes ecosystem.
That feels like a really strong conclusion. I’m not clear on why any safeguard isn’t a useful safeguard if you let agents write all the code.
I personally think that you _could_ use an LLM to catch these types of boundary case errors without having to port the _entire_ C++ codebase to Rust, but maybe pre-emptively porting to Rust now can catch some of these cases for cheaper than doing a full LLM sweep. Also more cynically, its a good benchmark lol.
I guess if you really believe in curve of LLM capabilities you should just use a language that has the best performance, safety, flexibility, and extensibility, since in the limit few/no people will actually read the code anyway. I think this ends up being Rust.
I’m not entirely sure Google should have both Go and Carbon but when you have billions in server costs it makes sense to do extreme stuff for even basis points of performance. I’m still surprised at how much java there is.
Maintaining a language meant for web servers is also objectively a much easier job than something like C++/Carbon which is supposed to be at system level, general purpose and has huge standard library.
By comparison, virtually nobody is using Carbon at Google for production code.
The counterexample, ironically, is Flow. It's practically irrelevant these days -- many (if not most) of Facebook's open source projects use typescript.
It’s absurd to think that Carbon is the solution to memory safety when rust exists and Carbon’s memory safety story is basically “TBD”.
Imagine they aren't even familiar with rust but are deeply familiar with the product.
So ... Rust still can't beat the C++ implementation :-D
Sorry, didn't mean to ignite a langwar, but it's still interesting to see.
Of course, Rust is not a magic, so just porting to Rust wouldn't make this performance improvement. It seems their AI overfitted code to Rust compiler to find safe Rust code that compiles to efficient assembly.