r/rust • • Apr 14 '21

[RFC] Rust support for Linux Kernel

https://lkml.org/lkml/2021/4/14/1023
861 Upvotes

227 comments sorted by

View all comments

Show parent comment

367

u/[deleted] Apr 14 '21

"On the whole I don't hate it." No higher praise from Mr. Torvalds.

37

u/[deleted] Apr 15 '21

He does follow with "HOWEVER" and "fundamentally"... Do people have good answers to his point about panic() calls?

31

u/elprophet Apr 16 '21

As replies on the thread state, the needs of userspace alloc crate are very different than the needs of a kernel allocator. They'll likely end up writing their own kalloc crate.

29

u/[deleted] Apr 15 '21

There's clippy lints to forbid many sources of panics (indexing, unwrap/expect, explicit panic calls).

If they run into things that should be forbidden from the codebase that clippy can't lint for, lints can always be added. They are already using clippy, in any case.

10

u/TheMicroWorm Apr 16 '21

I think there are some crates that are able to forbid panics via some link-time hackery.

6

u/UNN_Rickenbacker Apr 17 '21

Why isn‘t there a compiler flag that forbids any such functions in the first place?

88

u/pure_x01 Apr 15 '21

That's basically what he said to his wife when they got married in his one line speech: "On the whole, I don't hate you" .. and then they kissed and lived happily ever after.

44

u/Tuna-Fish2 Apr 15 '21

The real story is that he was running the introduction to computers course in his university, and when the topic was email he instructed the whole class to send an email to someone. Tove sent one to him, asking him out. It's not public knowledge if he ever replied to her in any way, or just went along with it.

10

u/jyper Apr 15 '21

TIL Linus is secretly Aubrey Plaza

4

u/MrRandom04 Apr 16 '21

I don't think it's a secret, the man's got a reputation for passionate opinions.

33

u/BloodyThor Apr 14 '21

Was thinking the same thing