Published May 3, 2023

SE Radio 562: Bastian Gruber on Rust Web Development

Bastian Gruber delves into Rust's strengths for web development, covering tooling, testing, and code formatting essentials, as well as the practical applications of Warp and Axiom frameworks. He provides a comprehensive overview of Rust's performance and safety benefits for server-based applications, offering valuable insights into efficient and maintainable web programming.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • Cargo & Compiler

    Cargo, Rust's package manager, is essential for managing dependencies and building projects. explains that Cargo allows developers to create new projects, add dependencies, and build optimized binaries for deployment. He emphasizes the importance of befriending the Rust compiler, which provides detailed error messages to guide developers in writing correct code 1. Gruber suggests viewing the compiler as a pair programming buddy, as it helps ensure code safety and correctness 2.

    The Rust compiler will tell you every aspect of what you have to fix until it's finally able to compile.

    ---

    This approach contrasts with other languages where errors may only appear at runtime.

       

    Testing & WebAssembly

    Rust's built-in testing features, such as the test macro, facilitate unit testing by allowing developers to annotate functions and run tests using Cargo. highlights the flexibility of Rust's testing infrastructure, which supports both unit and integration tests 3. He also discusses the potential for Rust to expand into front-end development through WebAssembly, enabling complex computations in the browser 4.

    Rust comes with a test macro, and you can use it for functions to write your unit tests.

    ---

    This versatility makes Rust a compelling choice for comprehensive web development.

       

    Code Quality

    Maintaining code quality in Rust is streamlined with tools like rustfmt, which enforces a consistent style across projects. notes that rustfmt helps organize code by sorting imports and ensuring adherence to team-defined standards 5. Additionally, Clippy, a linting tool, assists in writing idiomatic Rust code by suggesting improvements and enforcing coding standards 2.

    Clippy is sort of like writing idiomatic Rust code. It's a tool that was not part of Cargo in the beginning and now it's part of it.

    ---

    These tools collectively enhance the readability and maintainability of Rust projects.

Related Episodes