E Amazings
  • Home
  • Automotive
  • Business
  • CBD
  • Crypto
  • Education
  • Entertainment
  • Fashion
  • Finance
  • Health
  • Home Improvement
  • Law \ Legal
  • News
  • Shopping
  • Sports
  • Technology
  • Travel
  • Need Help?

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

What Closing Costs Do Home Buyers Have?

February 25, 2023

What Is Realtek HD Audio Manager

February 2, 2023

A Basic Guide To Cell Tower Leasing

February 2, 2023
Facebook Twitter Instagram
E Amazings
  • Home
  • Automotive
  • Business
  • CBD
  • Crypto
  • Education
  • Entertainment
  • Fashion
  • Finance
  • Health
  • Home Improvement
  • Law \ Legal
  • News
  • Shopping
  • Sports
  • Technology
  • Travel
  • Need Help?
Facebook Twitter Instagram
E Amazings
You are at:Home»Technology»Color Us Impressed: Redbean Runs A Web Server On Six Operating Systems
Technology

Color Us Impressed: Redbean Runs A Web Server On Six Operating Systems

By July 23, 2022No Comments3 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter Pinterest WhatsApp Email

[ad_1]

The holy grail of computing is to have some way to distribute a program to any computer. This is one of those totally unachievable goals, but many have tried with varying degrees of success.  People naturally think of Java, but even before that there was UCSD’s P-code and many other attempts to pull off the same trick. We were impressed, though, with Redbean 2.0 which uses a single executable file to run a webserver — or possibly other things — on six different operating systems. If the six operating systems were all flavors of Linux or Windows that wouldn’t be very interesting. But thanks to APE — the Actually Portable Executable — format, you can run under Windows, Linux, MacOS, OpenBSD, NetBSD, and FreeBSD.

This is quite a feat when you realize that most of these take wildly different file formats. There is one small problem: you can’t use much of anything on the host operating system. However, if you look at Redbean, you’ll see there is quite a lot you can do.

The APE loader takes advantage of some quirks. Under Windows, the executable is just that — an executable. Otherwise, there is a small shell script that the APE loader can use to map the executable into memory and do the ELF loading. You might say, “Wait! I don’t have the APE loader.” That’s OK. Each APE program has the 4K loader embedded in it that it will use if necessary.

Of course, it works because, at the bottom, the x86 instructions are the same across all the platforms. Since it is hard to call out to the underlying system, there is a libc, Cosmopolitan, that you can include. There are other modules, including a Unix module that provides things like file access, sockets, and other things you probably need to make working programs. The only place you might have trouble is Microsoft’s WSL which is sort of Linux under Windows. It “knows” how to load Windows executables, even under Linux so you have to disable that in some cases, and that’s explained on the APE page. You can also find some details about the executable format.

Redbean offers a lot of possibilities. You use zip to store assets like web pages in the actual executable. You have access to Lua, SQLite, TLS, and more. So it is possible to create a “web app” including things like JavaScript, run on any of the supported platforms, automatically launch a browser, and then use the browser as a GUI. Pretty slick. A .args file will prevent users from having to use any command line arguments. No installation and no picking the right version for your operating system.

Of course, you do need the right kind of processor. This isn’t going to ship out to your Raspberry Pi unless you run an emulator. But there are a lot of things we can think of that this would be perfect for. A web server on a USB stick, for example. Or a way to put an app on different Linux single-board computers. The APE loader is probably a good trick to have up your sleeve, too.

We had to wonder if you could integrate Tiddlywiki and have a portable notepad on a USB drive. Of course, if you want a portable web server, you could always just bring your own hardware.

[ad_2]

Source link

Related Posts

What Is Realtek HD Audio Manager

By Corbin BowenFebruary 2, 2023

A Basic Guide To Cell Tower Leasing

By Corbin BowenFebruary 2, 2023

The Flight Of The Dremel

By January 5, 2023

A White-Light Laser, On The Cheap

By January 5, 2023
Add A Comment

Comments are closed.

Our Picks

What Closing Costs Do Home Buyers Have?

By Corbin BowenFebruary 25, 2023

What Is Realtek HD Audio Manager

By Corbin BowenFebruary 2, 2023

A Basic Guide To Cell Tower Leasing

By Corbin BowenFebruary 2, 2023
Recent Posts
  • What Closing Costs Do Home Buyers Have? February 25, 2023
  • What Is Realtek HD Audio Manager February 2, 2023
  • A Basic Guide To Cell Tower Leasing February 2, 2023
  • Air Duct Repair 101: Everything You Need To Know February 2, 2023
  • Advantage LIC? How Budget Insurance Amendment Bill may benefit the PSU insurance giant January 5, 2023
  • The Flight Of The Dremel January 5, 2023
  • LIC offering multiple benefits on premium payment with co-branded credit cards with Axis Bank: Check features, offer January 5, 2023
Archives
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • September 2021
Facebook Twitter Instagram Pinterest TikTok
© 2022 E Amazings - All Rights Reserved.

Type above and press Enter to search. Press Esc to cancel.