35 ms·
The points made in the article are certainly valid, but C is low-level in an abstract sense: it is approximately the intersection of all mainstream languages.
by umanwizard 9y ago
The points made in the article are certainly valid, but C is low-level in an abstract sense: it is approximately the intersection of all mainstream languages.
I.e. if a feature exists in C, it probably exists in every language most programmers are familiar with. (I worded this statement carefully to exclude exotic languages like Haskell or Erlang).
Thus C, while not low-level relative to actual hardware, is low-level relative to programmers' mental model of programming. If this is what we mean, it's still true and useful to think of C as a low-level language.
That said, it's important to keep the distinction in mind -- statements like "C maps to machine operations in a straightforward way" have been categorically wrong for decades.
- saagarjha 9y agoOne feature that many languages don't provide is the ability to have direct control over how aggregates are organized in memory.
- typomatic 9y ago> I worded this statement carefully to exclude exotic languages like Haskell or Erlang I suspect that your definition of "exotic" is exactly "not like C".
- munificent 9y ago> if a feature exists in C, it probably exists in every language most programmers are familiar with. I don't think that's true. Off the top of my head, C has: array point decay, padding, bit fields, static types, stack allocated arrays, integers of various sizes, untagged enums, goto, labels, pointer arithmetic, setjmp/longjmp, static variables, void pointers, the C preprocessor. Those features are all absent in many other languages and are totally foreign to users that only know those languages. A large part of C is exposing a model that memory is a freely-interpretable giant array of bytes. Most other languages today are memory safe and go out of their way to not expose that model.
- mkirklions 9y agoIts crazy that C has changed because of the way people used it. Well crazy isnt the correct word... mainstream use has changed the future of an old language...
- fixermark 9y ago> Thus C, while not low-level relative to actual hardware, is low-level relative to programmers' mental model of programming Programmers' mental model of programming is not a homogeneous set. I'm pretty comfortable in LabView, for example; a language that is extremely parallel (the entire program is composed of a graph of producer / consumer nodes and sequential operation, if desired, must be explicitly requested).
- kazinator 9y agoWhich languages have pointer arithmetic, longjmp, goto anywhere within a function, address-of operator, memcpy that is equivalent to assignment even for lexical variables, untagged unions, switch with fall-through in absence of explicit break and a textual/token-wise preprocessor?
- pjmlp 9y agoBLISS, Modula-2, NEWP, Mesa,...? Of course, some of those tricks are only allowed in SYSTEM/UNSAFE blocks on these languages.
- kazinator 9y agoThat was in response to the claim that if C has a feature, it "probably exists in every language most programmers are familiar with". "Most programmers" are not familiar with these. (A bit sad in the case of Modula-2).
- pjmlp 9y agoWhich is a sad state of affairs, programming language history should be a required part of curriculum.
- kazinator 9y agoWell, there is a big jump between knowing about historic programming languages and familiarity. I know a few things about SNOBOL, but I couldn't sit down and start coding in it without some ramp-up period.