News for hackers. Stuff that matters.
Re:Why writing a linked list in safe Rust is so damned hard by gilbetron on Thursday February 22, 2018 @08:16PM (#16443326)
All of C and C++ is basically unsafe, and we got a lot done with it! It's ok to use unsafe from time to time if you really need to :)
Re:Why writing a linked list in safe Rust is so damned hard by _sdegutis on Thursday February 22, 2018 @08:31PM (#16443414)
Right but the hope was that Rust was all the way safe, not just most of the way safe. That’s it main niche. That’s why someone would choose it over C++. But if 95% of your code is safe and 5% of your code isn’t, and the safe 95% uses that unsafe 5% all over the place, it inherently makes the safe code an entry point into unsafe code, kinda-sorta making it unsafe too. So it ends up feeling like all the hard work to keep things safe was a waste.
Re:Why writing a linked list in safe Rust is so damned hard by reificator on Thursday February 22, 2018 @08:38PM (#16443454)
But when you're debugging, you know where to focus your efforts.

If 95% of your code touches the other 5%, then that 5% is probably pretty important and useful and hopefully fast. Spending some extra time to verify safety in exchange for speed/control is a small price to pay, and will pay dividends from the other 95% of code that doesn't have to be inspected so closely.

Re:Why writing a linked list in safe Rust is so damned hard by nickm12 on Thursday February 22, 2018 @09:17PM (#16443668)
No, the objective for Rust was never to be all the way safe.

Rust gets much inspired by C++ and seeks to be a systems language where " there should be no room for a lower-level language between [it] and native machine code".

If you want that, you need unsafe blocks. The intent is to use those blocks to build safe abstractions that can be used for the lion's share of your program.

Re:Why writing a linked list in safe Rust is so damned hard by mehrdadn on Friday February 23, 2018 @12:33AM (#16444449)
> "there should be no room for a lower-level language between [it] and native machine code"

I hadn't heard this before, and I love it! This seems like a very nice way to define what a systems programming language is. :-)