Skip to Content
Hands-On Data Structures and Algorithms with Rust
book

Hands-On Data Structures and Algorithms with Rust

by Claus Matzinger
January 2019
Intermediate to advanced
316 pages
8h 8m
English
Packt Publishing
Content preview from Hands-On Data Structures and Algorithms with Rust

Static and dynamic libraries

Generally, Rust dependencies have two types of linking:

  • Static: Via the rlib format.
  • Dynamic: Via shared libraries (.so or .dll).

The preference—if a corresponding rlib can be found—is to link statically and therefore include all dependencies into the output binary, making the file a lot larger (to the dismay of embedded programmers). Therefore, if multiple Rust programs use the same dependency, each comes with its own built-in version. It's all about the context though, since, as Go's success has shown, static linking can simplify complex deployments since only a single file has to be rolled out.

There are drawbacks to the static linking approach beyond size: for static libraries, all dependencies have to be ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Data Structures and Algorithms in Rust

Hands-On Data Structures and Algorithms in Rust

Matthew Stoodley

Publisher Resources

ISBN: 9781788995528Supplemental Content