255 private links
Différent ways to handle errors in Rust.
In favor of the clap crate that allows delevopers to build quickly in Rust.
It does not work on my Raspberry Pi yet.
I get a:
atuin: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.39' not found (required by atuin)
rustup target add armv7-unknown-linux-gnueabihf
sudo apt-get install gcc-arm-linux-gnueabihf libgcc-13-dev-armhf-cross
- In
~/.cargo/config.toml
:[target.armv7-unknown-linux-gnueabihf] linker = "arm-linux-gnueabihf-gcc"
cargo install --target=armv7-unknown-linux-gnueabihf --target-dir=$(pwd) --root=$(pwd) BINARY
- Upload the binray to the raspberry pi, i.e.
/usr/local/bin
After a first successful installation, only 4. and 5. are of course required.
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