Hacker News new | ask | show | jobs
by lo_zamoyski 653 days ago
"Maybe you've developed your own language, but that's just an abstraction of actual hardware activity, which the actual geniuses who tamed silicon built."

Tangent: the language isn't an abstraction of the hardware. Hardware has nothing to do with programming languages per se. This is why I dislike the term "low-level language", as if this were some kind of computational atomism. There is no inherent relationship between assembly and C++, for example. C++ is a language, full stop. But if we want to simulate a language on a particular piece of hardware, we must simulate it using the language of the hardware. We must translate it into the language of the hardware. That is, after all, what a compiler is: a translator.

1 comments

> the language isn't an abstraction of the hardware

Programming languages were designed to do useful stuff. They can't do this without hardware. There are always concerns of practicality.

> as if this were some kind of computational atomism

NAND gates are computationally atomic, IMO, since to go a level below them you get to the level of physical processes (e.g. electronics) that implement them.

> Programming languages were designed to do useful stuff. They can't do this without hardware. There are always concerns of practicality.

Programming languages are formalisms, and formalisms predate machines that simulate them, even if programming languages only really took off with machinery able to simulate them. You can simulate a programming language entirely with pen and paper if you wanted (tedious, but possible; the lambda calculus was entirely theoretical when when conceived). Regardless, while the utility of programming languages is related to there being machines that can simulate them, the distinction remains.

> NAND gates are computationally atomic

They're an implementation detail of the hardware being used. There is no necessarily relation between a language and a NAND gate. It is not as if, by dissecting a language, you will discover a bunch of NAND gates bounding around underneath. A language doesn't reduce to NAND gate operations. It just so happens that NAND gates are incredibly useful for implementation and simulation. You can implement a fully mechanical computer, or a water computer, if you wanted, even if it isn't very practical.

Software is a mental construct that hardware can simulate.

I dunno about you, but my NAND gate is implemented as an AND gate followed up by a NOT gate. shrug
So it’s less efficient than just implementing a NAND gate directly ?
If you're implementing things in, say, Minecraft it might be, but the computer you wrote that on uses NAND gates. NANDs take fewer transistors to implement, are faster, use less power, and thus everyone uses NAND gates as their foundational gate.