Live data from Hacker News

Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

zdnet.com

91–100 of 127 posts

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#91

Earlier quoted context omitted.

> Suggesting making a new kernel is just total FUD. This is a multi decade project. Linux started as a hobby project of a single student and just a few years later it was already possible to build a full-blown UNIX desktop system with Linux as kernel. Why should that not be possible to replicate today? Especially with modern development tooling and a big and motivated language community?

What was acceptable in 1995 is not what is acceptable today. Linux took literal decades + in the billions of dollars to build. It's ridiculous to suggest a rust project can just catch up to that with a few developers and no funding in any sane timespan. If you think it's reasonable to suggest "Just outcompete this heavily and continuously developed 34 year old project which has the backing of the largest technology f…

Sure it's foolish, but so was trying to 'outcompete' industry giants like IBM and Microsoft in the early 90s with a hobby kernel. That didn't stop a certain Finn from just writing a kernel anyway. If that project hadn't taken off, then maybe another one, or another one.

Replacing any substantial parts of the Linux project with Rust also would be multi-decade effort, most likely more effort than forking off a separate evolutionary branch (which is probably the most realistic option). Such forks happened all the time in the history of UNIX.

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#92
post #90

Earlier quoted context omitted.

Another developer here who writes in C and C++, same. I think a lot of people have this complaint. I'm sad about it because what Rust provides in principle sounds great. The language is hideous though, and I really don't want to write anything in it.

What things are hideous about it and what would you rather it look like?

[flagged]

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#93

Earlier quoted context omitted.

What was acceptable in 1995 is not what is acceptable today. Linux took literal decades + in the billions of dollars to build. It's ridiculous to suggest a rust project can just catch up to that with a few developers and no funding in any sane timespan. If you think it's reasonable to suggest "Just outcompete this heavily and continuously developed 34 year old project which has the backing of the largest technology f…

Sure it's foolish, but so was trying to 'outcompete' industry giants like IBM and Microsoft in the early 90s with a hobby kernel. That didn't stop a certain Finn from just writing a kernel anyway. If that project hadn't taken off, then maybe another one, or another one. Replacing any substantial parts of the Linux project with Rust also would be multi-decade effort, most likely more effort than forking off a separate…

It was considerably less foolish then, then now. It's not even close. The complexity of the operating system kernels has more then increased 50x over the last 34 years. It's not even remotely comparable.

No one wants to replace substantial parts of the linux project with Rust. This is a straw man, and the same bad faith argument the set in their ways kernel greybeards are making. People just want to be able to write green field drivers in Rust.

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#94
post #90

Earlier quoted context omitted.

Another developer here who writes in C and C++, same. I think a lot of people have this complaint. I'm sad about it because what Rust provides in principle sounds great. The language is hideous though, and I really don't want to write anything in it.

What things are hideous about it and what would you rather it look like?

That video snippet which was posted by that former Rust/Linux maintainer has an excellent example:

https://www.youtube.com/watch?t=1529&v=WiPp9YEBV0Q&feature=y...

The return type of that get_or_create_inode() function is:

    Result>, inode::New>>
I'd say that's a pretty good example for 'hideous'. It looks like some of the worst C++ code I've seen and then quickly tried to forget. If stuff like this ends up in the Linux kernel I would be pissed too as a Linux kernel greybeard.

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#95
post #90

Earlier quoted context omitted.

What things are hideous about it and what would you rather it look like?

That video snippet which was posted by that former Rust/Linux maintainer has an excellent example: https://www.youtube.com/watch?t=1529&v=WiPp9YEBV0Q&feature=y... The return type of that get_or_create_inode() function is: Result >, inode::New >> I'd say that's a pretty good example for 'hideous'. It looks like some of the worst C++ code I've seen and then quickly tried to forget. If stuff like this ends up in the Lin…

I agree that it could maybe use some new types, but it also does kinda get to the heart of this: I’ve never used this kernel API before, but I can say “oh, this function may error out, but if it doesn’t, it gives me either a new inode or a reference (I’m assuming that’s what ARef is) to an existing one. That’s a lot of valuable information, at a glance.

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#96

Earlier quoted context omitted.

