r/linux • • Apr 14 '21

Kernel [RFC] Rust support in the Linux kernel

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

316 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Apr 15 '21

Besides productivity while working on the source code when compilations takes long, what exactly is bad about long compilation times?

5

u/continous Apr 15 '21

I mean, it's in the name. Long. Generally, you don't want something to take longer for no significantly good reason.

10

u/[deleted] Apr 15 '21

Well, the reason here is that the compiler checks for more errors. Isn't that a good reason?

2

u/continous Apr 15 '21

Theoretically, but if it only catches/solves one error for a 5-10x increase in compile time, that's really not a good position.

7

u/[deleted] Apr 15 '21

I think the "how much" depends on yes, the amount of errors, but also what kind of errors. Some are pretty easy to catch (e.g. forgotten semicolon) and some are harder (e.g. buffer overflow). And harder errors obviously take longer.

-2

u/continous Apr 15 '21

I think the "how much" depends on yes, the amount of errors, but also what kind of errors.

Even then, the issue is that a 5-10x increase to find a single, even if major, error, is a massive time increase. The assumption as well, here, is that implementing rust will automatically find these problems. That's a large assumption.

1

u/[deleted] Apr 15 '21

Yeah, it definitely depends on how much longer it's going to take, how many and how severe the errors are, and on how well the compiler is at finding them.

10

u/[deleted] Apr 15 '21

You would rather hunt down obscure bugs later in development than it to never happen?

"Why should I write tests which just increase development time..."

1

u/continous Apr 15 '21

I would rather hunt down obscure bugs now, then try and implement an entirely new feature set that will hopefully find them.

2

u/IAm_A_Complete_Idiot Apr 16 '21

Safe rust guarentees no undefined behavior and memory issues. It's not a hopefully. If you used safe abstractions someone already made in the kernel, UB shouldn't be a thing.

-1

u/i-can-sleep-for-days Apr 15 '21

Scala has entered the chat

3

u/[deleted] Apr 15 '21

This does not answer my question...