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

Reduce Rust unsafe code to help readability #70

Open
chemix-lunacy opened this issue Aug 14, 2024 · 0 comments
Open

Reduce Rust unsafe code to help readability #70

chemix-lunacy opened this issue Aug 14, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@chemix-lunacy
Copy link
Contributor

chemix-lunacy commented Aug 14, 2024

See if the unsafe code can be reduced or removed to help with onboarding other people to the project.

For background: Rusts borrows are nowhere near comprehensive enough to deal with the majority of data structures in Rasqal. Due to this the singular mutability rules are increadibly restrictive. Due to this custom smart pointers were built which utilize Rusts various ways to deal with unrestricted mutability (https://github.com/rust-lang/rust/blob/334e509912d82323ff0fca016a2e69dbbee559fd/library/core/src/cell.rs#L1)
and raw pointers, including some custom ways we deal with pointer expansion and contraction.

All of these will still be required, but some work should be done around making them a bit less primeval, which includes:

  1. Cleaning up the shared mutability API of the smart-pointer and making it cleaner to use and preferably entirely opaque.
  2. Remove the macro and just bake the capabilities into the smart-pointer itself.
  3. Changing many methods to mutable if they should be mutable when the smart-pointer can opaquely change betwen mutable and immutable at will.
@chemix-lunacy chemix-lunacy added the enhancement New feature or request label Aug 14, 2024
@chemix-lunacy chemix-lunacy self-assigned this Aug 14, 2024
@chemix-lunacy chemix-lunacy changed the title Reduce Rust violations to help readability Reduce Rust unsafe code to help readability Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant