Hacker News new | ask | show | jobs
by scriptkiddy 3396 days ago
I guess this is true if you don't need to interact with any system libraries.
1 comments

Could you give an example of what "system libraries" would pose a problem in my example of using Rust with cargo?

Also note that by "no runtime installed" I mean no runtime as in "no Python runtime", "no JVM" etc. not necessarily "no libc"

EDIT: formatting

>Could you give an example of what "system libraries" would pose a problem in my example of using Rust with cargo?

Specifically things like xorg libs, libmpeg, libsdl, and such. Not that Rust would have a problem interfacing with them, just that they would need to be present regardless of whether or not someone was just trying to run a distributed binary.

Agreed that you wouldn't need a VM like CPython or the JVM. However, Rust isn't unique in that department. Almost all languages that compile to binary executables have this advantage.

> Specifically things like xorg libs, libmpeg, libsdl, and such. Not that Rust would have a problem interfacing with them, just that they would need to be present regardless of whether or not someone was just trying to run a distributed binary.

That's why stuff like that is AFAIK usually either distributed with the binary or is absolutely required to have present on the system, regardless of the PL, if you want to/can only distribute a "naked" binary.

> Agreed that you wouldn't need a VM like CPython or the JVM. However, Rust isn't unique in that department. Almost all languages that compile to binary executables have this advantage.

Didn't mean to suggest this is unique to Rust, which is why I wrote

> because Rust is a compiled language.

EDIT: formatting

I think I may have misunderstood your point after re-reading.

I thought you were implying that compiled binaries do not have dependencies. Now I can see that is not the case.