getrandom
A small cross-platform library for retrieving random data from (operating) system source (by rust-random)
rust-delegate
Rust method delegation with less boilerplate (by Kobzol)
Our great sponsors
getrandom | rust-delegate | |
---|---|---|
8 | 8 | |
254 | 418 | |
2.0% | - | |
7.0 | 6.7 | |
12 days ago | 4 months ago | |
Rust | Rust | |
Apache License 2.0 | 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.
getrandom
Posts with mentions or reviews of getrandom.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-03-11.
-
We have getrandom at home
The crypto source in Go is great, no complaints there. Lints like gosec even recommend using it when generating crypto entropy. Go did a good job here, and I expect Rust will do the same sometime after getrandom reaches 1.0 so the API questions are settled, plus whatever makes sense for the future-proofing the standard library needs.
-
Fellow Rust enthusiasts: What "sucks" about Rust?
I would wait for the getrandom crate to reach 1.0, which will answer many of the questions around what an API like this can look like, and then maybe the standard library discussion will be on firmer footing because at least we'll know what API we want to immortalize. Rushing that now just to save people importing a small crate does not seem to be the way to go.
-
Introduction to Random Number Generation in Rust
I'd caution against using /dev/random directly, and instead recommend using getrandom. It's effectively the same thing on Haiku and Redox, but is cross-platform and will upgrade to better sources on various platforms as available (such as using the getrandom() call on Linux and Android, or getentropy() on macOs, if avaialable).
-
Alea: fast and easy random number generation in Rust
getrandom
-
Why I rewrote my Rust keyboard firmware in Zig: consistency, mastery, and fun
It's a default, but overwritable behavior, see the #[path] attribute. You still have to create N files for each supported platform, but at the top level you will see only one module. On of the crates which uses this approach in practice is getrandom.
-
String, Vec<T>, Box<T>, Rc<T>... could be moved from alloc to core
IIUC the main problem which prevents from moving HashMap & co to alloc is lack of API to get system entropy which is required for DOS protection. Ideally we would have a #[global_allocator]-like functionality for retrieving system entropy. Relevant issue: https://github.com/rust-random/getrandom/issues/21
rust-delegate
Posts with mentions or reviews of rust-delegate.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-12-08.
-
On inheritance and why it's good Rust doesn't have it
Ah, that answers the first question, as to how inheritance is superior to manual delegation. By the way, this crate seems to do a good job of supporting delegation: https://crates.io/crates/delegate. I have nothing against this in principle.
-
Fellow Rust enthusiasts: What "sucks" about Rust?
This is certainly one that's bugged me too. There's the delegate crate which helps, but is still a decent amount of boilerplate due to macro limitations
- Enum variants share Trait while Parent does not - A Better solution?
-
Hey Rustaceans! Got a question? Ask here! (44/2022)!
As u/onomatopeiaddx said, it isn't possible since macros only have access to the token tree it is given. I don't see why a newtype wouldn't work tho. and to help with newtypes you may want to have a look at the delegate crate
-
The Rust RFC process does not seem as amazing as I initially thought
Macros, probably. For example this one, that was already made by someone else, published on crates.io and is actively maintained. If the feature is already possible in rust, but requires a lot of boilerplate, then macros are the answer 99% of the time.
-
Inheritance to composition
delegate crate would reduce some boilerplate.
- Is there a way to append to struct in Rust?
What are some alternatives?
When comparing getrandom and rust-delegate you can also consider the following projects:
nanorand-rs - A tiny, fast, zero-dep library for random number generation
born - Remove code duplication from Struct and Enum with functional macros.
pollster - A minimal async executor that lets you block on a future
dislike-in-rust - A list of the few things I don't like about rust
gosec - Go security checker
compiler-team - A home for compiler team planning documents, meeting minutes, and other such things.
rand - A Rust library for random number generation.
SHLL - An experiment of high level code optimization
rust-orphan-rules - An unofficial, experimental place for documenting and gathering feedback on the design problems around Rust's orphan rules
askama - Type-safe, compiled Jinja-like templates for Rust
getrandom vs nanorand-rs
rust-delegate vs born
getrandom vs pollster
rust-delegate vs dislike-in-rust
getrandom vs gosec
rust-delegate vs pollster
getrandom vs dislike-in-rust
rust-delegate vs compiler-team
getrandom vs rand
rust-delegate vs SHLL
getrandom vs rust-orphan-rules
rust-delegate vs askama