One particular chasm to keep an eye on, possibly even more relevant than Ubuntu <i>using</i> Rust: When it comes to building important stuff, Ubuntu sticks to curl|YOLO|bash instead of trusting trust in their own distributions.<p><a href="https://github.com/canonical/firefox-snap/blob/90fa83e60ffef6c72c28288cda381de25d518f5b/snapcraft.yaml#L149-L159" rel="nofollow">https://github.com/canonical/firefox-snap/blob/90fa83e60ffef...</a>
I don't get it. What's the chasm here?
You can curl stuff and run it just gotta have hashes in place.
Aren't the versions of Rust in stable Linux distributions like, a century old? Or at least they were last I checked what Debian and Ubuntu LTS were distributing. I think it's because they don't like static linking.
[flagged]
Here's the chasm I want to see Rust cross:<p>Dynamic linking with a safe ABI, where if you change and recompile one library then the outcome has to obey some definition of safety, and ABI stability is about as good as C or Objective-C or Swift.<p>Until that happens, it'll be hard to adopt Rust in a lot of C/C++ strongholds where C's ABI and dynamic linking are the thing that enables the software to get huge.
> Until that happens, it'll be hard to adopt Rust in a lot of C/C++ strongholds where C's ABI and dynamic linking are the thing that enables the software to get huge.<p>Wait, Rust can already communicate using the C ABI. In fact, it offers exactly the same capabilities as C++ in this regard (dynamic linking).
C++ ABI stability is the main reason improvements to the language get rejected.<p>You cannot change anything that would affect the class layout of something in the STL. For templated functions where the implementation is in the header, ODR means you can't add optimizations later on.<p>Maybe this was OK in the 90s when companies deleted the source code and laid off the programmers once the software was done, but it's not a feature Rust should ever support or guarantee.<p>The "stable ABI" is C functions and nothing else for a very good reason.
I think if Rust wants to evolve even more aggressively than C++ evolves, then that is a chasm that needs to be crossed.<p>In lots of domains, having a language that <i>doesn't</i> change very much, or that only changes very carefully with backcompat being taken super seriously, is more important than the memory safety guarantees Rust offers.
In my view, this is a good thing.<p>As a C++ developer, I regularly deal with people that think creating a compiled object file and throwing away the source code is acceptable, or decide to hide source code for "security" while distributing object files. This makes my life hell.<p>Rust preventing this makes my life so much better.
> As a C++ developer, I regularly deal with people that think creating a compiled object file and throwing away the source code is acceptable, or decide to hide source code for "security" while distributing object files. This makes my life hell.<p>I mean yeah that's bad.<p>> Rust preventing this makes my life so much better.<p>I'm talking about a different issue, which is: how do you create software that's in the billions of lines of code in scale. That's the scale of desktop OSes. Probably also the scale of some other things too.<p>At that scale, you can't just give everyone the source and tell them to do a world compile. Stable ABIs fix that. Also, you can't coordinate between all of the people involved other than via stable ABIs. So stable ABIs save both individual build time and reduce cognitive load.<p>This is true even and especially if everyone has access to everyone else's source code
> At that scale, you can't just give everyone the source and tell them to do a world compile. Stable ABIs fix that. Also, you can't coordinate between all of the people involved other than via stable ABIs. So stable ABIs save both individual build time and reduce cognitive load.<p>Rust supports ABI compatibility if everyone is on the same compiler version.<p>That means you can have a distributed caching architecture for your billion line monorepo where everyone can compile world at all times because they share artifacts. Google pioneered this for C++ and doesn't need to care about ABI as a result.<p>What Rust does <i>not</i> support is a team deciding they don't want to upgrade their toolchains and still interoperate with those that do. Or random copy and pasting of `.so` files you don't know the provenance of. Everyone must be in sync.<p>In my opinion, this is a reasonable constraint. It allows Rust to swap out HashMap implementations. In contrast, C++ map types are terrible for performance because they cannot be updated for stability reasons.
<i>> At that scale, you can't just give everyone the source and tell them to do a world compile.</i><p>Firstly, of course you could.<p>Secondly, you don't even need to, as NixOS shows.
C++ is still changing quite a lot though, just not in ways that fix the existing issues (often because doing so would break ABI stability).
The big question is does Rust want to play being adopted by those vendors, or it would leave them alone with languages that embrace native libraries.
Dynamic linking is also great for compile time of debug builds. If a large library or application is split up into smaller shared libraries, ones unaffected by changes don't need to be touched at all. Runtime dynamic linking has a small overhead, but it's several orders of magnitude faster than compile-time linking, so not a problem in debug builds.
for <i>developer</i> turnaround time, it is huge. we explicitly do not statically link Ardour because as developers we are in the edit-compile-debug cycle all day every day, and speeding up the link step (which dynamic linking does dramatically, especially with parallel linkers like lld) is a gigantic improvement to our quality of life and productivity.
The C ABI can already be used, it comes with all the existing safety guarantees that C will provide. Isn’t this as good as C?
It is as good as C.<p>It's also as bad as C.<p>I'm saying that the chasm to cross is a <i>safe</i> ABI.
I found c ABI a bit too difficult in rust compared to c or zig. Mainly because of destructors. I am guessing c++ would be difficult in a similar way.<p>Also unsafe rust has always on strict-aliasing, which makes writing code difficult unless you do it in certain ways.<p>Having glue libraries like pyo3 makes it good in rust. But that introduces bloat and other issues. This has been the biggest issue I had with rust, it is too hard to write something so you use a dependency. And before you know it, you are bloating out of control
Not really. The foreign ABI requires a foreign API, which adds friction that you don't have with C exporting a C API / ABI. I've never tried, but I would guess that it adds a lot of friction.
Indeed, Victor Ciura from Microsoft DevDiv has several talks on how this is currently an adoption problem at Microsoft.<p>They have been working around it with DLLs, and COM/WinRT, but still the tooling isn't ideal.
COM is interesting as it implements interfaces using the C++ vtable layout, which can be done in C. Dynamic COM (DCOM) is used to provide interoperability with Visual Basic.<p>You can also access .NET/C# objects/interfaces via COM. It has an interface to allow you to get the type metadata but that isn't necessary. This makes it possible to e.g. get the C#/.NET exception stack trace from a C/C++ application.
Just today I found that rust-coreutils makes installing cuda toolkit impossible, related to use of `dd`: <a href="https://forums.developer.nvidia.com/t/cuda-runfile-wont-extract/351343" rel="nofollow">https://forums.developer.nvidia.com/t/cuda-runfile-wont-extr...</a>
Unrelated to the language debate, but it seems a lot of people here missed the fact that Rust Coreutils project is licensed under MIT, and I am not sure if I feel that it is the appropriate license for such project. As much as FSF's philosophy has bad PR at times with Stallman, the GPL licenses really do protect open source. Who knows what Canonical would do when all parts of Ubuntu become MIT...
> the GPL licenses really do protect open source.<p>They <i>did,</i> until the automatic copyright laundering machine was invented. Pretty much every piece of GPL code ever written is now being magically transmuted into MIT/BSD or proprietary code, and the FSF has no solution.
A discussion on licenses will go sideways very quickly. GPL does limit the adoption of software in certain environments. So it really depends on your goals. Do you want an OSS project that will be useable by everyone (including corporations) or do you want to guarantee that the software will always be OSS and guarantee that Corporations can’t benefit from it without contributing back (potentially requiring them to open their own proprietary code).<p>There’s a lot of moral perspective that people apply to this decision, but not all developers have the same goals for their software. MIT is more flexible in its use than GPL, but doesn’t help ensure that software remains open.
What evil deeds are you worried about in particular? What are you afraid people will do now that coreutils is MIT?
Really good references to "crossing the chasm" between early adopter needs and mainstream needs. In addition to the Ubuntu coreutils use case, I wonder what other chasms Rust is attempting to cross. I know Rust for Linux (though I think that's still relegated to drivers?) and automotive (not sure where that is).
There are big pushes in pretty much every direction. The projects that really stand out to me are pyo3 (Replace c++ python modules with rust), Dioxus (react-like web framework), The ferrocine qualified compiler (automotive)<p>I think right now the ecosystem is pretty ripe and with DARPA TRACTOR there are only more and more reasons every day to put rust on your toolbelt.<p>I am secretly hoping that eventually we break free from the cycle of "hire a senior dev and he likes rust so the company switches" over to hey let's hire some good mid-level and junior rust developers
I've been a fan of all rust-based utilities that I've used. I am worried that 20+ (??) years of bug fixes and edge-case improvements can't be accounted for by simply using a newer/better code-base.<p>A lot of bug fixes/exploits are _CAUSED_ by the C+ core, but still... Tried & true vs new hotness?
Don't hate me for this, but... is 20 years of Rust really new?<p><a href="https://en.wikipedia.org/wiki/Rust_(programming_language)" rel="nofollow">https://en.wikipedia.org/wiki/Rust_(programming_language)</a><p>I do get what you mean, but Rust has been baking for a decade, finally took off after 10 years of baking, and now that is been repeatedly tried and tested it is eating the world, as some developers suggested it could eventually do so. I however do think this shows a different problem:<p>If nobody writes unit tests, how do you write them when you port over projects to ensure your new language doesn't introduce regressions. All rewrites should be preceded by strong useful unit tests.
But the 90s was only 20-years ago!<p>lol, you got me.
Stupid old brain not calculating time correctly.
Ideally, but if a project wasn't written with tests at the time then finding a working time machine can be a challenge. If you try to add them later you won't capture all the nuance that went into the original program. After all, if the implementation code was expressive enough to capture that nuance, you'd already have your test suite, so to speak. Tests are written to fill in the details that the rest of the code isn't able to express.
Rust does not even have a specification, and stable release yet! You are lucky if current version, compiles two years old code!<p>Rust will be "repeatedly tried and tested" maybe in year 2040!
Rust has editions for strong stability guarantees, and has had them for nearly a decade i believe. Besides, tech backing has grown way past the risky point.
FWIW, the GP comment's claim that you're lucky if you can compile 2-year-old code is exaggerated, but so is yours. Rust does not offer "strong stability guarantees". Adding a new method to a standard type or trait can break method inference, and the Rust standard library does that all the time.<p>In C or C++, this isn't supposed to happen: a conformant implementation claiming to support e.g. C++17 would use ifdefs to gate off new C++20 library functions when compiling in C++17 mode.
> and the Rust standard library does that all the time.<p>I don't doubt this is true, but do you have an example? I think I haven't run into a build breaking like this in std in like maybe seven/eight years. In my experience breaking changes/experimental apis are typically ensconced in features or gated by editions.<p>Granted, it'd be nice to be able to enforce abi stability at the crate level, but managing that is its own can of worms.<p>I did find that the breakage rfc allows for breaking inference, which tbh seems quite reasonable... inference is opt-in.
Almost every major release of rust stabilizes new library methods. For example, the latest major release (1.93) stabilized Vec::into_raw_parts. This isn’t gated by an edition. So if you had a trait with a method “into_raw_parts” which you had defined on Vec, after updating to 1.93 or later your code will either fail to compile, or start running different code when that method is called.<p>Sorry, I meant to write “method resolution”, not inference. This isn’t the same issue as type inference (though indeed, stdlib changes can break that too)
Adding a new method can change the behavior of C++ code as well due to templates. Does the standard library never add new methods because of that?
Yes. All the time. Subscribe to the std-proposals mailing list and you'll see so many obvious improvements get rejected due to ABI compat guarantees.
> Adding a new method can change the behavior of C++ code as well due to templates.<p>Yes, but the code can be gated off with ifdefs to only be present when compiling for a particular version of the standard.
> Rust does not even have a specification<p>Neither do most programming languages.<p>> You are lucky if current version, compiles two years old code!<p>That's not true.
> Neither do most programming languages.<p>Rust is trying to replace C++ and C in particular. Those languages have specifications.
> Neither do most programming languages.<p>My favorite nemesis and friend JavaScript does, which always gives me a laugh. Such a mess of a wonderful language.
> years of bug fixes and edge-case improvements can't be accounted for by simply using a newer/better code-base.<p><i>Partially</i> is in fact true: Just because the Rust use a better type system (after ML) + better resource model (aka borrow checker), and if you are decently good, you eliminate, forever!, tons of problems.<p>It can't solve things that arise by complex interactions or just lack of port subtle details like in parsing poor inputs (like html) but is true that changing the language in fact solve tons of things.
I think it's worth trying!
It absolutely is worth trying. I look forward to it being battle tested and proven. I just don't want to be the one doing the testing.<p>rg, fzf, and several others that I can't think have proven to me that rust is the direction going forward.
Is Rust still considered "new hotness"? I feel like the industry has long-since moved past that perceived "blocker".<p>It seems like Rust is now just the default in all manner of critical systems.
Sudo no longer supporting path inheritance kinda sucks
a few weeks ago it was all about Zig, now it's all about Rust, Clojure or Elixir next?
> Jon made the provocative comment that we needed to revisit our policy around having a small standard library. He’s not the first to say something like that, it’s something we’ve been hearing for years and years<p>It sounds to me like you "cross the chasm" a little too early. As a user I don't care about your "chasms" I care about high quality durable systems. This isn't the first time I've heard the "we'll change the std lib later" logic. I've yet to see it actually work.
Why am I hearing about Rust a lot these days? Did anything significant happen?
Most of the platforms were successfully petitioned to have rust sdk mandatory added so that rust code can be added to the platforms. The previously situation was rust was not allowed because the external dependency of the rust sdk was blocked.<p>Note that the rust having no stable api is not fixed, so I think there's a bunch of internal systems on each platform to hard lock the rust dependencies across multiple rust users.<p>There's some friction between platform packagers and the code that the author wrote exactly as it was written.
What do you mean by “these days”? To me, it seems like rust is a pretty constant factor on HN for at least two years now.
there has been a few adopters of rust... linux formally choosing it for some of their systems being the most notable recently(maybe a few months ago).
AI has made it exceptionally easy to program with.<p>I've switched to using Rust from Python simply because of AI development
Indeed. With AI lifting legacy code bases into Rust got a whole lot easier, and purging the blight of C from the world, excepting the most deeply embedded of applications, got a whole lot closer.
Really? You think AI writes better Rust than Python? Can you give me some examples? I strictly code Django, and Claude Code is really good at following my lead with it.
I can't give you examples, but my experience is that AI does very well with Rust except for cases where a library has a constantly changing API/ has had recent breaking changes. I find that AI does extremely well at "picking up" a Rust codebase, I suspect due to the type information providing context but I couldn't say.
Rust has a very strict type system and an ecosystem that often utilizes the type system well.<p>Many things that would only be caught at runtime in other languages are caught at compile time in Rust, making coding agents iterate until things compile and work well.<p>Rust also has great error messages, which help the agents in fixing compilation errors.
I think relative to the typical Rust code it likely does worse than AI relative to the typical Python code. But due to the compiler, it's possible you might get more correctness out of AI-generated rust code on average.
The compile errors are great. I can change one function signature and have my output fill up with compile errors (that would all be runtime errors in python). Then I just let claude cook on fixing them. Any time you have to run your program and tell claude what’s wrong with it you’re wasting time, but because claude can run the compiler itself and iterate it’s much more able to complete a task without intervention.
I think the argument is more that working rust code is better than working Python, and AI assistance makes it more tenable for average developers to successfully produce working rust code, and in particular is helpful for navigating the gap between "code written" and "code compiling" (eg why is the borrow checked mad at me).
Even if it writes the same or even somewhat worse rust than python, assuming the output is the same you are likely to get a speedup + a better distribution story.
I don't care that the non-gnu coreutils are using rust. I care that they aren't GPL licensed.<p>This means Canonical can offer proprietary patches on top of these packages and sell them as part of their "enterprise" offerings and this gives me the ick.