IT EN

Twenty-four hours of open source: from your alarm clock to Mars, without noticing

An ordinary Friday, with a counter in hand: a blessed database flying on the A350, 47 car brands without a single sponsor, fake parks for Pokémon Go, a helicopter on Mars and a black hole made with NumPy. The advantages of open source, one per hour.

Magazine-style cover: OPEN masthead, the Ingenuity helicopter over Martian dunes, cover lines on SQLite, curl, Pokémon Go and NumPy, a FREE as in puppy sticker

Friday 12 September, 6:58. The alarm goes off two minutes early, because last night, after choosing a licence for Grandma Pina's recipe app, you set it wrong. One question from this week is still stuck in your head: fine, open source gets exploited, and licences are a little legal cookbook. But in practice, what has it actually given you?

You decide to run an experiment. Today you keep count. Every time you use something that works thanks to open code, you write it down. You don't expect to reach midnight with such a long list, or for the list to pass through Mars.

6:58 — A trillion databases and a blessing

The alarm lives on a phone. If it's Android, there's Linux underneath. If it's an iPhone, there's still plenty of open code, starting with WebKit. Either way, one thing is certainly there: SQLite. Alarms, contacts, messages, browser history, photos: almost every app stores its data in an SQLite database, a single file on disk. According to its authors there are more than a trillion in use, and SQLite is very probably the most widely deployed software library on the planet after zlib.

You can check from your computer over breakfast. Firefox's history is an SQLite database too (copy it first, because the browser keeps it locked):

