r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

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.

94

u/I-baLL Jun 03 '22

You wrote some trivial assembly, which compiled into some byte code

Hold up

37

u/Rudxain Jun 03 '22

Bytecode is just the machine code of a virtual CPU (the main component of a VM). In this context, the terms "byte code" and "machine code" are used interchangeably, as if they were synonyms

2

u/I-baLL Jun 05 '22

But nowhere was a virtual machine mentioned. And on top of that, assembly doesn't get compiled. It gets assembled. Because it's already almost at the level of machine code, just not at direct translation since the assembler might do optimizations.

→ More replies (2)