Re:Redbean: Actually Portable Executable Web Server [video]
by dingdingdang on Tuesday May 25, 2021 @06:35PM
(#27283611)
I came into this thread thinking I was going to cross-post the earlier Cosmopolitan/APE related posts, but dang, someone beat me to it, both on the username AND content front?! Thanks though, saved me quite bit of googling.
Re:Redbean: Actually Portable Executable Web Server [video]
by capableweb on Tuesday May 25, 2021 @06:49PM
(#27283778)
Do you keep something like topic pages in your personal wiki or how do you keep track of these? Just really quick and efficient searching when you remember something has been discussed before? Maybe even some Google Chrome extension to insert story title + link + date + # of comments from submission links into the comment field?
Re:Redbean: Actually Portable Executable Web Server [video]
by dang on Tuesday May 25, 2021 @07:23PM
(#27284079)
Nope, I just use HN search (hn.algolia.com) but I have software that makes it faster and does the formatting - yes, it's a browser extension that I've been using for moderation and adding to for, gosh, coming up on 9 years this fall. See https://news.ycombinator.com/item?id=27236708 and the other links there for more information if interested.
I'm going to make it so any HN links to past threads will render as "title - link - month-year - # of comments" or something similar.
One of these years I'll publish the browser extension too, and the Arc-over-JS implementation it's written in.
Re:Redbean: Actually Portable Executable Web Server [video]
by 1vuio0pswjnm7 on Tuesday May 25, 2021 @11:55PM
(#27286110)
Kinda sad to hear that small, offline programs to run on various OS was viewed as some sort of challenging problem for Google (or anyone). Offiline interoperability was intentionally made difficult. Too many people, many of whom do not know the history, are just way off-track. IMO, this project should not be called "mad science". It should be standard procedure and what many people are working on. Small, portable, fast, resource-efficient, offline programs. Instead they are working on all the monstrosities that she mentions. God bless her for admitting how slow Python is by comparison. And how large Go binaries are. She says she studied "old code" to make her discoveries. For years I have believed this is what is takes to make progress and I avoid all the "new" stuff that gets incessantly promoted to today's developers. IMO, no one "forgot" the things she discovered, others are just constantly trying to bury them. Outside of HN, as well as on HN, there is strong distaste for anything "old". Instead of being thankful for what we have to build on, that has withstood the test of time, I see steady resentment for it because it is not "modern". This "modern" stuff is all throwaway, it is not built-to-last.
When salaries are paid by advertising, then the only content that matters is "popular" content. Unpopular stuff is not valued. That includes unpopular even though technically superior technology.
Re:Redbean: Actually Portable Executable Web Server [video]
by 1vuio0pswjnm7 on Wednesday May 26, 2021 @10:07AM
(#27290658)
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.
Re:Redbean: Actually Portable Executable Web Server [video]
by jart on Wednesday May 26, 2021 @04:11PM
(#27295475)
Author 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... 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.
Re:Redbean: Actually Portable Executable Web Server [video]
by 1vuio0pswjnm7 on Wednesday May 26, 2021 @09:34PM
(#27298363)
Is 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.
Re:Redbean: Actually Portable Executable Web Server [video]
by jart on Wednesday May 26, 2021 @10:39PM
(#27298726)
It'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.
Re:Redbean: Actually Portable Executable Web Server [video]
by 1vuio0pswjnm7 on Thursday May 27, 2021 @06:29PM
(#27309384)
I 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".
Re:Redbean: Actually Portable Executable Web Server [video]
by jart on Thursday May 27, 2021 @10:33PM
(#27311137)
I'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.
Re:Redbean: Actually Portable Executable Web Server [video]
by 1vuio0pswjnm7 on Friday May 28, 2021 @10:06PM
(#27322511)
Not really a fan of using binaries I cannot myself compile on NetBSD (i.e., non-portable code that only compiles on Windows/MacOS/Linux). No doubt the provided binaries will work, but I want to compile crt.S and ape.S myself on a NetBSD host.
Have not looked at it closely but is the "unbourne" shell more or less a copy of NetBSD's Almquist shell. Would be neat to use an Almquist-derived shell with command history on Linux.
From what I have seen of other OS, attracting "further interest" is not always a good thing. Depends on whose interest it attracts. The negative side effects of popularity, to me, are not always worth it. The Linux kernel is said to get an additional 1.5 million LOC per year. Of course it can be trimmed down (even smaller than NetBSD's), but still. The fewer cooks in the kitchen the better, IMO.
Re:Redbean: Actually Portable Executable Web Server [video]
by dundarious on Wednesday May 26, 2021 @02:13PM
(#27294051)
A 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).
Redbean 0.4 - https://news.ycombinator.com/item?id=27001961 - May 2021 (13 comments)
Cosmopolitan Libc: your build-once run-anywhere C library - https://news.ycombinator.com/item?id=26277521 - Feb 2021 (11 comments)
Actually Portable Executable - https://news.ycombinator.com/item?id=26273960 - Feb 2021 (162 comments)
Show HN: Redbean – Single-file distributable web server - https://news.ycombinator.com/item?id=26271117 - Feb 2021 (249 comments)
How Fat Does a Fat Binary Need to Be? - https://news.ycombinator.com/item?id=26103769 - Feb 2021 (67 comments)
Cosmopolitan Libc: build-once run-anywhere C library - https://news.ycombinator.com/item?id=25556286 - Dec 2020 (166 comments)
αcτµαlly pδrταblε εxεcµταblε - https://news.ycombinator.com/item?id=24256883 - Aug 2020 (286 comments)
I'm going to make it so any HN links to past threads will render as "title - link - month-year - # of comments" or something similar.
One of these years I'll publish the browser extension too, and the Arc-over-JS implementation it's written in.
When salaries are paid by advertising, then the only content that matters is "popular" content. Unpopular stuff is not valued. That includes unpopular even though technically superior technology.
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.
Have not looked at it closely but is the "unbourne" shell more or less a copy of NetBSD's Almquist shell. Would be neat to use an Almquist-derived shell with command history on Linux.
From what I have seen of other OS, attracting "further interest" is not always a good thing. Depends on whose interest it attracts. The negative side effects of popularity, to me, are not always worth it. The Linux kernel is said to get an additional 1.5 million LOC per year. Of course it can be trimmed down (even smaller than NetBSD's), but still. The fewer cooks in the kitchen the better, IMO.