Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We ported Fabrice Bellard's QuickJS engine to Cosmopolitan last year. We ported Python3 too. (You can build Python3 as a 5mb single file Actually Portable Executable!) So integrating them into redbean is on the table. The big question is whether or not redbean should be multitenant with languages, or if we should ship separate binaries where you choose the redbean "flavor" that has your preferred one. I'm leaning towards the latter, since there can only be one REPL language. What do you think?


>> The big question is whether or not redbean should be multitenant with languages, or if we should ship separate binaries where you choose the redbean "flavor" that has your preferred one. I'm leaning towards the latter, since there can only be one REPL language. What do you think?

Different flavors of redbean would be awesome!

Thank you for building redbean.


Would love to see Python support. This project and your libc sort of break my brain and I reverse engineered weird stuff for a decade professionally. I understand how it all works, but it is easy to understand something once someone built it. Some of the design choices and constraints were just not things I would have thought reasonable for a project like this.


I'm open to considering change. For example, the project has a lot less assembly than when it started. Please join our Discord and tell us the particular things you had in mind! https://discord.gg/EZwQUAcx


I did not mean it in “I would not have done it this way” way. Just “I did not even consider that a way to do it” in a good/great way. It is like… you had a clear end goal in mind and all of the things you wanted led you down this really amazing/cool path and the end result is just incredibly cool to see. It is the sort of project you can only really get done sticking to a plan (first principles really?) and not letting it get watered down along the way.


Thank you! https://justine.lol/sizetricks/ covers some of the hacks for anyone reading who's interested. It's certainly felt the last few years, since I discovered the hack, the universe had put me on a mission to make executables portable. Writing files like //ape/ape.S also felt like I was writing a chronicle of the history of modern software. It's been a fun ride!


Single file Django deploys? Yes please


Try this:

    git clone https://github.com/jart/cosmopolitan
    cd cosmopolitan
    make -j8 o//third_party/python/python.com
Then put Django in the zip under the .python directory. You can also use the `.args` file just like redbean to have `-m module` run by default.


I also think the latter is cleaner. I might also suggest that if you are going to integrate with Python, you should make it as "batteries included" as possible with the Python data stack (numpy/pandas/scipy/sklearn) so that you can easily add a redbean web app to an existing Python project without worrying about how those "heavy duty" libraries will work.


If part of the speed is that the binary is small and optimized, the latter seems like a better option.


that seems sane to me with my novice understanding of the project. im most confortable with Python3 & have existing projects which I would try to port over as a test.

a python3 flavor could be experimental at first, I bet it would boost overall adoption & be an unfair advantage over nginx approach.

having multiple repl in one binary would remind me of containers in a very strange but cool way, that would be more a fun experimental feature a rabbit hole for others to explore.


> having multiple repl in one binary would remind me of containers in a very strange but cool way, that would be more a fun experimental feature a rabbit hole for others to explore.

It would also let the flavors of redbean compete for donations, which could be directed towards your language of choice (say python3 for you) while limiting the size and complexity.


I don't know if it makes any sense for this project but Caddy's approach to this is very nice. Would probably need a corporate sponsor for the build server though.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: