Speed Up your Python with Rust

By Maxwell Flitton
    Advance your knowledge in tech with a Packt subscription

  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies

About this book

Python has made software development easier, but it falls short in several areas including memory management that lead to poor performance and security. Rust, on the other hand, provides memory safety without using a garbage collector, which means that with its low memory footprint, you can build high-performant and secure apps relatively easily.

But this doesn't mean you need switch from Python to Rust to build you software from scratch - you can infuse your Python code with Rust to get the best of both worlds!

This book will help you, as a Python developer, to start using Rust in your web applications without having to manage a separate Rust server or application. Seeing as you'll already understand concepts like functions and loops, this book covers the quirks of Rust such as memory management in order to code Rust in a productive and structured manner. You'll explore the PyO3 crate to fuse Rust code with Python, learn how to package your fused Rust code in a pip package, and then deploy a Python Flask application in docker that uses a private Rust pip module. Finally, you'll get to grips with advanced Rust binding topics such as inspecting Python objects and modules in Rust.

By the end of this Rust book, you'll be able to develop safe and high-performant applications with better concurrency support.

Publication date:
January 2022

About the Author

  • Maxwell Flitton

    Maxwell Flitton is a Software Engineer who works at a financial tech company called Monolith AI. In 2011, Maxwell achieved his Bachelor of Science in Nursing degree from the University of Lincoln, UK. While working 12 hours shifts in the A and E departments of hospitals, Maxwell obtained another degree in Physics from The Open University in the UK and then moved one to another milestone, with a Postgrad Diploma in Physics and Engineering in Medicine from UCL in London. He developed an open source machine learning deployment software called DeployML which can be downloaded via pip and occasionally he teaches computational medicine at Imperial College London every now and then.

    Browse publications by this author
Speed Up your Python with Rust
Unlock this book and the full library for FREE
Start free trial