Welcome to the latest edition of Rust Trends! This week, we explore exciting advancements in Rust, including the integration of Nextest for enhanced testing, and a deep dive into Fusion Engineering’s use of Rust in drone technology. We also introduce a selection of innovative Rust-centric editors to boost your productivity. Stay informed and inspired with the latest updates from the Rust community!
Happy Coding
Boost Your Productivity with Nextest
In the fast-paced world of software development, we’re all looking for ways to be more productive and efficient. Enter Nextest, a cutting-edge test runner for Rust. Built to supercharge your testing experience, Nextest offers blazing-fast performance and a rich set of features that streamline the testing process.
Why choose Nextest over the traditional cargo test? While cargo test is reliable and effective, Nextest takes your testing to the next level with:
- Parallel Test Execution: Run multiple tests simultaneously, significantly reducing your overall test run time.
- Advanced Reporting: Gain detailed insights with comprehensive and easy-to-read test reports.
- Minimal Overhead: Experience faster start-up times and lower resource consumption, optimizing your development workflow.
Nextest integrates seamlessly into your workflow, helping you catch bugs faster and deliver robust code with confidence.
Don’t just take my word for it — head over to Nextest’s website and give it a try. Experience firsthand how it can transform your productivity and make your Rust development smoother and more enjoyable. Happy coding!
Podcast Highlight: Rust used in Drone technology
In the latest episode of the “Rust in Production” podcast, Jakub Valtar from Fusion Engineering shares his insights on using Rust to develop next-generation flight controllers for drones. This episode is a must-listen for anyone interested in drone technology and Rust’s application in performance-critical environments. As I am building my own flight controller, Jakub’s discussion on their use of Rust, specific crates, hardware, and design patterns was particularly enlightening.
Why Fusion Engineering Chose Rust
Fusion Engineering transitioned from C++ to Rust to take advantage of its memory safety, type system, and concurrency features. Jakub highlighted how Rust’s focus on performance, reliability, and productivity aligns perfectly with the needs of flight controllers. Rust helps prevent many common bugs and ensures that critical software operates smoothly without unexpected crashes.
Key Crates Used by Fusion Engineering
- inline-python: Embeds Python code directly in Rust, useful for simulations and plotting outputs.
- intbits: Works with individual bits, crucial for hardware drivers.
- git-version: Embeds Git version information in binaries, ensuring version consistency across software components.
- anyhow and thiserror: Streamline error handling.
- nalgebra: Handles complex mathematical computations needed for flight control algorithms.
- arrayvec: Manages fixed-size arrays to avoid dynamic allocations, crucial for predictable performance.
Hardware and Software Patterns
Fusion Engineering’s hardware setup includes a custom PCB with sensors and an STM32 microcontroller, along with a Raspberry Pi Compute Module 4 running a Linux-based system. They employ several design patterns to ensure robust and maintainable code:
- Newtype Pattern: Encapsulates primitive types to add semantic meaning and avoid errors.
- Enum States: Manages different modes and states of the drone, ensuring clear and maintainable state transitions.
- Service-Oriented Architecture: Runs different processes as separate services, each responsible for specific tasks, communicating through shared memory e.g. files.
Benefits of Using Rust
Rust’s ecosystem, including its package manager, testing framework, and excellent documentation, has enabled Fusion Engineering to maintain high-quality code. The strong type system and memory safety guarantees have made Rust an ideal choice for their multidisciplinary team, allowing both software engineers and control engineers to contribute effectively, this would not have been possible with C/C++.
About Mara Bos
Fusion Engineering was co-founded by Mara Bos, a prominent figure in the Rust community and a member of the Rust team. Mara is well-known for her contributions to Rust’s development and for authoring the book Rust Atomics and Locks, which delves into concurrency in Rust. Her leadership and expertise have been instrumental in driving Fusion Engineering’s innovative use of Rust for drone technology.
To dive deeper into how Fusion Engineering leverages Rust for their innovative drone technology, check out the full episode of Rust in Production Ep 13 featuring Jakub Valtar. Whether you’re an experienced Rustacean or just curious about Rust’s applications in drone technology, this episode is packed with valuable insights and practical advice. Don’t miss it!
Try Out a New Rust Editor: Lapce, Helix, Zed, and RustRover
Exploring new editors besides VSCode, can enhance your productivity and coding experience. Here are four exciting options to consider:
RustRover
RustRover is a Rust-centric IDE offering advanced features like intelligent code completion, refactoring, and real-time error detection. Explore RustRover here. Specifically recommended if you are starting out with Rust.
Lapce
Lapce is a lightning-fast code editor with native GUI, written in Rust for performance and reliability. Check it out here.
Helix
Helix is a post-modern modal text editor with a focus on simplicity and powerful editing features inspired by modal editors like Vim. Learn more here.
Zed
Zed is a collaborative code editor designed to help teams work together in real-time, featuring a sleek and intuitive interface. Discover Zed here.
Each of these editors offers unique features tailored to different coding needs, so give them a try and see which one best fits your workflow!
Snippets
We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don't keep it to yourself — share it with your network and let's grow the Rust community together.
👉 Take Action Now:
Share: Forward this email to share this newsletter with your colleagues and friends.
Engage: Have thoughts or questions? Reply to this email.
Subscribe: Not a subscriber yet? Click here to never miss an update from Rust Trends.
Cheers, Bob Peters