That video snippet which was posted by that former Rust/Linux maintainer has an excellent example: https://www.youtube.com/watch?t=1529&v=WiPp9YEBV0Q&feature=y... The return type of that get_or_create_inode() function is: Result >, inode::New >> I'd say that's a pretty good example for 'hideous'. It looks like some of the worst C++ code I've seen and then quickly tried to forget. If stuff like this ends up in the Lin…

I agree that it could maybe use some new types, but it also does kinda get to the heart of this: I’ve never used this kernel API before, but I can say “oh, this function may error out, but if it doesn’t, it gives me either a new inode or a reference (I’m assuming that’s what ARef is) to an existing one. That’s a lot of valuable information, at a glance.

> That’s a lot of valuable information, at a glance

...if you know how to decode it. That example looks like one of those C++ SFINAE hacks, e.g. trying to bend the template/generics syntax beyond what it was designed for.

If Rust APIs want to go that way (of overly expressive strong typing) then Rust really should offer a better syntax for describing such types. But it's not even clear to me if such strongly typed APIs are even a good idea. From my experience in C++ and (especially) Typescript with similar APIs, it's a PITA to work with in real world projects, and on both sides of the API.

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#97

Earlier quoted context omitted.

Not users? Linux development is it's own reward?

Users should only need to care about what happens in user space. And the most important promise of Linux is "don't break user space". The kernel's programming language is literally just an internal implementation detail, irrelevant for Linux users.

The security vulnerabilities that affect my PII kinda contradict the idea that the kernel is an implementation detail. It’s not an implementation detail if I do, in fact, have to care about it.

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#98
post #2

Rust Switching to a more modern topic, the introduction of the Rust language into Linux, Torvalds is disappointed that its adoption isn't going faster. "I was expecting updates to be faster, but part of the problem is that old-time kernel developers are used to C and don't know Rust. They're not exactly excited about having to learn a new language that is, in some respects, very different. So there's been some pushba…

IMHO, as a C developer, I love Rust's features but the syntax is terrible.

Yup, Rust syntax is just the worst - except for all the other syntax proposals that have been made over time: https://matklad.github.io/2023/01/26/rusts-ugly-syntax.html

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#99

Earlier quoted context omitted.

I agree that it could maybe use some new types, but it also does kinda get to the heart of this: I’ve never used this kernel API before, but I can say “oh, this function may error out, but if it doesn’t, it gives me either a new inode or a reference (I’m assuming that’s what ARef is) to an existing one. That’s a lot of valuable information, at a glance.

> That’s a lot of valuable information, at a glance ...if you know how to decode it. That example looks like one of those C++ SFINAE hacks, e.g. trying to bend the template/generics syntax beyond what it was designed for. If Rust APIs want to go that way (of overly expressive strong typing) then Rust really should offer a better syntax for describing such types. But it's not even clear to me if such strongly typed AP…

I mean, it’s very straightforward generics. There’s just nesting, each of these types has one or two parameters and that’s it. I’m not sure there’s a simpler way of communicating the same thing.

But I also think that I wouldn’t design an API that works like this in Rust natively; this is adapting a signature from C rather than doing the API you’d want if you were creating something from whole cloth.

I also believe that static types are very different based on the language; I’d rather write Ruby than Java, but I’d rather write Rust than Ruby. More advanced type systems tend to actually pull their weight, whereas simpler ones don’t give enough juice for the squeeze, IMHO.

Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters

#100

Earlier quoted context omitted.

I agree that it could maybe use some new types, but it also does kinda get to the heart of this: I’ve never used this kernel API before, but I can say “oh, this function may error out, but if it doesn’t, it gives me either a new inode or a reference (I’m assuming that’s what ARef is) to an existing one. That’s a lot of valuable information, at a glance.

> That’s a lot of valuable information, at a glance ...if you know how to decode it. That example looks like one of those C++ SFINAE hacks, e.g. trying to bend the template/generics syntax beyond what it was designed for. If Rust APIs want to go that way (of overly expressive strong typing) then Rust really should offer a better syntax for describing such types. But it's not even clear to me if such strongly typed AP…

How would you like Rust to describe such Types?

> a PITA to work with in real world projects, and on both sides of the API.

Don't see how this is a Typing issue, sounds more like API issue

Post reply on HN