Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> A language and its libraries will inevitably allow a whole range of abstractions.

True, but that's a different sort of "abstraction" than what I'm talking about. I'm talking about how abstracted the processor itself is. Libraries and the like don't really enter into it -- this is about the language proper.

Machine language has no abstraction whatsoever. What you write is literally the code that the CPU executes.

Assembly language is one higher level of abstraction. There's still mostly a 1 to 1 correspondence to machine language, but some of that gets hidden for human convenience. You're now writing with symbols instead of numeric op codes, and you have concepts like macros, which have no machine language equivalent.

C is a higher level than that. Every C statement can easily be expressed directly in assembly, but more common operations (loops, subroutines, etc) have a shorthand that makes them easier to write. There is no longer a 1 to 1 correspondence with assembly or machine language, but it's not terribly far from assembly. Still, it's abstracted enough that the language is no longer tied to a specific processor.

C++ is yet another level up the ladder. In a sense, C++ is to C what assembly is to machine language.

And so forth.

I suppose that a plausible (but highly imperfect) rule of thumb for how high up the ladder of abstraction a language sits is how many machine language instructions are required to implement a given language construct. The more required, the higher the level of abstraction. High level languages also have a lot more (indeed, mostly consist of) constructs that simply don't exist at the machine language level.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: