Live data from Hacker News

What it means that Ubuntu is using Rust

smallcultfollowing.com

51–60 of 312 posts

Re: What it means that Ubuntu is using Rust

#52
post #17

Earlier quoted context omitted.

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. It's also as bad as C. I'm saying that the chasm to cross is a safe ABI.

There is no existing safe ABI, so this cannot be an adoption barrier.

Re: What it means that Ubuntu is using Rust

#53

Earlier quoted context omitted.

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. In C or C++, this isn't supposed to happen: a conformant implementation claiming to support e.g. C++17 would use ifdefs to g…

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.

Re: What it means that Ubuntu is using Rust

#54
post #32

Earlier quoted context omitted.

AI has made it exceptionally easy to program with. I've switched to using Rust from Python simply because of AI development

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.

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.

Re: What it means that Ubuntu is using Rust

#55
post #48

Earlier quoted context omitted.

I think if Rust wants to evolve even more aggressively than C++ evolves, then that is a chasm that needs to be crossed. In lots of domains, having a language that doesn't 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. 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. 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.

I mean yeah that's bad.

> Rust preventing this makes my life so much better.

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.

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.

This is true even and especially if everyone has access to everyone else's source code

Re: What it means that Ubuntu is using Rust

#56
post #11

Why am I hearing about Rust a lot these days? Did anything significant happen?

AI has made it exceptionally easy to program with. 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.

Re: What it means that Ubuntu is using Rust

#57

One particular chasm to keep an eye on, possibly even more relevant than Ubuntu using Rust: When it comes to building important stuff, Ubuntu sticks to curl|YOLO|bash instead of trusting trust in their own distributions. https://github.com/canonical/firefox-snap/blob/90fa83e60ffef...

[flagged]

Re: What it means that Ubuntu is using Rust

#58
post #32

Earlier quoted context omitted.

AI has made it exceptionally easy to program with. I've switched to using Rust from Python simply because of AI development

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.

Rust has a very strict type system and an ecosystem that often utilizes the type system well.

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.

Rust also has great error messages, which help the agents in fixing compilation errors.

Re: What it means that Ubuntu is using Rust

#59
post #37

Earlier quoted context omitted.

C++ ABI stability is the main reason improvements to the language get rejected. 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. 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…

I think if Rust wants to evolve even more aggressively than C++ evolves, then that is a chasm that needs to be crossed. In lots of domains, having a language that doesn't 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.

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).

Re: What it means that Ubuntu is using Rust

#60
post #35

Earlier quoted context omitted.

As unsafe as C or C++. In fact, safer, because only the ABI surface is unsafe, the rust code behind it can be as safe or unsafe as you want it to be. I was addressing this portion of your comment: "C's ABI and dynamic linking are the thing that enables the software to get huge". If the C ABI is what enables software to get huge then Rust is already there. There is a second claim in your comment about a "safe ABI", bu…

Here's the problem. If you told me that you rebuilt the Linux userland with Rust but you used C ABI at all of the boundaries, then I would be pretty convinced that you did not create a meaningful improvement to security because of how many dynamic linking boundaries there are. So many of the libraries involved are small, and big or small they expose ABIs that involve pointers to buffers and manual memory management.…

So you're calling for dynamic linking for rust native code? Because rust's safety doesn't come from runtime, it comes from the compiler and the generated code. An object file generated from a bit of rust source isn't some "safe" object file, it's just generated in a safe set of patterns. That safety can cross the C ABI perfectly fine if both things on either side came from rust to begin with. Which means rust dynamic linking.
Post reply on HN