Hacker News new | ask | show | jobs
by chongli 1162 days ago
If you’re trying to understand the behaviour of the computer then all of the layers of abstraction matter, right down to the logic gates. Spectre and Meltdown proved that software developers can’t just “trust the CPU to do the right thing.”

Besides the issue of security, performance is also a thing. If you’re trying to squeeze every last cycle out of your program then you need to understand CPU cache hierarchies at the very least. That’s at a level far below assembly language, digging down into the physical layout of the machine.

2 comments

I'm well aware of all of those levels. But they are not germane to the discussion about programming in general. They are important if you are doing some really specialist work (low latency, extreme performance, operating system design). But that wasn't the context at all.
Child, assemler mnemonic representations of opcodes are not hiding anything.

You could make the same, useless, argument about the raw binary. If you looked at an executable you are still actually only looking at a transcoded representation in ascii in an editor. The cpu doesn't actually know what 0A is, those are glyphs for numbers and letters in a human language.

Assembler mnemonics are not materially different, and even macros don't change this because the macros are macros, built out of other visible assembler not hidden magic.

You are not conducting useful argument or communication with this silliness.

> assemler mnemonic representations of opcodes are not hiding anything

They do hide things. There are often multiple ways to encode a line of assembly into machine code. For example on x86, JMP can take an 8-, 16-, or 32-bit displacement, and the assembler will usually select the shortest encodable variant. Some instructions have a shorter variant for certain registers, like ADD $1, %eax. You add useless REX prefixes.