1 Why Refactor to Rust

 

This chapter covers:

  • Why you may want to refactor an application
  • Why Rust is a good choice for refactoring
  • When it is and is not appropriate to start a refactoring project
  • High-level overview of methods you can use to refactor your code into Rust

If you have ever heard of the Rust programming language, you may have heard of software companies rewriting their code in Rust from a slower, interpreted language. A few of these companies have published blog posts lauding the performance benefits of Rust over their previous systems, and they tell a very tidy story: other languages are slow and Rust is fast. Therefore rewrite your code in Rust and your systems will be fast.

While it may be tempting to think that we can all just rewrite our code when something better comes along, we all know the reality that software does not exist in a bubble of infinite resources. Performance improvements and technical debt payments need to be balanced with feature development, user requests, and the million other things that come along with modern software work. While re-implementing functionality in a new language, you also need to ensure that you are providing a consistent and reliable service to your users. How then, can a developer hope to improve their code base while maintaining the rapid pace of development & reliability expected?

The answer lies not in big-bang-style rewrites, but in incremental refactoring.

1.1 What is refactoring?

1.2 What is Rust?

1.3 Why Rust?

1.4 Should I refactor to Rust?

1.4.1 Performance

1.4.2 Memory Safety

1.4.3 Maintainability

1.5 When should I not refactor to Rust?

1.6 How does it work?

1.7 What will I learn in this book?

1.7.1 Calling Rust functions directly from your program

1.7.2 Communicating with a Rust service over the network

1.8 Who is this book for?

1.9 What tools do I need to get started?

1.10 Summary

sitemap