7 ms·
> C Is Not a Low-level Language Anymore Pretty sure C was always considered a high-level language.
by nanodano 5y ago
> C Is Not a Low-level Language Anymore
Pretty sure C was always considered a high-level language.
- rcoveson 5y ago"High" and "low" are relative adjectives. The meaning of "high-level language" has changed. C was considered a high-level language, and it is now considered a low-level language. Not by everyone, of course. There are still a pair of definitions for "high-level language" and "low-level language" that draw the line right above assembly. I won't say "nobody" uses those definitions anymore; lots of people learned them and many still use them. I will say that it is pointless to act as if those are the only definitions of the terms anymore.
- BoorishBears 5y agoPeople don't call C high-level, but I also don't see people call it low-level even in a casual setting with newer programmers. Instead I see it called a system-level language.
- eesmith 5y agoKernighan and Ritchie referred to C as a 'relatively "low level" language' in their 1978 book.
- BoorishBears 5y agosounds like system language is a nice way to say "relatively low level" then?
- eesmith 5y agoK&R write: > It has been closely associated with the UNIX system, since it was developed on that system, and since UNIX and its software are written in C. The language, however, is not tied to any one operating system or machine; and although it has been called a “system programming language” because it is useful for writing operating systems, it has been used equally well to write major numerical, text processing, and data-base programs. https://archive.org/details/TheCProgrammingLanguageFirstEdition/page/n7/mode/2up?q=system https://archive.org/details/TheCProgrammingLanguageFirstEdit...
- BoorishBears 5y agoSo it sounds like they're endorsing that concept, and just don't want it to be a limiting term in terms of what people expect in regards to portability and scope? "System level" does that just fine right? There's not much confusion about if C is tied to Unix anymore after all...
- eesmith 5y agoI really don't understand the aim of your inquiry. Yes, I see it called a systems programming language. But unlike you, I see people call it low-level. The easiest counter-example was to point to K&R, which was my textbook in college. (Yes, pre-ANSI). And there are many people who still say that, as I found in a quick Google Scholar search: ] Although the Java platform has been used as a multi-language platform, most of the low-level languages (such as C, Fortran, and C++) - (2016) https://dl.acm.org/doi/pdf/10.1145/2998415.2998416?casa_token=YFdopIGDfQ0AAAAA:L-6DD9hqqFdXHqlziwugfgUN5Uq1mO3we2ypQ2bNOafgsgkbvl4cFAJCx_H2BvJ6sXzeVhsFWZ2A https://dl.acm.org/doi/pdf/10.1145/2998415.2998416?casa_toke... ] Lifting these restrictions is primar-ily motivated by our desire to target low-level languages, such as C with pthreads - (2011) https://dl.acm.org/doi/pdf/10.1145/1929553.1929558?casa_token=ZdfRD-LQVE0AAAAA:Fp8XUJWmt0JAVJRSDUcQoxbaFZ0GE45unmFJHgafNbWPW0uEOA8HoYXxQ2GVKRdKuBKPyJSQc3uF https://dl.acm.org/doi/pdf/10.1145/1929553.1929558?casa_toke... ] Use-after-free vulnerabilities have plagued software written in low-level languages, such as C and C++, - (2020) https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9152661&casa_token=bnR0QcL-O_sAAAAA:TW0lKnWSJxoWZQeuMYuUfK0O6i_C-nVHNIEPsKxtj_jw_Ob9B5-95BEPOBU3GasDDtzhFvowiGxt https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9152661... Now that you've seen people call it low-level, you can't truthfully write a comment like you did at https://news.ycombinator.com/item?id=29710906 https://news.ycombinator.com/item?id=29710906 .
- BoorishBears 5y agoNo, I can and I will, and it will still be truthful. Because to most people with a firm understanding of the nature of English my statement means: "When I, in current times not 40 years ago, hear people talk about C, they most often refer to it as a systems level language". - Of course, I forget this is HN and there are some people who think that it means: I have never seen "C" and "low level" on the same line of text! For these unfortunate cases, there is a belief that 40 year old K&R references (...) and some hastily assembled search results will change my reality... but that's a separate issue I'm not interested in. Those people are definitely free to consider me a liar, the world will keep spinning for the rest of us.
- eesmith 5y agoI think I'm confident in saying that K&R saw C as lower-level language. As you say, it is relative [1]. I just don't think enough people considered C to be a high-level language (given that Smalltalk, APL, and Lisp were about) to make your broader characterization that "C was considered a high-level language." Here's my reasoning: From "The C Programming Language" book (1st. ed., 1978) at https://archive.org/details/TheCProgrammingLanguageFirstEdition/page/n5/mode/2up?q=level https://archive.org/details/TheCProgrammingLanguageFirstEdit... we can read 'C is not a "very high level language"' (p. ix) and 'C is a relatively "low level" language' (p. 1).[1] They describe what "low level" means to them: "This characterization is not pejorative; it simply means that C deals with the same sort of objects that most computers do. namely characters, numbers, and addresses." And on page 2 we see how they don't regard C as the lowest level: "Of 13000 lines of system code, only about 800 lines at the very lowest level are in assembler." I also found "The C Programming Language" paper in The Bell System Technical Journal (1978) saying "All three languages [BCPL, B, and C] are rather low-level", at https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6770408&casa_token=eqKV_z4PEwIAAAAA:UfW87DtWHfhOlMr05bvdoXzbi1Zn9E2BKbpgD9Gs6PCOZg8Up99sk9zVqtsa6PYkrc0z7HBZz18Q https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6770408... . Now to the [1], I found the paper "Implementing LISP in a high‐level language" from 1977, where that high-level language is BCPL, which is a precursor to C, so clearly a good number of people at the time would have considered C a high-level language, at the very least in the context of developing a Lisp.
- TheOtherHobbes 5y agoK&R are not the last word on this. They made their comment in 1978, and now it's 2021, and computing is very different. "Characters, numbers, and addresses" are very much not what CPUs deal with internally today. Most languages no longer reference addresses directly, and "characters and numbers" live behind abstractions of their own. The point is that C assumes a certain model of computing that was baked into both hardware and software from the late 70s onwards. That model has been superseded, but hardware and software still lose a lot of cycles emulating it. The claim is that this is both inefficient and unnecessary. But the advantage of the C model is that it's simple, comprehensible, and general. If you expose more of what goes on inside a modern CPU, programming becomes more difficult. If you build a CPU optimised for some specific other language abstractions you bake other assumptions and compromises into the hardware, and other languages become less efficient. So if you want to replace the C model you'd first have to define an industry standard for - say - highly parallel languages with object orientation. That is not a small or simple project. And previous attempts to tie hardware to more abstract languages haven't ended well. So C persists not because it's high or low level, but because it's general in a way that other potential abstractions aren't. This is not to say that alternatives couldn't be both more general and more performant. It's more a reminder that designing performant alternatives is harder than it looks, and this is not a solved problem. My guess (FWIW) is that nothing credible will emerge until radically new technologies become more obviously better for general purpose computing - whatever that looks like - than current models.
- ncmncm 5y agoC is the lowest-level language in common use, short of assembly language. C lacks any high level abstractions. All the abstractions it does offer are hiding register and stack slot assignments (as local variables), code entry point addresses (as function names), ALU instructions (as operators), branching (as control-flow statements), and address arithmetic (as pointer operations). All of these are low, machine-level abstractions. C was never a high-level language, even from its first day. It was specifically intended as a portable assembly language, by someone used to coding assembly language, to use porting an OS coded in assembly language to a new target host.
- charcircuit 5y ago>C lacks any high level abstractions macros
- pjmlp 5y agoAnd structures, unions, pseudo-meta programming via the macro processors, no exposure to IO unless on a CPU with MMIO. JOVIAL and Algol dialects were also designed for creating OSes and no one calls them low level.
- wott 5y ago> And structures, unions, pseudo-meta programming via the macro processors, Those exists in macro assemblers, for they are extremely thin abstractions, no thicker than jumping to a label instead of jumping to an absolute or relative address. > no exposure to IO unless on a CPU with MMIO. Well, since not all processors have I/O instructions (or dedicated I/O pins), the easiest way to implement portability is simply to not provide a direct access to them in the language, and let library functions handle it.
- pjmlp 5y agoWhich kind of proves the point C doesn't provide all the necessary capabilities for a systems programming language. As for macro Assemblers, IBM i one supports OOP constructs, so are OOP languages now low level?