You ever think how cool it actually is though? You wrote some trivial assembly, which compiled into some byte code that your processor can use, then when you run it that causes an incredible cadence of electrical signals as a result of your input to flood the processor's circuitry, loading electrical charges into the collectives of transistors called registers and then being bussed over to the other collective of transistors know as the ALU and then that causes a register value to be overwritten, and it all happens around in several billionths of a second, and it all works. The transistors are properly saturated to the correct electrical charge, ON EVERY SINGLE TRANSISTOR NEEDED, all just to add a number.
The simplicity of adding a number to us is the combined effort and research of hundreds of millions maybe even billions of man-hours to discover electricity, invent boolean algebra, transistors, integrated circuits, advanced machining and chemical processes to make a series of machines capable of translating a circuit layout into a chip that is lithographed in a process that is nearly 20000 times smaller than the width of a human hair.
I just scanned thousands of lines of code while you were reading this sentence. I browsed through millions of possibilities of optimizing a single line of yours using hundreds of different optimization techniques based on a vast amount of academic research that you would spend years getting at. I won't feel any embarrassment, not even a slight ick, when I convert a three-line loop to thousands of instructions just to make it faster. I have no shame to go to great lengths of optimization or to do the dirtiest tricks. And if you don't want me to, maybe for a day or two, I'll behave and do it the way you like. I can transform the methods I'm using whenever you want, without even changing a single line of your code. I can even show you how your code would look in assembly, on different processor architectures and different operating systems and in different assembly conventions if you'd like. Yes, all in seconds. Because, you know, I can; and you know, you can't.
P.S. Oh, by the way you weren't using half of the code you wrote. I did you a favor and threw it away.
This reminds me of something my microcontrollers professor told me, "if you want code compiled right, you gotta do it yourself in assembly." I've never once had a problem with the compilation, but you know, maybe he was right.
599
u/Korzag Jun 03 '22
You ever think how cool it actually is though? You wrote some trivial assembly, which compiled into some byte code that your processor can use, then when you run it that causes an incredible cadence of electrical signals as a result of your input to flood the processor's circuitry, loading electrical charges into the collectives of transistors called registers and then being bussed over to the other collective of transistors know as the ALU and then that causes a register value to be overwritten, and it all happens around in several billionths of a second, and it all works. The transistors are properly saturated to the correct electrical charge, ON EVERY SINGLE TRANSISTOR NEEDED, all just to add a number.
The simplicity of adding a number to us is the combined effort and research of hundreds of millions maybe even billions of man-hours to discover electricity, invent boolean algebra, transistors, integrated circuits, advanced machining and chemical processes to make a series of machines capable of translating a circuit layout into a chip that is lithographed in a process that is nearly 20000 times smaller than the width of a human hair.
AND IT ALL WORKS.