What it means that Ubuntu is using Rust (smallcultfollowing.com)

86 points by zdw 5 hours ago

pizlonator 4 hours ago

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.

elteto 3 hours ago

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

Wait, Rust can already communicate using the C ABI. In fact, it offers exactly the same capabilities as C++ in this regard (dynamic linking).

pizlonator 3 hours ago

That's an unsafe ABI.

elteto 3 hours ago

andrewflnr 2 hours ago

jjmarr 3 hours ago

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 a feature Rust should ever support or guarantee.

The "stable ABI" is C functions and nothing else for a very good reason.

dpc_01234 23 minutes ago

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.

pizlonator 3 hours ago

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.

jjmarr 3 hours ago

SkiFire13 3 hours ago

pjmlp 3 hours ago

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.

ahartmetz 3 hours ago

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.

PaulDavisThe1st 3 hours ago

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

elteto 3 hours ago

eptcyka 3 hours ago

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?

pizlonator 3 hours ago

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.

sagarm 3 hours ago

ozgrakkurt 3 hours ago

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.

Also unsafe rust has always on strict-aliasing, which makes writing code difficult unless you do it in certain ways.

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

ahartmetz 3 hours ago

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.

pjmlp 3 hours ago

Indeed, Victor Ciura from Microsoft DevDiv has several talks on how this is currently an adoption problem at Microsoft.

They have been working around it with DLLs, and COM/WinRT, but still the tooling isn't ideal.

rhdunn 2 hours ago

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.

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.

edelbitter 3 hours ago

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

theamk 8 minutes ago

[delayed]

staticassertion an hour ago

I don't get it. What's the chasm here?

kingstnap 2 hours ago

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

theamk 24 minutes ago

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.

LoganDark an hour ago

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.

tecoholic an hour ago

Hasn’t the right way to install rust has always been using rust up? I am an Ubuntu user and never once tried apt for rust.

LoganDark an hour ago

nekiwo 3 hours ago

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

jsheard 3 hours ago

> the GPL licenses really do protect open source.

They did, 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.

bluejekyll 3 hours ago

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

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.

josephg 3 hours ago

What evil deeds are you worried about in particular? What are you afraid people will do now that coreutils is MIT?

stabbles 3 hours ago

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

nightpool 3 hours ago

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

stabbles an hour ago

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

harpiaharpyja 37 minutes ago

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?

aapoalas 25 minutes ago

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.

bbkane 4 hours ago

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

aapoalas 18 minutes ago

If you want to take a look at some of the "big drivers", the Project Goals[1] is the right place. These are goals proposed by the community and the language developers put together, they are not explicit milestones or must-haves, but they do serve as a guideline to what the project tries to put its time and effort on.

[1]: https://rust-lang.github.io/rust-project-goals/

vablings 4 hours ago

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)

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.

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

Wobbles42 3 hours ago

Are mid level and junior developers being hired anywhere for any reason right now? I don't mean specifically rust developers. I mean software developers.

throwaway27448 2 hours ago

moomin 38 minutes ago

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

UI_at_80x24 4 hours ago

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.

A lot of bug fixes/exploits are _CAUSED_ by the C+ core, but still... Tried & true vs new hotness?

giancarlostoro 4 hours ago

Don't hate me for this, but... is 20 years of Rust really new?

https://en.wikipedia.org/wiki/Rust_(programming_language)

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:

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.

UI_at_80x24 3 hours ago

But the 90s was only 20-years ago!

lol, you got me. Stupid old brain not calculating time correctly.

giancarlostoro 2 hours ago

9rx 4 hours ago

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.

throw384748 4 hours ago

Rust does not even have a specification, and stable release yet! You are lucky if current version, compiles two years old code!

Rust will be "repeatedly tried and tested" maybe in year 2040!

Iridescent_ 3 hours ago

umanwizard 3 hours ago

mamcx 3 hours ago

> years of bug fixes and edge-case improvements can't be accounted for by simply using a newer/better code-base.

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

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.

bbkane 4 hours ago

I think it's worth trying!

UI_at_80x24 4 hours ago

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.

rg, fzf, and several others that I can't think have proven to me that rust is the direction going forward.

petcat 4 hours ago

Is Rust still considered "new hotness"? I feel like the industry has long-since moved past that perceived "blocker".

It seems like Rust is now just the default in all manner of critical systems.

0x457 3 hours ago

Rust - no. sudo-rs not hotness, but relatively new.

psyclobe 3 hours ago

Sudo no longer supporting path inheritance kinda sucks

themafia 3 hours ago

> 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

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.

deepriverfish 3 hours ago

a few weeks ago it was all about Zig, now it's all about Rust, Clojure or Elixir next?

kelvinjps10 3 hours ago

Rust was first

system2 4 hours ago

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

Jaxan 3 hours ago

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.

iFire 3 hours ago

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.

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.

There's some friction between platform packagers and the code that the author wrote exactly as it was written.

weaksauce 2 hours ago

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

canadiantim 3 hours ago

AI has made it exceptionally easy to program with.

I've switched to using Rust from Python simply because of AI development

bitwize 3 hours ago

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.

system2 3 hours ago

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.

the_duke 3 hours ago

staticassertion an hour ago

ChadNauseam 3 hours ago

theLiminator 3 hours ago

mikepurvis 3 hours ago

xcrjm 3 hours ago

throwaway613746 4 hours ago

I don't care that the non-gnu coreutils are using rust. I care that they aren't GPL licensed.

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.