As a web/game developer, you forgot to include the OS and the drivers in the lines of code involved in executing the stuff you are writing.
The Linux kernel was 15M lines in 2013 [1], more than half of that was drivers. Windows XP was apparently 45M lines, the 2009 Debian distribution 300M lines [2].
So you're into millions of lines just to execute "Hello world" on a PC.
Simple control systems generally don't use an OS. E.g. Arduino is as simple as it gets, here [3] is a 30-LOC example snippet for a HTTP client. But if you dig down into the included libraries (most of it is on GitHub) you'll find that there's (quick estimate) 10-20k lines of code involved in executing those 30 lines. And you haven't actually _done_ anything yet, that's just the infrastructure to allow C code to interact with the hardware with a few standard libraries for math and IO.
Modern cars are complex enough to have OSes [4], with the corresponding code complexities.
In short, web developers vastly underestimate the code complexity of interacting with hardware in a low-level language because it's not something they deal with. The umpteen million lines of OS kernel and device drives are done by someone else, and for people who just _use_ a PC it (mostly) "just works", to the extent that even advanced users aren't aware of the complexity behind it.
Are you suggesting a passenger car runs its own Linux distro? What would be the reason, other than Not Built Here syndrome? (Or the goal to deceive regulators.)
How many I/O devices/drivers does a pacemaker talk to? How many of those are written by/customized by the pacemaker's developers?
If you include the underlying stack, then also my <body>Hello world</body> runs on tens of millions of lines of code (Browser+OS).
> How many I/O devices/drivers does a pacemaker talk to?
A pacemaker would presumably be similar to Arduino: A simple processor, no OS. 100k lines (your numbers) isn't all that much, given that C standard libs are into the tens of thousands alone. Pacemakers have sensors to detect heartbeat, logic to send an electric pulse only when needed, and have an interface where medical personell can hook up a computer to adjust some parameters. So 2-3 IO channels at a minimum (one or more sensors, one or more outputs for the electric pulse, and some sort of wireless interface for adjustments).
> Are you suggesting a passenger car runs its own Linux distro?
According to Quora (last link in my reply above) the most common alternatives are Windows Embedded Automotive, a Linux derivative, and QNX. Why? To avoid writing millions of lines of fairly complex code on their own, of course. Just like a desktop developer saves a ton of work by writing on top of the OS rather than implementing their own OS from scratch.
> If you include the underlying stack, then also my <body>Hello world</body> runs on tens of millions of lines of code.
Yes, but that's the point: The numbers for lines of code in a pacemaker or car includes the entire stack. If you want to compare it to web development, you'll need to include the full stack there too.
The Linux kernel was 15M lines in 2013 [1], more than half of that was drivers. Windows XP was apparently 45M lines, the 2009 Debian distribution 300M lines [2].
So you're into millions of lines just to execute "Hello world" on a PC.
Simple control systems generally don't use an OS. E.g. Arduino is as simple as it gets, here [3] is a 30-LOC example snippet for a HTTP client. But if you dig down into the included libraries (most of it is on GitHub) you'll find that there's (quick estimate) 10-20k lines of code involved in executing those 30 lines. And you haven't actually _done_ anything yet, that's just the infrastructure to allow C code to interact with the hardware with a few standard libraries for math and IO.
Modern cars are complex enough to have OSes [4], with the corresponding code complexities.
In short, web developers vastly underestimate the code complexity of interacting with hardware in a low-level language because it's not something they deal with. The umpteen million lines of OS kernel and device drives are done by someone else, and for people who just _use_ a PC it (mostly) "just works", to the extent that even advanced users aren't aware of the complexity behind it.
[1] https://en.wikipedia.org/wiki/Linux_kernel#Codebase
[2] https://unix.stackexchange.com/questions/111281/exploding-am...
[3] https://www.arduino.cc/en/Tutorial/HttpClient
[4] https://www.quora.com/What-operating-systems-are-used-in-car...