Hacker News new | ask | show | jobs
by sovietmudkipz 1088 days ago
It’s cool that languages support this kind of stuff.

So if you’re writing python the employs this technique and you still want to keep the “OS agnostic” characteristic of python does that mean you’d have to compile multiple C++ binaries and check the OS to see which one to run?

2 comments

Yes, though hopefully it's been packaged up by the distro otherwise you'll end up having dependency problems if you compiled against a wrong libc or something else.
Alternatively, you could compile the C++ (or rust or zig) to WebAssembly, and a single binary would run anywhere.
Thanks for this. This is something I wouldn’t have considered.
WWouldn't you lose some of the performance benefit?