News for hackers. Stuff that matters.
Re:Linux kernel drivers in Rust might become an option in th... by dmitrygr on Friday August 30, 2019 @05:07PM (#20842724)
> Any experienced C programmer who just reads the Rust book should conclude that Rust >> C.

Mighty nice of you to speak for all of us C programmers, so let me continue the story where you left off: The programer then tries it, gets annoyed with complaints about ownership in cases where the programer clearly did nothing wrong, and goes back to getting work done in C, putting the rust book into his long-overflowing "cute toys to play with later" pile

Re:Linux kernel drivers in Rust might become an option in th... by pixel_fcker on Friday August 30, 2019 @07:51PM (#20843766)
“I know this code I’ve just written is safe” is the opening verse for the thousands of security vulnerabilities we see every year.
Re:Linux kernel drivers in Rust might become an option in th... by dmitrygr on Friday August 30, 2019 @08:20PM (#20843896)
I know i can implement an up-tree or a doubly-linked-list safely just fine. I do not need to have a straightjacket put on me that prevents me from doing that.

If you wish to use it, do. If you want to force your employees to do it, feel free. Telling everyone else how to live their lives and do their jobs is a dick move.

Re:Linux kernel drivers in Rust might become an option in th... by dmm on Sunday September 01, 2019 @08:04AM (#20851823)
> I know i can implement an up-tree or a doubly-linked-list safely just fine.

Great, just make a few unsafe definitions for your list implementation and the rest of your code can enjoy memory safety.

Re:Linux kernel drivers in Rust might become an option in th... by giovannibajo1 on Saturday August 31, 2019 @07:07PM (#20849379)
But the point is that there is so much provably safe code that the borrow checker doesn’t understand. Let’s not get confused: Rust borrow checker forces you to write in a very narrow space that it can understand, which is a very small subset of safe programs. Sometimes it’s worth it to be so constrained, others simply don’t.
Re:Linux kernel drivers in Rust might become an option in th... by solarengineer on Friday August 30, 2019 @08:50PM (#20843981)
I wonder if there could be a mechanism for reporting such cases.

" So and So issue detected. If you believe this is not a bug, send this Snippet or A ST as a bug report (If you want, we can do this automatically for you!)"

And also "We've detected so and so issue. Please see our wiki <link to specific issue> for an explanation on what may have triggered this, and for ideas on how to rewrite such code"

Re:Linux kernel drivers in Rust might become an option in th... by dmitrygr on Friday August 30, 2019 @09:04PM (#20844024)
"doubly linked list detected, this language does not support such constructs without 'unsafe' keyword being used to wrap it"
Re:Linux kernel drivers in Rust might become an option in th... by ZirconiumX on Saturday August 31, 2019 @04:15AM (#20845187)
Which is why you implement a doubly linked list using data indices in a Vec<Node>. The resulting data structure is fully safe and resembles an ECS.
Re:Linux kernel drivers in Rust might become an option in th... by dmitrygr on Saturday August 31, 2019 @01:47PM (#20847723)
And features an extra level of indirection for your CPU's dcache prefetch predictor to trip over
Re:Linux kernel drivers in Rust might become an option in th... by hexane360 on Sunday September 01, 2019 @02:08AM (#20850750)