tinyvec
Just, really the littlest Vec you could need. So smol. (by Lokathor)
totally-safe-transmute | tinyvec | |
---|---|---|
17 | 4 | |
256 | 647 | |
- | - | |
0.0 | 6.1 | |
almost 2 years ago | about 2 months ago | |
Rust | Rust | |
- | Apache License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.
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.
totally-safe-transmute
Posts with mentions or reviews of totally-safe-transmute.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-01-20.
-
Sudo Replacement
For example, there is this (pure safe Rust) code: https://github.com/ben0x539/totally-safe-transmute/blob/main... which accesses external resources (/proc/self/mem) in order to violate the safety guarantees.
-
A rust crate that lets you compress ASCII text to a single Unicode "character"
The first is the totally_safe_transmute crate. I mean, who wouldn't love library code that has .expect("welp") and .expect("oof") as its error handling? But that's not even the really scary part. Issue #2 ("i hate this") remains open to this day, but for obvious reasons there's no chance of resolution. This post has some context and a line-by-line explanation of how it works.
-
What do you expect from Rust in 2023?
You mean like this?
-
In C# you can transmute without `unsafe`
You can also do that in rust on linux: https://github.com/ben0x539/totally-safe-transmute/blob/master/src/lib.rs
-
Why choose Rust
I want to correct this statement: Rust can be safer, but not if a library you use contains unsound code. Unsoundness is most often caused by unsafe code, but not always (totally_safe_transmute, anyone?). There is a misconception that unsafe code blocks are always unsound and should be avoided at all costs, but they're completely fine if the safety contracts are upheld. In fact, unsafe blocks isolate the potential issues to make it easier to identify where undefined behavior may be occurring. unsafe code blocks are a feature of the language, and their usage should not be viewed as opting out of any safety the language provides, imo.
-
"# NONONONONONO DON'T YOU FUCKIN' DARE the safety features are there so that your programs aren't filled to the brim with security vulnerabilities. Unless you care A LOT(And I mean A LOT A LOT) about compile times, never use `unsafe`."
Just reimplement totally_safe_transmute in Zig. No need for unsafe.
-
I mean, it solves most library conflicts
Why transmute() when you can totally_safe_transmute()?
- Safe Transmute
-
Static Analyzer Rudra Found over 200 Memory Safety Issues in Rust Crates
Well, there is always the totally-safe-transmute.
-
// SAFETY: NO
They should use https://github.com/ben0x539/totally-safe-transmute
tinyvec
Posts with mentions or reviews of tinyvec.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-05-01.
-
The Better Alternative to Lifetime GATs
funny indeed. i changed all my projects to use tinyvec
-
"pure safe crates"
I've seen the cost of zeroing memory be measurable, or maybe significant enough to care about, but I've never seen 90% of cycles spent on it, the only case I know of that gets close is creating an empty TinyVec versus an empty SmallVec with an inline buffer of 256 bytes. In my opinion that's an unreasonably large inline buffer. At inline buffers of 128 bytes and below, the overhead is less than 50%, and that's on a microbenchmark of the Default impl; the effect is rapidly diluted in a real program.
-
single-producer single-consumer concurrent queue
My point is that "implementation that doesn't use unsafe" is not necessarily always slower than "implementation that does use unsafe". Often people assume that this is the case, and it isn't. tinyvec currently beats smallvec in more than a few benchmarks. Not all, but some. And this sometimes visible to users. The point is that if you want speed, you don't necessarily need to give up any safety at all. Most differences in performance are due to the amount of effort or expertise that has been spent on the codebase, not the amount of unsafe in it.
-
Now that the long-awaited const generics (MVP) have come to stable in 1.51, what crates are going to gain the most from it?
https://github.com/Lokathor/tinyvec will definitely benefit, although not as much as something currently relying on typenum.
What are some alternatives?
When comparing totally-safe-transmute and tinyvec you can also consider the following projects:
project-safe-transmute - Project group working on the "safe transmute" feature
heapless - Heapless, `static` friendly data structures
DumbIdeas
trantor - a non-blocking I/O tcp network lib based on c++14/17
tamago - TamaGo - ARM/RISC-V bare metal Go
storages-api
advisory-db - Security advisory database for Rust crates published through crates.io
utils - Utility crates used in RustCrypto
UnsoundCrates - Black list of all crates that promotes unsoundness
tyrade - A pure functional language for type-level programming in Rust
base32768 - Binary-to-text encoding highly optimised for UTF-16
serde - Serialization framework for Rust
totally-safe-transmute vs project-safe-transmute
tinyvec vs heapless
totally-safe-transmute vs DumbIdeas
tinyvec vs trantor
totally-safe-transmute vs tamago
tinyvec vs storages-api
totally-safe-transmute vs advisory-db
tinyvec vs utils
totally-safe-transmute vs UnsoundCrates
tinyvec vs tyrade
totally-safe-transmute vs base32768
tinyvec vs serde