4 ms·
Who classifies C++ as a low-level programming language? Even C is only being called low-level relatively recently, and it's not universally accepted as such.
by g051051 3y ago
Who classifies C++ as a low-level programming language? Even C is only being called low-level relatively recently, and it's not universally accepted as such.
- liotier 3y agoIf 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.
- richrichardsson 3y agoYou could argue <language X> IS NOT (high-level) does not necessarily imply <language X> IS (low-level), in which case no-one classified C++ as low-level. I guess for the large part the inter-op here is from (mostly) interpreted languages, which are certainly higher level than C++. Maybe instead of it being a binary choice between high-level and low-level languages, there is a middle ground. Fairly easy to argue that as the case.
- deadbeeves 3y agoThe way the title is written does imply C and C++ are not high-level languages. "Connect C/C++ programs with high-level programming languages", not "connect C/C++ programs with other high-level programming languages". After reading the first sentence on the site, though, I think this was just a somewhat clumsy rephrasing. "SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages." "A variety of high-level programming languages" implies there are some high-level languages that SWIG cannot connect C/++ with, and it's open to interpretation whether C/++ are among the high-level languages that SWIG doesn't connect C/++ with.
- JohnFen 3y ago> instead of it being a binary choice between high-level and low-level languages, there is a middle ground. There is: mid-level languages. I was taught (and still think of) C as a mid-level language; things like assembly are low-level languages; C++, Python, Java, etc., are all high-level languages. But I'm a graybeard, and these are the meanings that I've learned. It's possible that the definitions have shifted and nobody told me.
- mkoubaa 3y agoIt's by convention, get used to it