8 ms·
I've been following this project but am curious about what are the actual use cases apart from being able to send a portable web site around? If you're running
by r0b05 4y ago
I've been following this project but am curious about what are the actual use cases apart from being able to send a portable web site around?
If you're running a production web server you're not really switching OS's often. Something like nginx is battle tested so what would be the benefits of using redbean?
It is a marvelous piece of technology but I am struggling to see the use cases right now.
- jart 4y agoredbean was originally intended as a locally running web server, sort of like an Electron competitor, where you launch your GUI in Chrome, rather than linking a copy of Chrome into your executable. We live in a fragmented o/s world. If you're someone like me then you've got a Macbook from the office, a Windows PC for games, a Linux workstation for compiling code, a FreeBSD server, an OpenBSD router, etc. When you're dealing with so many different systems, sometimes just having something as simple as a sed command that works reliably the same seems like an impossible ask. Now we've got an entire app platform that works on the lion's share of PCs/servers in a small 1mb file. It's also a question of being able to distribute code. I used to work on the TensorFlow team. We were tasked with building an open source library that people on pretty much every platform imaginable would use. It broke my brain just how difficult it was for us to ship open source binaries that actually work and don't cause an avalanche of GitHub issues. Even just working on more than a few Linux distros felt like an impossible ask back then. Now that I've figured out how to do it for every distro and seven operating systems total in just one file, I wish I could go back in time and use tools like redbean and Cosmopolitan Libc to fix all the things with TensorFlow that I wish I could have done. It'd've been a different project.
- lewisjoe 4y agoredbean as an electron alternative is mind-blowing! I had the same question as the op, and this perspective does put me in fascinating directions. Like, this could be the most light-weight electron alternative, with the server acting as a escape hatch to sneak cross-domain communications and computation intensive parts of the app, etc.
- niutech 4y agoAs for lightweight Electron alternatives, we already have Neutralinojs, Tauri, NodeGui, DeskGap, Ultralight.
- r0b05 4y agoI can see it as an Electron competitor which is itself a desktop app competitor. I can also see the value of having a cross platform technology albeit using web development. I cannot currently see it as a traditional web server replacement but perhaps that was not the intention. Running the web server locally loses the benefits of single place updates.
- haberman 4y ago> sort of like an Electron competitor How would this work? Does the user start and stop the server manually? One nice thing about an electron app is that you open and close it like a normal application.
- capableweb 4y agoHaven't used Redbean specifically for it, but built similar things with Rust, Clojure and Golang before. The way I used it was that if the user launched the binary, it spawned a server and opened the browser pointing at it. If the user closed the tab, it automatically shut down the server. Or if it lost connection to any browsers for more than one hour.
- Cthulhu_ 4y agoThat seems pretty clever, I think there's actually quite a few applications that work like that. And with binary servers, startup is pretty fast too.
- jart 4y agoOne way to do it is you'd create a `.init.lua` file in the zip with this: LaunchBrowser('/') That way when redbean starts up, it opens a tab in your desktop browser automatically to display your app. https://redbean.dev/#LaunchBrowser https://redbean.dev/#LaunchBrowser
- kencausey 4y agoIs there any possibility that this could be extended to be able to specify a preferred browser or ordered list of said? I ask this because part of my work involves accessing a large number of user computers and I've found that few users set their preferred browser, they will overlook the browser request to be the default for long periods of time or just dismiss it.
- jart 4y agoThis is a great example of something that can be built with the new unix module. It's unlikely we'd add a high-level API for this. The good news is you don't need us to do that since the unix module gives you all the power you need, and if it doesn't, please file an issue and we'll fix it.
- rfoo 4y ago> I wish I could go back in time and use tools like redbean and Cosmopolitan Libc to fix all the things with TensorFlow that I wish I could have done ... and then people want you to distribute a libtensorflow.so which they may link to or dlopen. :cry: I had been in this "trying to distribute binaries working on every Linux distro since 2010" game too and I hate it.
- adictator 4y ago> Now we've got an entire app platform that works on the lion's share of PCs/servers in a small 1mb file. Isn't that what Docker set out to do using containers and IMO was hugely successful? How is this different?
- synergy20 4y agomy similar approach is one golang webserver binary that runs across multiplatform,and do ui in a browser,is redbean a similar idea but using lua instead?
- cyber_kinetist 4y agoI could see usage for web developers who would like to develop in Windows (natively without WSL) and then deploy it in a Linux server by just copying files via SFTP.