3 ms·
What gives me pause about this project is the author's apparent satisfaction with having a Linux-only development environment. With all the portability techniq
by 1vuio0pswjnm7 5y ago
What gives me pause about this project is the author's apparent satisfaction with having a Linux-only development environment. With all the portability techniques discovered, portable Makefiles and a portable build system seems to have been ignored. NetBSD's toolchain and NetBSD itself can be built on a variety of OS. Yet this library can only be built on Linux. That does not sound right. Only supporting "NetBSD 9.1" when the code for older kernels is so easily available is also a bit odd.
- BBC-vs-neolibs 5y agoA port of a compiler, for instance TCC, seems to be the next logical step. TCC could be a portable executable.
- dundarious 5y agoA lot of impressive and intricate work has gone into getting their project to this stage. I think especially something like only supporting running on NetBSD >= 9.1 can be forgiven, but even the build OS requirements seem quite justified for now (Linux, macOS, and Windows supported, the latter two require the GCC ELF toolchain though).
- jart 5y agoAuthor here. The Apple and Microsoft linkers make that difficult. The GNU and LLVM compilers usually choose to conform to those difficult conventions when compiled for those platforms. You can help us fix that, because we're working on chibicc, which is like TCC but 10x better. https://github.com/jart/cosmopolitan/blob/master/third_party/chibicc/README.cosmo https://github.com/jart/cosmopolitan/blob/master/third_party... It's not there yet. It can be built as an actually portable executable. I already wrote an assembler for it. Soon we'll have a C linker for it too, and thus a whole toolchain in one file. The tradeoff is it doesn't optimize. But it supports C11 and most GNU extensions. So when we're OK having velocity in development anywhere with code that only goes half as fast, but compiles 5x as fast, this will be the way to go.
- 1vuio0pswjnm7 5y agoIs there an option for BSD users to use their own toolchain instead of chibicc or the included version of GCC. TCC, as impressive as it was, was never made to be portable. Portability was apparently not a goal. After all these years, it is still a WIP in pkgsrc. Correct me if I am wrong but with a chibicc solution cosmopolitan will still be "Linux-centric" because anyone compiling on Linux will have the option to use an optimising compiler instead of chibicc.
- jart 5y agoIt's build-once run-anywhere. I build my software on Linux. I'm the primary contributor so that just happens to be what's best supported. Cosmopolitan is a labor of love that I made to make developers happy. I'm sure over time it'll evolve into build-anywhere run-anywhere. You can help me will that future into existence. You yourself said that something like redbean should become the new normal. When I studied the old code, I saw its merits, and I've used my popularity to help change what popular means.
- 1vuio0pswjnm7 5y agoI support what you're trying to do 100%. (Except all the ANSI escape code and Unicode stuff. I disable UTF-8 wherever I can.) IMO, "popular" is overrrated. What actually works the best, e.g., fastest, smallest, most portable, lowest resource usage, is more interesting. I want to compile the modified runtime crt.S and ape.S on NetBSD. Maybe with /emul/linux it's possible. I've been using shell scripts without shebang lines for decades (because NetBSD's default shell is my preferred interactive shell and I hate typing). It was funny to see that described as "forgotten".
- jart 5y agoI'm pretty sure you can just use the cosmopolitan binaries. Right before the v0.2 release I verified that the release binaries worked with the LLVM that came with FreeBSD 12 on the stock system, without any Linux emulation. (Sadly a regression in ape.lds got introduced at some point since then, that broke LLVM support). So if you use the v0.2 release ape.o release binaries, you should probably be OK. If you're a fan of NetBSD's shell, you'll be pleased to hear that it's now more bug free thanks to Cosmopolitan. I found a bug with it and reported it to the dev team months ago. In many ways I'm proud of the fact that the work I'm doing is helping to support the BSD communities. It's not perfect yet. But I think a project like this is going to attract further interest to the platform. Particularly for production use cases.