4 ms·
If it requires explicitly allocating memory, then it is low level to most contemporary programmers.
by liotier 3y ago
If it requires explicitly allocating memory, then it is low level to most contemporary programmers.
- JohnFen 3y agoThat doesn't seem like a useful dividing line, if only because it consigns a lot of different languages, with a very wide array of different levels of abstraction, as being "low level". That makes the term "low level" very nearly worthless. I thought the "level" of a programming language was referring to the level of abstraction it presents rather than how memory allocation is performed. Low-level would be very close to machine language. C and C++ have very different levels of abstraction, for instance, and being able to express that seems useful.
- liotier 3y agoA language and its libraries will inevitably allow a whole range of abstractions. Also, just about every piece of software has layers above and below. Hence my subjective qualification: "to most contemporary programmers" - to a bunch of which everything below the Javascript engine is low level !
- JohnFen 3y ago> 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.