• Moc@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    2
    ·
    edit-2
    1 year ago

    Rust compiles to machine code like C.

    Just like you can call binaries written in C from Python and return their result, you can also run binaries written in Rust. In fact, there are helper libraries to provide some syntax to do this.

    • UlrikHDA
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      I assume you meant that both Rust and C compiles into machine code? Python compiles into bytecode that is then run in a VM, Rust and C usually doesn’t do that as far as I know.

      I was mostly curious if it was as easy as in C. Turun’s reply answered that question though. Cheers.