Earlier quoted context omitted.
What things are hideous about it and what would you rather it look like?
[flagged]
Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
101–110 of 127 posts
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#102Regretfully a major Rust for Linux maintainer just stepped down yesterday, saying he doesn't have the energy to keep dealing with the constant nontechnical nonsense: https://lore.kernel.org/lkml/20240828211117.9422-1-wedsonaf@...
I lack context. What is the “constant nontechnical nonsense”?
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#103Earlier 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…
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#104Earlier 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…
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#105Earlier quoted context omitted.
https://news.ycombinator.com/item?id=41386939 A comment there has a link to a video of what seems to be the final straw.
For those who don’t or can’t watch the video, or want to know who is saying what, here’s an LWN article describing what happens in that section of video. https://lwn.net/Articles/978738/ While I disagree with his opinions here, Ted T'so is a long-time Linux kernel dev. He's been around since close to the beginning. https://en.wikipedia.org/wiki/Theodore_Ts%27o
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#106Earlier 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…
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#107Earlier quoted context omitted.
> The mental safe space of old time kernel developers? As long as they are the majority of the kernel developers, their wish is what matters the most.
The wish of the lead developer is for Linux development to continue beyond the life of the current maintainers. Training to be a competent system programmer using C is unnecessary long and painful. There aren't enough C hackers coming up anymore. The Rust learning curve is a bit sharper than C for the first weeks but gets you to a competent and non-dangerous state much more quickly after that. This problem is not exp…
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#108Earlier quoted context omitted.
The wish of the lead developer is for Linux development to continue beyond the life of the current maintainers. Training to be a competent system programmer using C is unnecessary long and painful. There aren't enough C hackers coming up anymore. The Rust learning curve is a bit sharper than C for the first weeks but gets you to a competent and non-dangerous state much more quickly after that. This problem is not exp…
I don't understand this argument...C is a very simple language. Does the proverbial rust programmer who doesn't know C even exist?
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#109Earlier quoted context omitted.
> 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
If I knew the answer I would design programming languages ;) Replacing `Either` with something like `this | that` like in Typescript might be going into the right direction though. Zig has similar syntax sugar for Rust's Result and Option. Such things are so fundamental that they should be part of the language instead of the stdlib IMHO.
> Don't see how this is a Typing issue, sounds more like API issue
Designing an API is a typing issue, because an API is essentially nothing more than a list of types.
Re: Linus Torvalds talks AI, Rust, & why Linux is the only thing that matters
#110Earlier quoted context omitted.
> 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 th…
Going too far into either extreme has more downsides than upsides - yes, strongly typed code will be more correct because the types might catch usage 'logic errors' during compilation, but also harder to maintain when requirements change (because strong types tend to creep into every little corner of a code base - and they are extremely rigid by design making the code which uses them also very rigid).
My goto example where I burned myself in the past is splitting a vec4 into point and vector types.
It totally makes sense from a theoretical design pov (e.g. `point + point` would be illegal, while `point + vector` or `vector + vector` are allowed). But in reality such code is awkward to work with for many little reasons, and the enforced correctness pretty much never catches bugs, it just adds pointless busy work when the code needs to change.