I often see Rust mentioned at the same time as MIT-type licenses.

Is it just a cultural thing that people who write Rust dislike Libre copyleft licenses? Or is it baked in to the language somehow?

Edit: It has been pointed out that I meant to say “copyleft”, not “libre”, so edited the title and body likewise.

  • 2xsaiko@discuss.tchncs.de
    link
    fedilink
    arrow-up
    3
    ·
    5 days ago

    Yes, that is true. And yet, there are C++ LGPL libraries which as you say do in principle have the same problem. It should be safe if you’re careful about not using generics in the library’s public interface, or at least only generic code that is essentially just stubs calling the real logic. (I haven’t actually tried this myself tbh.)

    In general any kind of inlined code is always a problem when doing this, even C can have this with macros, or “static final” integer constants in Java.

    I should have definitely mentioned this and Rust’s ABI stability though, yeah. As for that, keeping the same compiler version is generally not a problem since all of them are available.

    • thevoidzero@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      5 days ago

      IIRC Same compiler version doesn’t mean the ABI will be the same. Each compilation may produce different representation of data structures in the binary. Depending on the optimization and other things.

      • 2xsaiko@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        2 days ago

        Ugh, that would complicate things. If that’s the case, all I can say is that’s really negligent (and goes into what I originally said about lack of stable ABI really ruining Rust for me — technically I said static linking but that’s really the core issue)

        • thevoidzero@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          Yeah, and there’s no plan to stabilize the ABI because it’s developing.

          You can use C ABI for some data formats, but you’re limited on what you can use (mostly primitives). There’s a crate stable-abi or abi-stable that provides a way to do things to keep it stable, but since it’s external crate it has limitations.

          I know it’s frustrating because I am writing something in rust that loads functions in runtime. I thought it’d be easy because programs written in C do it all the time. Rust gives a lot of advantages but working on dynamic loading hasn’t been fun. And there aren’t a lot of resources about this either.