Developer on Space Station 14.

Admin of lemmy.spacestation14.com

Mastodon: https://mastodon.gamedev.place/@PJB

  • 0 Posts
  • 1 Comment
Joined 2 years ago
cake
Cake day: June 11th, 2023

help-circle
  • This is absolutely not the case however, precompiled binaries can just ship all the object files it is linked from

    This is completely incorrect for languages like Rust (or, say, C++). You are spouting misinformation.

    Generics mean that not all the code “in a library” can be compiled to a single object file, as it’s impossible to know ahead of time what instantiations will exist. This means these instantiations may instead be emitted to another object file, and therefore include a copy of the code.

    It is therefore impossible to “just publish the object files and swap out some of them link again”. Meaning it is impossible to comply with the LGPL if a Rust library is LGPL.

    Oh and also, Rust isn’t ABI safe. So even if you make a library “without generics” to get around this, it’s still impossible to ensure it keeps working with future Rust compiler changes.