logoalt Hacker News

cm2187today at 9:07 AM4 repliesview on HN

To be honest lots of developers think they don’t need to learn machine code. They just need to learn a language which once compiled will produce machine code.


Replies

lucianbrtoday at 12:59 PM

I wonder if a probabilistic compiler would be fine for the people arguing this. One that sometimes produces machine code that does something else, and sometimes produces machine code that is just broken and does nothing useful. From the same source code.

What if your compiler could be fooled by some other developers into spending thousands of dollars, and still not produce the desired machine code in the end?

show 1 reply
Sharlintoday at 9:33 AM

Compilers are deterministic and, luckily, not agentic.

But yes, it's not obvious (or perhaps even likely) that it just happens that current high-level languages are the "correct" optimal level of abstraction at which you can ignore the sausage-making details at the lower levels. Ultimately, of course, it depends on the use case. Something like Python is so far removed from machine instructions that knowing assembly hardly gives the programmer any additional value.

(Also, obligatory reminder that assembly and even numeric machine code are also abstractions, an "API" provided by the CPU. Instructions get split or fused into micro-ops, named registers are a backwards-compatible abstraction over a much larger register file, instructions get reordered and executed in parallel depending on their data dependencies, a large fraction of the total transistor budget is spent on multi-level caches and cache logic to maintain the illusion of fast access to a single, uniform memory space...)

show 1 reply
tovejtoday at 9:36 AM

This is different.

Understanding assembly/machine code is optional but helpful. The programming language semantics are enough to reason about what the program is doing. Other tools also help, but are optional for learning how to program.

Using an AI, there is no semantic model that can be used to reason through. You're left without any mental model of the proglblem at all.

show 2 replies
themafiatoday at 9:13 AM

Developers can change their minds.