Live data from Hacker News

What it means that Ubuntu is using Rust

smallcultfollowing.com

101–110 of 312 posts

Re: What it means that Ubuntu is using Rust

#101

Just today I found that rust-coreutils makes installing cuda toolkit impossible, related to use of `dd`: https://forums.developer.nvidia.com/t/cuda-runfile-wont-extr...

Do you have more details? The thread you linked was about gzip, not dd.

The .run file is a shell script with a compressed archive appended:

    MS_dd "$0" $offset $s | eval "gzip -cd" | UnTAR t                                                                        
Where

    MS_dd()
    {
        blocks=`expr $3 / 1024`
        bytes=`expr $3 % 1024`
        dd if="$1" ibs=$2 skip=1 obs=1024 conv=sync 2> /dev/null | \
        { test $blocks -gt 0 && dd ibs=1024 obs=1024 count=$blocks ; \
          test $bytes  -gt 0 && dd ibs=1 obs=1024 count=$bytes ; } 2> /dev/null
    }
Edit: this is apparently packaged with Makeself, and various sources report issues with rust-coreutils. For example https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bu...

Re: What it means that Ubuntu is using Rust

#102
post #99

Earlier quoted context omitted.

> 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…

> 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. Rust supports ABI compatibility if everyone is on the same compiler version. That means you can have a distributed caching architecture for…

My understanding: Even if everyone uses the same toolchain, but someone changes the code for a module and recompiles, then you're in UB land unless everyone who depends on that recompiles

Am I wrong?

Re: What it means that Ubuntu is using Rust

#103
post #74

Earlier quoted context omitted.

Except as you well know, C might not change as fast, but it does change, including the OS ABI. Those folks think it doesn't.

> Except as you well know, C might not change as fast, but it does change, including the OS ABI. I don't know that. Here's what I know: the most successful OSes have stable OS ABIs. And their market share is positively correlated with the stability of their ABIs. Most widely used: Windows, which has a famously stable OS ABI. (If you wanted to be contrarian you could say that it doesn't because the kernel ABI is not s…

Speaking of Windows alone, there are the various calling conventions (pascal, stdcall, cdecl), 16, 32, 64 bits, x86, ARM, ARM64EC, DLLs, COM in-proc and ext-proc, WinRT within Win32 and UWP.

Leaving aside the platforms it no longer supports.

So there are some changes to account for depending on the deployment scenario.

Re: What it means that Ubuntu is using Rust

#104
.NET has a _huge_ platform library and you know what? It’s a pleasure. So many things are just the standard way of doing things. When things are done weirdly, you can usually get a majority in favour of standardising it.

Yes, there’s always a couple of people who really push the boat out…

Re: What it means that Ubuntu is using Rust

#105
The author refers to a few things that he thinks will appeal to the "early majority," but I feel like that's a weakness of the article. Is the author part of the "early majority?" (doesn't seem like it). Does he have the same problems that they have? How does he know?

Re: What it means that Ubuntu is using Rust

#106
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.…

[deleted]

Re: What it means that Ubuntu is using Rust

#107

The author refers to a few things that he thinks will appeal to the "early majority," but I feel like that's a weakness of the article. Is the author part of the "early majority?" (doesn't seem like it). Does he have the same problems that they have? How does he know?

He is the Rust project lead, and the Rust project has been doing quite a bit of user, adopter, and non-adopter interviews over the past few years.

Re: What it means that Ubuntu is using Rust

#108

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

You can curl stuff and run it just gotta have hashes in place.

In theory, yes.

In practice, very rarely. Lots of 'curl | sh' do secondary fetches, and those don't come with hash checks. And even if they come with hash checks _today_, there is no guarantee next version won't quietly remove them.

Re: What it means that Ubuntu is using Rust

#109
post #37

Here's the chasm I want to see Rust cross: 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. 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.

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…

What's the stat of single-compiler version ABI? I mean - if the compiler guaranteed that for the same version of the compiler the ABI can work, we could potentially use dynamic linking for a lot of things (speed up iterative development) without committing to any long term stable API or going through C ABI for everything.

Re: What it means that Ubuntu is using Rust

#110
post #99

Earlier quoted context omitted.

> 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. Rust supports ABI compatibility if everyone is on the same compiler version. That means you can have a distributed caching architecture for…

My understanding: Even if everyone uses the same toolchain, but someone changes the code for a module and recompiles, then you're in UB land unless everyone who depends on that recompiles Am I wrong?

If your key is a hash of the code and its dependencies, for a given toolchain and target, then any change to the code, its dependencies, the toolchain or target will result in a new key unique to that configuration. Though I am not familiar with these distributed caching systems so I could be overlooking something.
Post reply on HN