Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I love this idea!! #6

Closed
warlord500 opened this issue Jul 2, 2021 · 1 comment
Closed

I love this idea!! #6

warlord500 opened this issue Jul 2, 2021 · 1 comment

Comments

@warlord500
Copy link

this isn't really an issue per se more of a quick remark!!.
this seems quite cool or amazing.
it might make designing things like many types of linked lists in rust much safer than currently by removing a huge amount of unsafe even if a still must be used! it would be a vast improvement over the current status quo of total unsafe code!.
so far I cant see a flaw in the reasoning that would make this code unsafe in anyway!!
however, I do believe while this can get a lot closer to unsafe pointers performance there can be cases like doubly linked circular list where an enum to say separate the circular links with owner ship slight over with enum discriminant.

i would love to read like a thesis paper on this design!!

@matthieu-m
Copy link
Owner

Hi :)

You may be interested in looking at https://github.com/matthieu-m/ghost-collections.

I combined the usage of GhostCell with StaticRc to implement collections in 100% safe Rust, however I didn't quite manage to reach the full extent of what raw pointers could do:

  • linked_list has no memory overhead, but some operations are a bit complicated than they ought to be.
  • tripod_list has all operations with the expected algorithmic complexity, but it comes at the cost of 1 StaticRc of overhead per node unfortunately.

I am not sure if this is intrinsic to StaticRc, or I just didn't quite figure out how to use it well yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants