I thought there were ways to do it, just not the obvious most efficient ones. If you really *can't*, that makes me a lot more skeptical of the whole Rust model...
-
-
Yes. You can implement naive linked lists without unsafe.
1 reply 0 retweets 4 likes -
OK. I meant that if the type system Rust bases its memory-safety on didn't admit *any* way to do linked lists without unsafe, the whole formalism would be a lot less impressive/valuable than I thought it was...
2 replies 0 retweets 0 likes -
I didn't even know it was possible, now I want to learn what a linked list looks like without using unsafe
2 replies 0 retweets 2 likes -
.
@Gankra_ to the rescue! https://rust-unofficial.github.io/too-many-lists/2 replies 0 retweets 12 likes -
Replying to @pcwalton @RichFelker and
This is a great resource! One thing- I think I have a unique perspective to bring to the table. Zig's focus on not panicking on OOM has surfaced the linked list as a crucial tool for areas of code where an implementation *must not fail*. Lots of examples in the std lib event loop
1 reply 0 retweets 4 likes -
Replying to @andy_kelley @pcwalton and
the core premise of the front page holds: that's a super niche problem (hardening a language's runtime!), and it's not unreasonable to "drop down" to a memory-unsafe system to support it also since this was written, async/await introduced a system for intrusive pointers (Pin)
1 reply 0 retweets 5 likes -
Replying to @Gankra_ @andy_kelley and
Has anyone done a solid intrusive data structure library yet using Pin (to the best of your knowledge)? This is something I'll be wanting in the near future (and if does not exist, will write)
1 reply 0 retweets 4 likes -
Replying to @Brittain_Ben @Gankra_ and
There is, but don't think it uses Pin at all:https://github.com/Amanieu/intrusive-rs …
1 reply 0 retweets 0 likes -
Yeah, I've seen this before. It does not use Pin
1 reply 0 retweets 0 likes
I kind of wonder if it’s possible to use MTE to make a zero-overhead safe heap with multiple ownership on ARM. Problem is it’s only 4 bits of generation :(
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.