$ cp ~/.mozilla/firefox/*.default-release/places.sqlite /tmp/history.sqlite
$ sqlite3 /tmp/history.sqlite \
    "SELECT visit_count, url FROM moz_places ORDER BY visit_count DESC LIMIT 5;"

The result is as embarrassing as expected. But the loveliest thing about SQLite isn't technical. The code is in the public domain, and at the top of every file, instead of a licence, there's a blessing:

May you do good and not evil.
May you find forgiveness for yourself and forgive others.
May you share freely, never taking more than you give.

After the week you've had, the last line sounds as if it were written for Dr Brambilla's company.

The first advantage, though, is a different one: reliability. SQLite has about 590 times as many lines of test code as library code, and since 2009 its tests have reached 100% MC/DC coverage: a test harness designed, the authors explain, to meet the avionics standard DO-178B, after some aircraft manufacturers took an interest in the project. It's no accident: Airbus confirms that SQLite runs in the flight software of the A350. The same database holding your browser history flies at 11,000 metres. And since there's only one, tested by everyone and used by everyone, every bug someone finds gets fixed for everyone.

Count: 3 (Linux, WebKit, SQLite). And you're not out of bed yet.

8:05 — The car that reads licences

You start the car. The infotainment system takes its usual twenty seconds to come up, which is about how long a Linux kernel takes to boot on cheap hardware. Many manufacturers use it directly, and Toyota, starting with the 2018 Camry, builds its systems on Automotive Grade Linux, a Linux Foundation project shared between competing brands: they'd rather collaborate on the boring part and compete on the part you can see.

One day, at a particularly long red light, you open the "Legal information" screen of the navigation system. It's a wall of text: dozens of licences, hundreds of names. Among them, almost certainly, is curl, the library that downloads maps, updates and weather. Daniel Stenberg, who maintains it, updated the count in August: 47 car brands, several hundred million vehicles. And he added, with the patience of someone who has read the freeloader's handbook, that not a single company making those cars, or their software, sponsors curl or buys its support.

Nobody had to write from scratch an HTTP client with TLS, IPv6, proxies and all the quirks of a thirty-year-old protocol. And when someone finds a security bug in it, the fix reaches every car at once. That's the second advantage, the most underrated one: not reinventing the wheel. A mature component used by millions of products is sturdier than anything an internal team could write in a quarter.

Count: 5.

10:30 — The map everyone drew

At the office you need to plan a delivery and open a map. Many map-based apps (running, cycling, hiking, logistics) rely on OpenStreetMap, a map of the world drawn by volunteers, under an open licence.

Two little-known stories. The first: in January 2010, after the Haiti earthquake, Port-au-Prince was little more than a smudge on the maps. Within a few days, hundreds of OpenStreetMap volunteers from dozens of countries, working from home on satellite imagery, drew its roads, buildings and camps for displaced people. Rescue teams and the World Food Programme used that map. The Humanitarian OpenStreetMap Team grew out of that experience, and today it responds to almost every major emergency.

The second is lighter. Since 2017 Pokémon Go has used OpenStreetMap as its base map, and many players became convinced that parks, footpaths and ponds on the map decided where certain Pokémon appear. So OpenStreetMap volunteers found themselves deleting non-existent parks and ponds, drawn in back gardens by people who wanted a rare Pokémon under their window: a study presented in 2019 counted more than 1,500 reverting changesets undoing over 4,000 vandalism changesets. The flip side of a map anyone can edit is that anyone can edit it. But the same open community that suffers the damage is the one that cleans it up.

Count: 6.

13:10 — Your code has been to Mars

Lunch break. You scroll through GitHub and stop on a colleague's profile. Among the achievements there's a badge you'd never noticed: a little helicopter, labelled Mars 2020 Helicopter Mission.

Here's the story. On 19 April 2021 Ingenuity, a 1.8 kg helicopter, took off on Mars: the first powered, controlled flight on another planet. Inside, under the solar panel, was a scrap of fabric from the Wright brothers' Flyer. And there was Linux, on a Qualcomm Snapdragon 801, the same chip as phones from a few years earlier. The flight software was built on F´ (pronounced F prime), a NASA Jet Propulsion Laboratory framework released as open source: you can download it from GitHub and use it for your own cubesat. Linux wasn't even plan A: the proprietary operating system used on the rovers wasn't available for that processor. The plan was five demonstration flights. Ingenuity made 72, over almost three years, until a damaged rotor blade ended the mission in January 2024.

To celebrate the first flight, GitHub gave that badge to almost twelve thousand developers: JPL had supplied the list of versions of every open source project Ingenuity used, and GitHub rewarded everyone who had contributed to those versions. People who'd fixed a bug in a Python library, or improved a documentation page, discovered that their code had helped fly on another planet.

That's the third advantage, the one that gives you goosebumps: your work ends up places you'd never have imagined. Sometimes on Mars.

Count: 8 (Linux on Mars counts again, and F´ is new).

15:45 — Science you can redo

The afternoon drags, and you lose yourself in a Wikipedia page (count: 9) about the first picture of a black hole, the one at the centre of the galaxy M87, released in April 2019 by the Event Horizon Telescope collaboration. Eight radio telescopes around the world, petabytes of data shipped on hard drives because no network was fast enough. And to turn it into an image: Python, NumPy, SciPy, Matplotlib, Astropy. The same libraries you use to plot your sales figures.

It's not a one-off. The Higgs boson was found in 2012 by analysing CERN data with ROOT, an open source framework developed at CERN itself. Gravitational waves were measured in 2015 by LIGO, which then published both the data and the analysis software: anyone can download them and find the signal of two black holes merging more than a billion light-years away. And the pipeline that processes images from the James Webb Space Telescope is on GitHub, with its issues and pull requests, like any other project.

That's the fourth advantage, perhaps the most important: verifiability. A scientific result obtained with closed software is a black box: you have to trust it. With open code you can redo the calculation, find the mistake, or confirm there isn't one. Science has worked this way for four centuries. Open software let it keep working this way even when the calculations grew too big to do by hand.

Count: 15.

20:30 — Two billion chats and a chunk of the internet

At dinner you message friends on WhatsApp to plan the weekend. Few people know WhatsApp was built on Erlang, a language Ericsson designed in the eighties for telephone exchanges and released as open source in 1998. Erlang juggles millions of extremely light, isolated processes that exchange messages. You can try it on your laptop:

$ erl +P 2000000
1> T0 = erlang:monotonic_time(millisecond),
1> Pids = [spawn(fun() -> receive stop -> ok end end) || _ <- lists:seq(1, 1000000)],
1> erlang:monotonic_time(millisecond) - T0.
%% a million processes in a couple of seconds, a few GB of RAM

In 2012 WhatsApp's engineers wrote about handling two million simultaneous connections on a single FreeBSD server. When Facebook bought the company in 2014 for 19 billion dollars, WhatsApp had 450 million active users and 32 engineers. A small team could serve half the planet because it didn't have to build the operating system or the runtime from scratch: it took them and, where needed, changed them.

After dinner, a series. The video you're watching almost certainly comes from a Netflix Open Connect server, a cache installed right inside your ISP's network. It runs FreeBSD with nginx. Netflix engineers moved TLS encryption into the kernel (kernel TLS), contributed the work to the FreeBSD project, and at EuroBSDCon 2022 explained how they serve almost 800 gigabits per second of encrypted video from a single server. They could do it because they had the source: with a closed system they'd have had to ask permission, and wait.

The fifth advantage: the freedom to modify. When your needs are extreme, no vendor will build the solution for you. With open code you can build it yourself, then give the change to everyone.

The TV you're watching on, by the way, runs Linux too: webOS for LG, Tizen for Samsung. Count: 21.

23:40 — In space, but closer

Before bed you watch a video of the International Space Station passing over Italy. Another little-known story: in 2013 the laptops the astronauts used for key functions moved from Windows XP to Debian Linux. The manager of the migration explained they needed an operating system that was "stable and reliable", and the team wanted to apply updates and fixes on its own schedule: a few years earlier a worm, brought aboard on an infected laptop, had spread to the station's other computers. And when, in 2020, SpaceX's Dragon capsule carried its first astronauts to the Station, the big touchscreens in front of the crew had an interface written in JavaScript and rendered by Chromium, the open source project behind Chrome. The actual flight software is separate, written in C++, and runs on Linux.

It's the last advantage, and it sums up all the others: control. When a mistake costs human lives, you want to be able to read every line, fix it without waiting for anyone, and know you'll still be able to in ten years, even if the company that wrote it no longer exists.

The counterpoint: free as in puppy

In fairness, you also note the cases where open source wasn't a stroll in the park. The community says it's "free as in puppy": you don't pay for it, but then it has to be fed, walked and looked after. Libraries need updating, vulnerabilities need tracking, and if something breaks at three in the morning there's no hotline to call (unless you pay someone who offers support, which you can do and should do more often). Some desktop programs have interfaces that seem designed to punish you, and the year of Linux on the desktop has been announced more or less every year since 1999. Above all there's the problem you read about on Wednesday: many critical projects rest on the shoulders of a few tired, unpaid people. Open source gives you an enormous amount, but it doesn't exempt you from giving something back.

Midnight

You look at the list. Twenty-two entries, and it's certainly incomplete: you didn't count the server that sent you your work email, your home router, the washing machine's firmware, the bank's website, or the compilers that built everything else. In a single ordinary day, from the alarm to the TV series, you've passed through a city mapped by volunteers, a blessed database, a helicopter on Mars, a black hole and a space capsule.

You turn off the light. On your phone, an SQLite database records that tomorrow's alarm is at nine. May it do good and not evil.

Sources