3 ms·
"I guess I just don't see the use case where this is compelling. If I write a handy Unix utility in C, I'll just keep the source code around, and compile it as
by 1vuio0pswjnm7 6y ago
"I guess I just don't see the use case where this is compelling. If I write a handy Unix utility in C, I'll just keep the source code around, and compile it as needed."
One use case is where the source and target are different operating systems, and either the target does not have a compiler installed or the source does not have a cross-compiler installed.
I run into this often. I do not wish to install Python or Java on every computer. I have small form factor computers where I need to conserve space. Also, I prefer the size and speed of C over Java and Python.
I think there may be a tad too much "marketing" and trying to be cute in the way this is presented but this work certainly has potential utility, whether or not it is used as intended. Even just reading through the hacks is educational.
Programming does not always have to be commercially-oriented to be useful or interesting.
- iainmerrick 6y agoProgramming does not always have to be commercially-oriented to be useful or interesting. Agreed! Thanks for the response, that does sound like an area where this could be useful. Although (speaking as somebody who doesn’t do a lot of embedded programming these days, so take this with a pinch of salt) I would have thought that if cross-compilation could be made much faster and easier, that might be a better solution overall. I really like what’s being done with Zig around cross-compilation.
- smasher164 6y ago> One use case is where the source and target are different architectures, and either the target does not have a compiler installed or the source does not have a cross-compiler installed. Do you mean different OSes? AFAIK, Cosmopolitan isn't cross-architecture.
- coolreader18 6y agoIIRC it involves qemu on aarch64
- smasher164 6y agoGotcha. That still runs counter to the comment: > I do not wish to install Python or Java on every computer. I have small form factor computers where I need to conserve space. Now you have to install QEMU on every computer, in which case your options for portability dramatically increase.
- jart 6y agoYou can always build headless blinkenlights https://justine.lol/blinkenlights/index.html https://justine.lol/blinkenlights/index.html (part of the cosmo codebase) for aarch64 or whatever and use that to simulate ape binaries. If you make -j12 MODE=tiny o/tiny/tool/build/tinyemu.com it's 191kb and that simulates the whole x86_64 ring 3 architecture up to ssse3, plus enough of ring 0 currently for the cosmo codebase to have metal unit tests. The APE blog post talks about the possibility of embedding something like that inside these x86 binaries. So if you feel really strongly about non-x86 as many of the people in this thread do, then 90% of the work has been done for you. I haven't taken it 100% of the way there since I personally don't need non-x86 support.