stable_deref_trait
zorrow
stable_deref_trait | zorrow | |
---|---|---|
4 | 2 | |
29 | 94 | |
- | - | |
1.2 | 10.0 | |
about 1 year ago | over 1 year ago | |
Rust | Zig | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
stable_deref_trait
-
Build a PinePhone App with Zig and Zgt
To elaborate, there is a recurring trend of sound C programs turning into unsound Rust programs, because shared mutability is often necessary but Stacked Borrows places strict conditions on constructing &mut T (they invalidate some but not all aliasing *const T), and it's less ergonomic to work solely in raw pointers and avoid creating Box or long-lasting &mut T (or for intrusive collections, any &mut T at all).
For example, matklad (the author of rust-analyzer, one of the preeminent Rust programmers and someone I'd expect to get code right) made a recent blog post on "Caches In Rust" (https://matklad.github.io/2022/06/11/caches-in-rust.html). The cache is built around https://docs.rs/elsa, which is built around https://docs.rs/stable_deref_trait/latest/stable_deref_trait..., which is unsound for Box and violates stacked borrows in its current form (https://github.com/Storyyeller/stable_deref_trait/issues/15). However, the rules may be relaxed or more ergonomic alternatives added (https://github.com/rust-lang/unsafe-code-guidelines/issues/3...), it's uncertain right now.
(Also I go by "they".)
-
How Safe Is Zig?
Unsafe Rust is an esoteric language without iron-clad guarantees, and type-level programming and async Rust is an esoteric metalanguage (https://hirrolot.github.io/posts/rust-is-hard-or-the-misery-...). For example, matklad made a recent blog post on "Caches In Rust" (https://matklad.github.io/2022/06/11/caches-in-rust.html). The cache is built around https://docs.rs/elsa, which is built around https://docs.rs/stable_deref_trait/latest/stable_deref_trait..., which is unsound for Box and violates stacked borrows: https://github.com/Storyyeller/stable_deref_trait/issues/15
There is a recurring trend of sound C programs turning into unsound Rust programs, because shared mutability is often necessary but it's difficult to avoid creating &mut, and Stacked Borrows places strict conditions on constructing &mut T (they invalidate some but not all aliasing *const T).
-
Blog Post: Caches In Rust
The cache is built around https://docs.rs/elsa, which is built around https://docs.rs/stable_deref_trait/latest/stable_deref_trait/trait.StableDeref.html, which is unsound for Box and violates stacked borrows: https://github.com/Storyyeller/stable_deref_trait/issues/15
-
munge 0.2: Destructure raw pointers, MaybeUninit, cells, pins, and more
StableDeref has multiple issues under the current Stacked Borrows model: https://github.com/Storyyeller/stable_deref_trait/issues/15
zorrow
- Borrow checker for Zig?
-
How Safe Is Zig?
Somebody implemented part of it in the past, but it was based on the ability to observe the order of execution of comptime blocks, which is going to be removed from the language (probably already is).
https://github.com/DutchGhost/zorrow
It's not a complete solution, among other things, because it only works if you use it to access variables, as the language has no way of forcing you.
What are some alternatives?
mmsd
lru-rs - An implementation of a LRU cache
rust - Empowering everyone to build reliable and efficient software.
phosh-antispam
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
munge
pure - A static analysis file format checker.
vvmplayer
Vale - Compiler for the Vale programming language - http://vale.dev/
vvmd