Hacker News new | ask | show | jobs
by hiAndrewQuinn 619 days ago
I went through an EE degree instead of a CS degree in undergrad specifically so I could peel back this magic and really understand what's going on, to some detail, down to the electromagnetism level. It is indeed a very freeing feeling to be resting atop so many layers of abstractions, with the understanding that if you ever had to, you could go down to any one of them and kind of feel your way around.

I think for me the biggest magic-killing moment was when I realized that CPU clock cycles, timing trees, etc. were all just ways for us to shoehorn a fundamentally analog thing (how much voltage is in area X?) to a digital thing (does area X have enough voltage? yes? OK, call it a 1 and let's move on already!). Somehow to me that feels like the ultimate "leaky" abstraction, although of course decades and trillions of dollars have gone into making it ever more watertight for 99.99-several-more-9s% of the time. At least to the end user. Your mileage may vary if you're a TSMC researcher or something, of course.

3 comments

I've always felt the whole binary/digital thing was one of the most clever bits of compromise with the real world I've ever seen.

You have this thing, you want to be able to translate its value into something useful. In this case, the amount of voltage in a circuit to a number. And you spend so much time trying to make sure the voltage level passed is rock solid, that your read is equally solid, etc. Until you realize that you'd have to invent so many more industries just to do this one thing that you just give up and say the only thing you can know with certainty is that there is or is not voltage passing through the circuit.

Then you need to be able to translate "ON" and "OFF" into actual usable values. And eventually coming down to a base 2 counting system so that 4 circuits gives you 16 distinct values seems obvious in hindsight, but had to be a revelation when they realized it.

Bingo, precisely. I keep using this compromise as a foundational example when I talk to my wife (currently doing a CS degree) about why binary stuff, specifically, keeps coming up in her stuff. 2 is a magic number in computing because it is the Great Compromise we made with reality to get it.

Every now and then people here bring up more exotic paradigms, like ternary computing, and yes! In an ideal world the more phases you can detect the 'better', all the way up to infinity (pure analogue computing). But the difficulty curve to scale anything besides base 2 to where base 2 computing currently is is, at least for our current understanding in physics, materials science, etc., way higher.

Actually, Leibniz came up with the dual/binary system as being ideal for computation 300 years ago roughly around the same time he built his mechanical calculator, long before there was any chance of there being programmable computers.
I work with FPGAs and embedded systems occasionally, and you have no idea how amazingly watertight the phone/desktop/server CPU abstraction is in comparison to what you get the moment you do something slightly weird. A combination of the chips, the firmware, and the OS does so much work to give you the abstraction of "machine runs code and it just works."
There's a paper from the 1990s of someone trying to do neural net-type things to construct an FPGA, and it gets really out there, like 'this gate isn't actually connected to anything but if we change anything about it the laws of electromagnetism cause the whole thing to stop working' weird. FPGAs are fascinating little dudes, esp in domains like HFT where their speed directly translates into dollars, but I totally believe you here.
for me, it was latches and creating a CPU which instructions could be fed into. but it wasn't a "lost the magic" feeling, it was a "that's amazing!" feeling.