Speakeasy JS - Redbean: Actually Portable Executable Web Server (Justine Tunney)
Feross1 HN recommender · recommended in 1 month, 2021–2023
talk · advanced · 2021–2023 on HN
Justine Tunney presents Redbean, a web server distributed as a single actually portable executable that runs on multiple operating systems. It embeds Lua, SQLite and MbedTLS in a fork-based server.
The author and others link it as the definitive explanation of redbean and the APE toolchain, including its performance claims.
Up next
14 mo on HNThe Tragedy of systemd
linux.conf.au
16 HN recommender · 2019–2025
11 mo on HNThe Thirty Million Line Problem
Molly Rocket
11 HN recommender · 2018–2024
10 mo on HNVCF East: Ken Thompson interviewed by Brian Kernighan
Vintage Computer Federation
11 HN recommender · 2019–2025
9 mo on HNLISA11 - Fork Yeah! The Rise and Development of illumos
USENIX
9 HN recommender · 2012–2026
9 mo on HNUSENIX ATC '21/OSDI '21 Joint Keynote Address-It's Time for Operating Systems to Rediscover Hardware
USENIX
12 HN recommender · 2021–2026
8 mo on HNAT&T Archives: The UNIX Operating System
AT&T Tech Channel
10 HN recommender · 2013–2026
8 mo on HNTempleOS | Down the Rabbit Hole
Fredrik Knudsen
7 HN recommender · 2019–2022
7 mo on HNUnix and Google
FOAM
4 HN recommender · 2016–2023
6 mo on HNBryan Cantrill on Jails and Solaris Zones
PapersWeLove
6 HN recommender · 2016–2025
6 mo on HNContainers From Scratch • Liz Rice • GOTO 2018
GOTO Conferences
6 HN recommender · 2018–2025
6 mo on HNUser-level threads....... with threads. - Paul Turner - Google
Linux Plumbers Conference
6 HN recommender · 2013–2024
5 mo on HNBryan Cantrill from Joyent on Manta: internet-facing object storage facility that features compute
AI Council
4 HN recommender · 2014–2026
6 comments from Hacker News
Justine Tunney's APE (actually portable executables) exploits, er, makes use of, the fact that a shebang isn't required to run a shell script. The single executable file generated by the Cosmopolitan linker creates an insane polyglot binary executable that runs on 6 operating systems as well as on bare metal (i.e. bootable as its own OS); in addition, it's a valid Zip archive, and you can modify files inside it using any zip utility... fascinating stuff. On Linux, it bootstraps execution initially as a shell script, but the shell script writes the "ELF" file header and executes it (I'm probably doing a horrible job of explaining though). link If you're interested in learning more, this talk from 2021 is fascinating: ▶ this video . It covers Redbean, a portable, run-anywhere web server built with the APE toolchain; since then Redbean 2 has been released, which adds a lot more features. Here's a link to Redbean: link
Like running redbean on someone else's computer? redbean embeds Lua, SQLite, and MbedTLS into a fork() driven application server that benchmarks at 1.1 million qps on a personal computer. link ▶ this video
Author here. Thanks! The other projects I'm known for here on HN are: link Redbean (2011) is a single file distributable web server. Here's a video of me giving a talk about it ▶ this video link αcτµαlly pδrταblε εxεcµταblε (2020) lets you build c/c++/fortran/etc. code so that it runs on seven operating systems link Operation Rosehub (2017) where I helped save a lot of people from an Apache security bug similar to Log4j issue today I like doing these projects because they all fit together so well into a consistent story. For example, a lot of these past projects were what helped to make SectorLISP better. Thanks to APE you now have a 20kb quickly deployable and embeddable LISP interpreter. Thanks to Redbean we're going to have an online pastebin service that'll let you publish SectorLISP gists in a few days, for example: link Thank you Hacker News community for being so supportive and encouraging.
redbean is a pure fork() web server and according to ab it is much faster than nginx. I feel like we've come full circle with history. Apache started off with fork() since it offers the strongest security versus other i/o models. The problem is that code bloat makes fork() go slower so as Apache ballooned over the years there was this race to the bottom in terms of i/o models, caused by tragedy of the commons. ▶ this video
Messages per second, latency, footprint, name it. Particularly if it's gzip encoded. See ▶ this video I'm working on giving redbean the fastest https serving too. Recently I've been helping to make the strongest elliptic curves go 3x faster.
Data control and privacy are two of the most important things. I wrote a popular open source project where I've sought to improve that. Would you be interested in taking a quick look and offering candid feedback? See link and discussion thread link and interview ▶ this video and polyglot executable format link Someone like you could help me know if I'm doing it in the best possible way, since studying the influence of groups like cygnus was what helped me learn the hacking stunts that allowed me to pull it off in the first place.