Earlier quoted context omitted.
I'm just one woman. What Cosmopolitan does so far, it does really well. It was only as recently as a few days ago that I got mmap() and malloc() polyfilled on bare metal. It has serial uart i/o. It's going to have e1000/virtio sockets soon. You can help me will that future into existence. I need people who know o/s dev and can help me write code that does things like correctly set up pic controller.
Sorry, wasn't meant as a criticism, just as an explanation because people were assuming magic... Taking on bare-metal is a significant job much greater than your original task and you may be better targeting something like buildroot instead, after all what is the Linux kernel but a hardware abstraction layer.
Show HN: Redbean – Single-file distributable web server
161–170 of 264 posts
Re: Show HN: Redbean – Single-file distributable web server
#162So it's a tiny virtual machine. Intriguing, but not really shocking.
Nope... it's native code, that runs on multiple platforms, all in one small executable.
How? Lots of very clever hacking, and trimming all the accumulated dreck out of the normal C runtime, while making it work across all the supported platforms. (Polyfill is the term she uses)
This is the most amazing thing I've seen in a decade or so. It is right up there with GIT in terms of the possibility space it opens up.
Re: Show HN: Redbean – Single-file distributable web server
#163I 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…
Everything she does has this level of jaw-dropping amazingness. Between her and Fabrice Bellard i don't know many people who consistently get my chin to hit the table. I hope that Cosmopolitan becomes mainstream, so much more software could have that It Just Works quality.
Re: Show HN: Redbean – Single-file distributable web server
#164Am 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.
Re: Show HN: Redbean – Single-file distributable web server
#165Can someone explain this to me like I'm an 8 year old?
Re: Show HN: Redbean – Single-file distributable web server
#166Can someone explain this to me like I'm an 8 year old?
This is a zip file, like any other... you can add and remove things from it. However, this ZIP file has a superpower, it can display the contents on the web... it has a web server built into it.
You can take this file, run it on a Windows, Linux, Macintosh, and it will work. You don't need separate versions for each different system... this just works on all three systems, unlike almost every program ever written.
This is one of the most impressive feats of programming things I've seen in my 40+ years of programming. The web serving is clever, but the superpower that it can run on anything really took a huge amount of work, which the author built into a tool called "ape", and has shared with the world, so other people can use it, and help her make it better.
Re: Show HN: Redbean – Single-file distributable web server
#167As 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.
Re: Show HN: Redbean – Single-file distributable web server
#168Can someone explain this to me like I'm an 8 year old?
Can someone explain this to me like I'm a 31 year old?
A single executable, that doubles as a valid ZIP file, that you can put a complete website into, also doubles as a valid executable on Windows, Mac, Linux.
The build infrastructure is a complete reworking of C to make it far more portable than even K&R thought possible.
I probably wouldn't have believed it possible, but here it is!
Re: Show HN: Redbean – Single-file distributable web server
#169Earlier quoted context omitted.
Sorry, wasn't meant as a criticism, just as an explanation because people were assuming magic... Taking on bare-metal is a significant job much greater than your original task and you may be better targeting something like buildroot instead, after all what is the Linux kernel but a hardware abstraction layer.
How hard could stdio/sockets on metal possibly be? So far bare metal has been a walk in the park. I love the fact that PML4T lets me do things like move memory without copying it. I want to be able to have that power without schlepping in the entire Linux world. I believe it should be possible for programs to be able to boot on metal as just programs which are tiny and auditable. Especially considering everything run…
> So far bare metal has been a walk in the park. I love the fact that PML4T lets me do things like move memory without copying it.
> I believe it should be possible for programs to be able to boot on metal as just programs which are tiny and auditable.
I would love to be able to learn more about this. Maybe even contribute to your project :) perhaps a good way to start would be to address some small tasks you might have laying around?!
Re: Show HN: Redbean – Single-file distributable web server
#170Earlier quoted context omitted.
The go std library offers the embed package. You can just embed your files and use the std lib's webserver and generate a single file binary. No need for Caddy. All this would be roughly 15 lines of code.
People use Caddy for automatic HTTPS, which the std lib does not give you.