Live data from Hacker News

Show HN: Redbean – Single-file distributable web server

justine.lol

211–220 of 264 posts

Re: Show HN: Redbean – Single-file distributable web server

#211

Is it a "fat" binary?

AFAIK a fat binary is just a binary with all dependencies included. It would still be compiled for a specific platform. The magic part about this is that it's a single file compiled once that can be run on most platforms. And it also adheres to the format of a zip file, so you can add, modify and remove assets as you please inside the actual file, post compilation.

No, fat binaries are not binaries with all dependencies included. Fat binaries are executable files that contain equivalent compiled code for multiple architectures. Some also facilitate running binaries across different operating systems. More: https://en.wikipedia.org/wiki/Fat_binary

The idea also reminds me of (executable) self-extracting ZIP archives that were common once upon a time.

Re: Show HN: Redbean – Single-file distributable web server

#212
post #160

Earlier quoted context omitted.

I can't believe I'm ASKING for a blog post. Can you blog a bit of the career/cognitive/skill evolutionary history behind this? Did the cosmo stuff come out of this or something else? Learned this in X level school, found out about Y, read about Y, learned this, got this job doing this, learned this from Z, got experience of AA... etc. Of course, assuming this exists, and you exist. And blogs "exist".

Author here. When I first discovered the idea for Actually Portable Executable I thought I was going mad like Terry Davis. I couldn't even believe that it was possible until I actually did it. It cost me my job but I couldn't be happier with the result. This project is going to make problems disappear for so many developers. It's the sort of tool people can get excited about. I'm so happy that my prior career success…

In all seriousness: whether it's exciting or not, this is something that should be getting federal funding. It really shouldn't be difficult for large, government-backed organizations to justify their interest. I don't have a lead for you (otherwise, I'd have invoked it by now to work on my own project[1], which has something in common through the use of polyglot files to achieve a similar effect[2], while mostly otherwise taking a different approach), but since you have a high profile, casting a wide net to attract the attention of someone able to secure the funding is something to consider.

1. https://wiki.triplescripts.org/wiki/The_why_and_how_of_tripl...>

2. E.g., https://www.youtube.com/watch?v=TUpd70Mu0Ek>

Re: Show HN: Redbean – Single-file distributable web server

#213
post #42

Am I the only one having issues trying to get this working? The webserver starts just fine, but once I add the index.html with zip as in the example, it stops working. This is on Mac 10.15, CentOS 8 and Ubuntu 18.04 LTS. Centos: [centos@test ~]$ ./redbean.com -vv error: Uncaught SIGSEGV on test.novalocal ./redbean.com EINVAL/err=22/errno:2/GetLastError:0 Linux test.novalocal 4.18.0-240.10.1.el8_3.x86_64 #1 SMP Mon Ja…

IIRC, from vague memories of things flying past, Big Sur won't let a modified binary run once it's been checked by Gatekeeper. Which means the first run gets checked and notarised but when you add the `index.html`, the on-disk binary has changed and Gatekeeper won't allow it to run - I guess it's to prevent malicious code modifications, etc.

It looks like you can get around this by adding Terminal.app as a "developer tool" (i.e. it can create processes without hitting Gatekeeper), maybe that works? (once I did that and relaunched terminal, I can run cosmopolitan binaries).

https://docwhat.org/upgrading-to-catalina

Re: Show HN: Redbean – Single-file distributable web server

#215

As amazing as this is unfortunately it doesn't work for me and I am on Linux. I get bash: ./redbean.com: No such file or directory after chmod-ing. Maybe I am dumb but yeah.

Did you make it executable with chmod +x ?

Yes. That's the funny part. It doesn't work despite that. uname -r gives 5.7.7-amd64-desktop.

Re: Show HN: Redbean – Single-file distributable web server

#216
post #10

I just spent 30 minutes reading about this. I'm so shocked that I'm logging in to comment after 5 years of lurking. Justine has built a c library that allows you compile a binary once and have it run it on any os or baremetal. The SAME binary. Quite frankly, that sentence doesn't even make sense to me. Check out https://storage.googleapis.com/justine/cosmopolitan/index.ht... As far as I'm concerned, this is literal m…

Impressive.

Re: Show HN: Redbean – Single-file distributable web server

#217
post #83
post #10

I just spent 30 minutes reading about this. I'm so shocked that I'm logging in to comment after 5 years of lurking. Justine has built a c library that allows you compile a binary once and have it run it on any os or baremetal. The SAME binary. Quite frankly, that sentence doesn't even make sense to me. Check out https://storage.googleapis.com/justine/cosmopolitan/index.ht... As far as I'm concerned, this is literal m…

That malware for OS X that does nothing (so far) from the news earlier this week also has one multi-arch binary for all modern Apple notebook architectures (AMD64 and ARM64)

In MacOS this is really just a feature of using Mach-O’s multi architecture abilities, they call this universal binaries.

Re: Show HN: Redbean – Single-file distributable web server

#218
This is amazing! There are a lot of low level things that I don't really grasp and, while going through the APE description, I saw this: "The other tradeoff is the GCC Runtime Exception forbids code morphing, but I already took care of that for you, by rewriting the GNU runtimes".

Can somebody, please, explain if allowing code morphing will increase security risks?

Post reply on HN