RustWasm to Be Archived
Today’s Issue: There Is No Memory Safety Without Thread Safety, Vivo’s BlueOS Kernel, and Footguns of the Rust WebAssembly Target
Awesome links of last week
Check thread below
What are you doing during a rainy weekend? Instructing CoPilot in #VScode to implement a fully working Blockchain implementation in Rust - with a TUI and WASM-based frontend. I haven't written any line of code, just prompted CoPilot in the right direction. In sum I have spent less than 4 hours on this. I learned a lot about CoPilot, Generative AI, cryptography, and the blockchain technology itself. #GenAI #rust #rustlang #ratatui #wasm #blockchain #crypto #crytography
Ok I'm tired... In #ratatui How Am I supposed to return a Span<'_> from a function ? Where does this lifetime comes from? #rustlang
everything is owned in my function:
fn display_battery_level(bat: f32) -> Span<'_> {
let bat_s = bat.to_string();
match bat {
_ if bat > 50.0 => bat_s.green(),
_ if bat > 25.0 => bat_s.yellow(),
_ => bat_s.red(),
}
}
Red Hat Has Been Rewriting Bash-Based Greenboot in Rust
Dude. It's been a year since I wrote #rustlang code and I feel like I've forgotten the entire language
@kloetzl You can use a concept called "Borrow Splitting" in combination with scoped threads.
This way, your slices that your threads operate on, can have a lifetime shorter than 'static and you don't need to use #unsafe shenanigans.
Please see this playground with comments on how to do this:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=6b028d5bab84d739d34d76d66a750578
On Borrrow Splitting:
https://doc.rust-lang.org/nomicon/borrow-splitting.html
On scoped threads API:
https://doc.rust-lang.org/std/thread/fn.scope.html
In rust, if the macro expansion failed, you get a lot of errors related to the missing macro expansion, which is just noise basically.
I implemented in https://github.com/rust-lang/rust/pull/144409 a check to stop compilation if a macro expansion failed, greatly reducing the number of noisy errors.
Enjoy!
The latest issue of @thisweekinrust is out. We have included 3 issues in the “Call for Participation” section. If you are a Rust developer and want to help fix some issues in our project then please check them out.
These blog posts is a great way to learn about what is going on in the Rust world so definitely worth a read in general.
https://this-week-in-rust.org/blog/2025/07/23/this-week-in-rust-609/