Live data from Hacker News

Show HN: Redbean – Single-file distributable web server

justine.lol

111–120 of 264 posts

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

#111
post #82
post #47

It's a neat coincidence that this is on at the same time as an article about CP/M, because I think there could be some overlap in the programs that would be a good fit for cosmopolitan. Sure, there's server appliances like this, and I hope someone makes a neat services wrapper to abstract at least some platform's intricacies so you can do a "cosmo-service up redbean" on BSD/Linux/Windows. But coming back to CP/M, the…

Author here. We're living in the most exciting time for developing terminal applications. When Microsoft unexpectedly added support for VT100 and XTERM codes to CMD.EXE it totally changed the equation and ANSI became universal for the first time. Blinkenlights is an example of a TUI application I created using Cosmopolitan and it literally works everywhere. https://justine.lol/blinkenlights/index.html You don't need…

Does that remove full binary compatibility for those running on older OS from Microsoft with an older cmd.exe?

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

#115
post #82

Earlier quoted context omitted.

Author here. We're living in the most exciting time for developing terminal applications. When Microsoft unexpectedly added support for VT100 and XTERM codes to CMD.EXE it totally changed the equation and ANSI became universal for the first time. Blinkenlights is an example of a TUI application I created using Cosmopolitan and it literally works everywhere. https://justine.lol/blinkenlights/index.html You don't need…

Does that remove full binary compatibility for those running on older OS from Microsoft with an older cmd.exe?

Cosmopolitan supports Windows 7. The WinMain() polyfill is programmed to gracefully fall back if ANSI isn't available. So the binary still loads fine. You just need to run it in something like MinTTY instead if your TUI program is run on an old version of Windows.

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

#116
TLDR: This is a packed file format that can look to the OS as being executable (for Windows/Linux/OSX). The code is x86 and so offers native performance on those processors. On other platforms, an x86 emulator is built in so can't offer native execution speeds.

While neat, its not the "best of all worlds" due to the lack of native code on anything other than x86/x64. Also, claiming "bare metal" is supported is a stretch as you are limited to having no I/O of any form (as there is no platform code).

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

#117
Windows 10 (10.0.18363 Build 18363). Just downloaded and executed. No zip modification at all.

  W2021-02-26T05:00:59.959364:tool/net/redbean.c:1141:redbean-2021-02-25:49336] setsockopt(server, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) → ENOPROTOOPT/err=10042/errno:10042/GetLastError:0
  W--------------------000674:tool/net/redbean.c:1145:redbean-2021-02-25:49336] setsockopt(server, IPPROTO_TCP, TCP_QUICKACK, &yes, sizeof(yes)) → ENOPROTOOPT/err=10042/errno:10042/GetLastError:0
Its amazing if works though, i can put my static site in an exe. That is so cool.

EDIT: Runs on without modifying even with this message.

EDIT: Cannot modify zip on windows. "File not found or no read permission" using explorer. With 7-zip "Operation is not supported."

EDIT: Used WSL to update zip which then results in SIGSEGV

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

#120
post #70

Earlier quoted context omitted.

I love what you've produced here. I noticed that pthreads seems to be fail-stubbed for the time being, i guess it's a todo with tricky semantics? As for holding off on UI for the time being is probably the right thing to do, keeping with the minimal style planning on going for raw-x11,etc. However, as much as I personally love plain framebuffers (late 90s democoder myself), it'd be totally non-accessible for "plain"…

So far the only platform where I've managed to get threads to work has been Windows. I came pretty close to getting clone() on Linux working a few days ago. Threads are so hard because no API was ever defined for them in original UNIX and BSD, so therefore each modern system today does them in a completely different way. Another blocker is that not all operating systems let us modify segment registers which is someth…

Threads are a PITA everywhere. On Linux the SYSCALL stuff complicates things because of all the register moves, the FUTEX stuff, and potential races with how threads are exited.
Post reply on HN