Live data from Hacker News

Show HN: Redbean – Single-file distributable web server

justine.lol

221–230 of 264 posts

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

#221
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…

Strong agree; someone needs to give her like a million dollars a year salary and unlimited resources to explore whatever she wants for life, just to see what she comes up with.

one millliiiooonnn dollars.... Hey Dr Evil (Austin powers reference), I think one billion is okay this year and age :)

but yea I agree

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

#222
post #190
post #159

I looked into building SBCL using chibicc last weekend in the hope that one could build a truly portable lisp runtime using the ape toolchain (Yes, yes, I know you couldn't possibly pick two more different approaches to software portability). Turns out the GNUC extensions for __asm__ are the primary stumbling block (though I'm sure there are others). tcc supports the GNUC extensions needed, and chibicc supports the t…

You need __asm__ in chibicc for sbcl? I have good news for you. I did exactly that in cosmopolitan's vendored fork of chibicc here: https://github.com/jart/cosmopolitan/blob/master/third_party... I went on a coding rampage back in December, adding to chibicc pretty much every GNU extension under the moon: https://github.com/jart/cosmopolitan/blob/master/third_party... It should be a perfect fit for use cases needed b…

I'm actually happy to merge your GNU-style inline assembly support and other GNU C extensions to chibicc. But for the purpose of the project, I need to rewrite your patches in the incremental manner, so it's not something I can do right now. I'm currently busy working on my linker project. Once it settles down, I'll take a closer look at your fork.

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

#223
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…

Could you please explain to someone from the web domain with very little experience with compiled C programs why this is significantly better than, say, distributing a python program? Python runs on all the platforms mentioned. Or alternatively requiring compilation from source?

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

#224

Earlier quoted context omitted.

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.

Thanks! Seems like I've misunderstood the concept a bit. My apologies.

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

#225
post #90
post #22

Earlier quoted context omitted.

I think the Zig community/BDFL might appreciate adding an APE target "os" to their buildchain (LLVM-based); that could be a match made in heaven!

Author here. I've been chatting with the Zig BDFL on Twitter recently about contributing APE support and he's been super supportive so far. It's going to be a nontrivial undertaking but would certainly be rewarding for everyone if we can make it happen.

If you're interested, I'd expect adding support for this to the Nim programming language would be more trivial since Nim compiles to C.

I had a quick look into doing this on your original thread[1], but got stuck pretty early on and just didn't have the time to get back into it.

If that's something you'd be willing to pursue I'd love to help any way I can. Feel free to DM me on Twitter[2] any time.

1 - https://news.ycombinator.com/item?id=25558643

2 - https://twitter.com/d0m96

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

#226
post #222
post #190

Earlier quoted context omitted.

You need __asm__ in chibicc for sbcl? I have good news for you. I did exactly that in cosmopolitan's vendored fork of chibicc here: https://github.com/jart/cosmopolitan/blob/master/third_party... I went on a coding rampage back in December, adding to chibicc pretty much every GNU extension under the moon: https://github.com/jart/cosmopolitan/blob/master/third_party... It should be a perfect fit for use cases needed b…

I'm actually happy to merge your GNU-style inline assembly support and other GNU C extensions to chibicc. But for the purpose of the project, I need to rewrite your patches in the incremental manner, so it's not something I can do right now. I'm currently busy working on my linker project. Once it settles down, I'll take a closer look at your fork.

Thanks for clarifying Rui. I'm happy to do the bulk of that effort for you. As soon as you're ready, just tell me which things you want to see upstreamed, and how fine/coarse you want the granularity to be, and I'll send you pull requests!

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

#227
post #226
post #222

Earlier quoted context omitted.

I'm actually happy to merge your GNU-style inline assembly support and other GNU C extensions to chibicc. But for the purpose of the project, I need to rewrite your patches in the incremental manner, so it's not something I can do right now. I'm currently busy working on my linker project. Once it settles down, I'll take a closer look at your fork.

Thanks for clarifying Rui. I'm happy to do the bulk of that effort for you. As soon as you're ready, just tell me which things you want to see upstreamed, and how fine/coarse you want the granularity to be, and I'll send you pull requests!

That really depends on how I organize chapters of the book, and it will need trial and error, just like I'm continue rewriting book chapters as well as the compiler's commit history. So I think I have to do this myself.

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

#228
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…

No luck for me on win10. I can open the archive but get errors trying to add to it. 7zip and win explorer zip both fail with either unsupported or corrupted archive errors.

Since it's a .com file, after downloading, win 10 also claims 'this dangerous file comes from the internet and is blocked' which you have to check a box to unblock it. I did, but still get the errors trying to add to it.

Post reply on HN