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

  • Warp & Axiom

    Bastian Gruber shares insights on using Warp and Axiom for building web applications in Rust. He explains that Warp, chosen for its simplicity and educational value, is suitable for production environments, especially for smaller microservices that fetch and parse external resources 1. Gruber also highlights the filter concept in Warp, which processes incoming HTTP requests through a series of filters to determine if they match expected paths 2.

    You just have to know that you have to do a lot yourself if you want to use it for a complex application.

    ---

    While Axiom is a newer framework, Gruber suggests it might be a better choice for future projects due to its evolving capabilities 1.

       

    Route Handling

    Route handling in Rust web applications involves using filters to manage HTTP requests effectively. Gruber describes how Warp's filter system allows developers to specify routes by combining filters with logical operators, ensuring that only requests matching specific criteria are processed 3. This approach provides flexibility in handling dynamic paths and query strings, converting them into types that can be used within the application 4.

    If you now forget to add the parameter in your request, this filter will not be triggered.

    ---

    He also mentions other frameworks like Actix and Rocket, which offer more comprehensive features but may require more configuration 5.

       

    Logging & Tracing

    In Rust, logging and tracing are crucial for managing asynchronous environments. Gruber explains the use of the log crate as a facade pattern, allowing developers to switch logging implementations without altering the codebase 6. The tracing crate is particularly useful in asynchronous contexts, as it helps identify which route handler or thread a log message originates from by creating spans of time 6.

    Therefore you have this crate called tracing which adds this few pieces of functionality which can create a span of time.

    ---

    Additionally, Rust's module system aids in organizing code by grouping related functionalities, making it easier to maintain and debug 7.

Related Episodes