I started as a Solidity developer.
Now I’m learning the art of blockchain security, one audit and one line of Rust at a time.
I share what I’m learning from @CodeHawks, real audit patterns, and my journey toward mastering Rust, formal verification, and ZK security......
Introducing CUDA Rust!
CUDA Rust lets you write GPU kernels natively in Rust, not just launch them from it.
Two paths: cuda-oxide for SIMT kernels compiled to PTX, and cutile-rs for Tile-based programming on stable Rust. Both can catch aliasing errors at compile time.
Technical blog: https://t.co/5mYSRnQkBB
Been calling .collect() for weeks. Finally understood what makes it work.
It's the FromIterator trait.
When you collect(), Rust checks if the target type implements FromIterator.
If yes, it calls from_iter() and the collection builds itself from the iterator.
Vec, HashMap, HashSet, String all implement it.
You can implement it on your own types too.
std::env::args() also uses this: it's an iterator over CLI arguments.
Collect into Vec<String> and you have your program's inputs. First element is the binary name.
#RustLang #LearningInPublic #Rust #BlockchainDev
One of my first real Rust project looked finished. It wasn't. I kept every wrong attempt: two wrong operators, a syntax tangle, and a panic bug I missed until after I thought I was done. Full breakdown here:
https://t.co/46ZCRhdIHJ
#Rust#Solidity#Web3#BuildInPublic
fold() in Rust: give it a starting value and a closure. It threads the result through every element and returns the final accumulation. sum(), max(), count() are all just fold() in disguise.
#RustLang#LearningInPublic#Rust
Thanks to AI and Skills, web3 developers can now do so much for the security of his project just on their own - it was never possible before
Vulnerabilities are still going to exist, but whole classes of them are going extinct from audits, for the best. Time to get better🫡
Rust's zip() pairs two iterators together. When the shorter one runs out, it stops. No padding. No error. Just ends. Took me a moment to expect that behaviour.
#RustLang#LearningInPublic#Rust
In Rust, every value has exactly one owner at any moment. When that owner goes out of scope, the value is dropped. Borrowing is a temporary, scoped loan of access to a value. it does not transfer ownership.
#rust#rustlang
When you fight the borrow checker, the first question to ask yourself is always: "What do I actually want the ownership to be here?" Not "how do I make this compile?" "What is the correct ownership structure for this data?"
#rust#rustlang
The borrow checker's entire job is to enforce that these loans never outlive the thing they borrow from, and that mutable loans are never concurrent with any other loan.
#rust#rustlang
This Week's Project Spotlight 🦀
zbus
Zbus is a Rust API for D-Bus communication. It’s goal is to provide a safe and simple high- and low-level API akin to GDBus, that doesn't depend on C libraries.
#rustlang#rust
Rust's move keyword forces a closure to take ownership of captured variables instead of borrowing. Useful when the closure needs to outlive the scope it was created in. #RustLang#LearningInPublic#Rust