228 private links
Magisk is a suite of open source software for customizing Android, supporting devices higher than Android 6.0.
The native
part is written in Rust.
A joke about rust infrastructure. It becomes obsolete as time goes.
- avoid uneccessary default features
- use specialized lighter crates
I have the same idea for a node js backend serving a fancy UI :)
It would be better to split the UI and the server while developing to benefit from hot reloading.
Example: https://git.sr.ht/~pyrossh/rust-embed/tree/master/item/examples/axum-spa/main.rs
- relying on shared mutation
- treat the compiler as something trying to help
- ignoring proper module organization
You have to unlearn a few habits.
- Writing Rust code like other languages
- Neglecting the most important 20% of Rust. Trying to learn everything at once: you don't need to learn all at once. Focus on the 20% that gives the 80%.
- Being a productive procrastinator: watch a video or read a blog post.
- Thinking you can vibe code Rust like JS...
Hands on practice! The programmer has to internalize the concepts of Rust. Getting a grasp is not enough.
Replace the standard DefaultHasher
to ahash::{AHashMap, AHashSet}
to gain 18% improvements.
I don't understand some things here
- gen blocks: similar to python generators as far as I understand. They are lightweight compared to the classic Iterator pattern
- default field values (and avoid new() for it)
- inner structs
- never type
- try expressions
The ability to run scripts is also a great feature imho.
Create a type similar to another existing type :O
Some interesting statistics.
Rust interact with other parts of the codebase through
- Rest API (56%)
- Language interop (44%)
- RPC (21%)
- WebAssembly /WASI (19%)
Projects developed in Rust are:
- CLI tools (40%)
- Systems programming (38%)
- Web development (35%)
- Desktop / GUI applications (21%)
- Network programming (17%)
- Embedded / IoT (12%)
- Academic /Scientific / Numeric (9%)
and more games, databases, DevOps, Security, data science / ML / AI, Blockchain, ...
As for why: write safer code, build high-performance applications, iterest or fun, improve skills and career opportunities (stay competitive in the industry), handle concurrency or multithreading safely, ...
How to learn?
- official rust documentation (95%)
- books (32%)
- video or podcasts (19%)
- online courses (12%)
- University or academic coursework (5%)
and employer-provided training, rust training companies, ...
In the meantime, it consumes 10 times more resources than the tool htop
A performance bounty program
Enable logs depending of the RUST_LOG
env variable.