RustConf 2023 - Integrating Rust and Go: Lessons from Github Code Search

Integrating Rust and Go: a deep dive into the challenges and solutions of building a code search engine at GitHub, including lessons on safety, performance, and interop.

Key takeaways
  • The speaker discusses the challenges of integrating Rust and Go programming languages to build a code search engine.
  • Rust is chosen for its safety and type system, while Go is selected for its performance and ease of use.
  • A “FFI sandwich” is created to interact between Rust and Go code, making use of C and cgo.
  • The speaker notes that the Go GC will have full awareness of what’s going on, but Rust’s type system is essential for avoiding mistakes.
  • The speaker uses a “C-like API” as a solution, which is simple and easy to use.
  • The approach to dynamic shard assignment is another solution, which involves marrying repository metadata with the deployment of clients.
  • The speaker notes that distribution becomes trickier due to shared libraries, and less Go and Rust interop is planned in the future.
  • The team at GitHub is rewriting more Rust code to solve various problems, and other teams are also interested in using Rust.
  • The speaker emphasizes the importance of observability and testing in the development process.
  • The team is working on porting more and more of the Go middleware code to Rust.
  • The speaker uses “delta compression” to compress data and gain a better understanding of the system.