Rethinking Rust's Potential for Game Development
Todays Issue: Rust in Game Dev, RustNL 2024 Conference, Building React v18 with Rust, and Boxing Bugs
Hello Rustacean! Welcome to another edition of the Rust Bytes newsletter. In this issue, we'll shine a spotlight on an amazing Rust project, present our spot-the-bug challenge, and share some incredible links of the week.
Welcome to Issue 21!
The Main Thing
The Current State of Rust Game Development 🎮
Recent discussions surrounding Rust in game development have highlighted various criticisms, prompting a closer look at its current state and capabilities. While Rust has attracted significant interest for its potential in game development, recent discussions have highlighted some challenges and negative perceptions.
Although libraries and frameworks like Bevy, Amethyst, and Piston are under active development, the available tools and features for Rust game development are still expanding at a slower pace compared to established engines.
Current Challenges
Compared to established engines, Rust's younger game dev ecosystem offers fewer tools and features. Additionally, its unique ownership and borrowing concepts may present a steep learning curve for some developers, requiring significant upfront investment in learning and mastery.
Also its important to mention that while graphics libraries like gfx and wgpu are evolving, they may not yet match the maturity and ease of use of established APIs like DirectX or Vulkan. Early Rust game dev hype might have caused disappointment due to ecosystem limitations, like the loglog team recently abandoning Rust for game development.
Moving Forward
While Rust game development might not be equipped for the high-budget, large-scale productions that define AAA games yet, it offers a compelling alternative for developers seeking a performant, safe, and future-proof approach. As the ecosystem matures and the community thrives, Rust's potential in game development is undeniable. The current downside is lack of mature and stable ecosystem of tools.
Spot the Bug
Identify why the code fails to compile and suggest a way to fix it.
Try the code on Rust Playground.
Share your solution in the comments below for a chance to be featured in our next newsletter.
Project Spotlight
Yew
Yew is a modern Rust framework for building blazing-fast web applications with WebAssembly.
Why Yew?
Intuitive UI with Yew’s macro system lets you declare interactive HTML with familiar Rust expressions, making it a breeze for React veterans to pick up.
Blazing performance: Yew minimizes DOM manipulations and offloads tasks to Web Workers, resulting in lightning-fast page renders and smooth user experiences.
Need to integrate with existing JavaScript libraries or frameworks? Yew's got your back, offering seamless interoperability between Rust and the JavaScript world.
Yew is open-source on GitHub.
Awesome links of the week
Patryk Wychowaniec wrote a series about simulating bird evolution using a combination of a neural network and a genetic algorithm. Link.
Thanaphoom Babparn wrote about the feasibility of implementing cronjob with Rust. Link.
RustNL conference 2024 is happening next week in Delft, The Netherlands. Amazing speakers include Niko Matsakis, Mara Bos, Alice Ryhl, Raph Levien e.t.c Link.
Ayou wrote about implementing React v18 from scratch using WASM and Rust. Link.
D. Bohdan argues that Rust, while a powerful and safe language, might not be the best choice for projects requiring rapid iteration, especially for startups. Link.
Gaspard Boursin, from Meteroid, shared their learnings and insights on building a SaaS with Rust. Link.
Louis Dureuil discussed the challenges and considerations involved in writing safe, sound crates in Rust that use unsafe code, specifically focusing on the nolife crate. Link.
Calling Rust game developers! 🎮 Take this quick survey to share your experiences and help shape the future of Rust game dev at RustNL 2024. Link.
Burcu Bayhan authored an introductory guide to Rust Programming on the ApiumHum blog. Link.
Stlplaces blogged about how to handle concurrency in Rust. Link.
Spot The Bug: Solution
The Bug:
The bug in the code is due to the attempt to create a vector of trait objects (dyn Animal) directly from instances of concrete types (Dog and Cat). This is not possible because trait objects have a dynamic size that is not known at compile time.
To fix the bug, you need to box the instances of Dog and Cat before adding them to the vector.
Solution:
```
let animals: Vec<Box<dyn Animal>> = vec![Box::new(dog),Box::new(cat)];
```
In the corrected code, dog and cat are boxed (Box::new(dog) and Box::new(cat)) before being added to the vector. This allows them to be treated as trait objects with a known size at compile time.Before You Go
To support the newsletter:
❤️ Recommend the newsletter to your friends: it really helps.
💸 Sponsor the newsletter.
🤳 Check us out on our socials: X, Rustaceans Publication.
📨 Contact us through rustaceanseditors@gmail.com feedback is welcome.
That's all for now, Rustaceans! Until next issue, have a productive week ahead.




I’m a security researcher so you’d think I’d be all for Rust… Creating an entire new language with hideous syntax to prevent memory bugs that are now far more rare and difficult to exploit it just misguided. Memory safety is in a ton of languages that already exist but it’s irrelevant because the biggest issue is not sexy 0days. It’s the fact users freely give their passwords away and reuse them…