Portability matters November 13, 2017 on Drew DeVault's blog

There are many kinds of “portability” in software. Portability refers to the relative ease of “porting” a piece of software to another system. That platform might be another operating system, another CPU architecture, another web browser, another filesystem… and so on. More portable software uses the limited subset of interfaces that are common between systems, and less portable software leverages interfaces specific to a particular system.

Some people think that portability isn’t very important, or don’t understand the degree to which it’s important. Some people might call their software portable if it works on Windows and macOS - they’re wrong. They might call their software portable if it works on Windows, macOS, and Linux - but they’re wrong, too. Supporting multiple systems does not necessarily make your software portable. What makes your software portable is standards.

The most important standard for software portability is POSIX, or the Portable Operating System Interface. Significant subsets of this standard are supported by many, many operating systems, including:

I could go on. Through these operating systems, you’re able to run POSIX compatible code on a large number of CPU architectures as well, such as:

Again, I could go on. Here’s the point: by supporting POSIX, your software runs on basically every system. That’s what it means to be portable - standards. So why is it important to support POSIX?

First of all, if you use POSIX then your software runs on just about anything, so lots of users will be available to you and it will work in a variety of situations. You get lots of platforms for free (or at least cheap). But more importantly, new platforms get your software for free, too.

The current market leaders are not the end-all-be-all of operating system design - far from it. What they have in their advantage is working well enough and being incubent. Windows, Linux, and macOS are still popular for the same reason that legislator you don’t like keeps getting elected! However, new operating systems have a fighting chance thanks to POSIX. All you have to do to make your OS viable is implement POSIX and you will immediately open up hundreds, if not thousands, of potential applications. Portability is important for innovation.

The same applies to other kinds of portability. Limiting yourself to standard browser features gives new browsers a chance. Implementing standard networking protocols allows you to interop with other platforms. I’d argue that failing to do this is unethical - it’s just another form of vendor lock-in. This is why Windows does not support POSIX.

This is also why I question niche programming languages like Rust when they claim to be suited to systems programming or even kernel development. That’s simply not true when they only run on a small handful of operating systems and CPU architectures. C runs on literally everything.

In conclusion: use standard interfaces for your software. That guy who wants to bring new life to that old VAX will thank you. The authors of servo thank you. You will thank you when your circumstances change in 5 years.

Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~sircmpwn/public-inbox@lists.sr.ht [mailing list etiquette]

Articles from blogs I read Generated by openring

Status update, August 2020

Hi! Regardless of the intense heat I’ve been exposed to this last month, I’ve still been able to get some stuff done (although having to move out to another room which isn’t right under the roof). I’ve worked a lot on IRC-related projects. I’ve added a znc-i…

via emersion 2020-08-19 00:00:00 +0200 +0200

What's cooking on Sourcehut? August 2020

Another month passes and we find ourselves writing (or reading) this status update on a quiet, rainy Sunday morning. Today our userbase numbers 16,683 members strong, up 580 from last month. Please extend a kind welcome to our new colleagues! Thanks for read…

via Blogs on Sourcehut 2020-08-16 00:00:00 +0000 +0000

Go 1.15 is released

Today the Go team is very happy to announce the release of Go 1.15. You can get it from the download page. Some of the highlights include: Substantial improvements to the Go linker Improved allocation for small objects at high core coun…

via The Go Programming Language Blog 2020-08-11 11:00:00 +0000 +0000

North Pacific Logbook

The passage from Japan (Shimoda) to Canada (Victoria) took 51 days, and it was the hardest thing we've ever done. We decided to keep a logbook, to better remember it and so it can help others who wish to make this trip.Continue Reading

via Hundred Rabbits 2020-07-31 00:00:00 +0000 GMT