5 ms·
Can someone explain the advantage over building an executable for each target system?
by dfgdghdf 6y ago
Can someone explain the advantage over building an executable for each target system?
- sime2009 6y agoNot having to build an executable for each target system.
- mikepurvis 6y agoI think it’s neat how this acknowledges the reality that the actual meat of the machine code is identical for every x86_64 target— all that's different is the OS interface. So unlike other "fat binary" schemes where there's a lot of duplication, this one has a single main program and then small shims to provide the Linux ABI on MacOS and Windows.
- amarant 6y agoThis is slightly faster I guess? I don't think it's that big of a deal either, since compiling these days is fast enough you can do it 3 times without it being a problem. Don't get me wrong, it's very impressive, I just don't think it makes that big of a difference in practice, especially since environmental differences will still require you to have 2 codebases in many scenarios (like accessing the filesystem for example)
- rurban 6y agoNope much slower. And never worked for me.
- mikepurvis 6y agoEvery source-portable program has that anyway though, typically either with a bunch of ifdefs, or by linking to an abstraction like boost::filesystem. The change here would basically be that all versions of it would have to be compiled into the same binary, with a runtime switch.
- mikepurvis 6y agoI don't think it has any benefit if you're installing software exclusively that you built yourself on your own targets, or from a distro package manager. But it's potentially a boon for a whole class of statically-linked rescue tools, installers, command-line utilities — basically anything where there's a website with a curl path/to/thing > local/bin/thing installation option.
- CydeWeys 6y agoIt also makes manually downloaded software distribution easier. Rather than the user having to select which version of the software to download (which users often get wrong), or trying to guess based on browser user-agent, there's just the one download link that works on everything.
- sirius87 6y agoAnd malware. I don't know why that popped into my mind as the first use-case for this and the web server. :|
- user-the-name 6y agoIt is very satisfying.
- burkaman 6y agoIt's cool.