Earlier quoted context omitted.
The replacement has already happened. It is HTTP and JSON for 99% of the software developed today. The reason C stayed has multiple reasons but most obvious ones are for me are: - People just stopped caring about operating systems research and systems programming after ~2005. Actual engineering implementations of the concepts largely stopped after the second half of 90s. Most developers moved on to making websites or…
Name me a stable binary interface that is not ints and arrays of ints
C isn't a programming language anymore (2022)
151–160 of 217 posts
Re: C isn't a programming language anymore (2022)
#152Re: C isn't a programming language anymore (2022)
#153Good read though. Thinking about C as not just a language but also a protocol is a different perspective that is useful for the mental model.
Re: C isn't a programming language anymore (2022)
#154Earlier quoted context omitted.
> - unspecified default type sizes. Should have had i8, u16, i32, u64, f32, f64 from the beginning. I strongly disagree. The programmer should rather prescribe intent and shouldn't constantly think about what size this should exactly have. Does this variable represent the size of an object, an address, a difference or just a random positive integer? Then use size_t, uintptr_t, ptrdiff_t and unsigned int respectively.…
How will you know if your integer type is adequate for the problem at hand, if you don‘t know its size? Choosing the right type is a function of signedness, upper/lower bound (number of things), and sometimes alignment. These are fundamental properties of the problem domain. Guesstimating is simply not doing the required work.
Re: C isn't a programming language anymore (2022)
#155Earlier quoted context omitted.
I would assert any company that doesn't go bankrupt is successful, doesn't need to be late stage capitalism. Other than that, Nokia until Microsoft placed an agent on it, Phillips that contributed to CDs, ASML...
Three is not many
Re: C isn't a programming language anymore (2022)
#156Earlier quoted context omitted.
Yes, most languages allow C type code, if that’s what you are trying to do. Java with only primitive values, arrays, and classes only with fields and static methods. But that wouldn’t be idiomatic Java, so typically non-explicit abstractions such as polymorphism have code generated for them that you don’t have explicit control over. C is consistently low level because that’s all you get. Down to direct access to addr…
How do you do direct accessing to CPU registers in C as with Assembly? Being idiomatic or not doesn't matter, what counts are what language features are available.
Note here “close” being used in the injective, not bijective, sense. (Scratch out “one-to-one” in my earlier comment.)
And “closer” lowers the bar here too. C isn’t simply decorated assembly. But closer to it.
And “close” being used informally. Arguments for closeness are several and strong (I think), but a bit of a hodgepodge.
In terms of non-bijectivity, for systems programming and performance choices C makes it easy to drop into assembly. But the former are uniquely application specific. And the latter doesn’t make the C version less like the assembly it maps onto - whether the compiler uses the more performant instructions for the context or not.
C’s convenient assembly inlining, and the handoff in both directions being smoothed by an assembly friendly model of the C code around it, are both a part of the “closeness”
But C is generally “close” to assembly, because its data types emphasize types handled natively, compound types reflect RAM layout, and pointers are explicit addresses to data and code. And those address values can be constructed and operated on just like any other data.
C is objectively closer to assembly than languages with strongly required abstractions. (E.g., Java classes, Lisp S-exp's/cons cells, etc.)
C is more “strictly closer” to assembly than languages with more optional abstractions, even if they also allow for relatively low level coding.
Functions could be viewed as a preferred abstraction, but they have a clear assembly level model accessible directly with pointer arithmetic. And they don’t get in the way of directly encoding custom argument passing schemes, and using goto’s and zero argument functions and tail calls as atomic assembly calls for function and jumps for continuations.
Types are a significant non-assembly abstraction, but are zero-cost in that they don't separate C from assembly, but C from C, as a code safety mechanism that is easily escaped.
It is often easy to add abstractions, via regular C, or macros, but you have to provide an explicit implementation for them in the source or complied library.
(However, if macros, with their mixed logical, symbol, text and file “data” model, are viewed as C source instead of as a C source construction language, then C becomes a very wacky abstraction language with behavior and rules that look nothing like simple assembly.)
Re: C isn't a programming language anymore (2022)
#157Earlier quoted context omitted.
> I'm not sure what you mean by "coincidence" or "accident" here. I mean Unix had to be written in C, not in, say, Algol or PL/I or BLISS, high-level languages used to write other operating systems. I also meant that the features of C were not put there by impulse or whim, they were the outcome of considered decisions guided by the specific needs of Unix.
No it had not, > Although we entertained occasional thoughts about implementing one of the major languages of the time like Fortran, PL/I, or Algol 68, such a project seemed hopelessly large for our resources: much simpler and smaller tools were called for. All these languages influenced our work, but it was more fun to do things on our own.
Re: C isn't a programming language anymore (2022)
#158Earlier quoted context omitted.
Reduce is a Lisp library that's still in active use from 1968, making it older than C itself. We can point to GNU Emacs as an ancient and venerable self-contained Lisp tortoise with more wrinkles than are finitely enumerable, and is in fact a hosted Lisp operating system. Pulling it apart and working with it is admittedly a treat even if I loathe it as a text editor. Mezzano is a modern Lisp OS that you can play with…
Not sure how viable Mezzano is. The most recent bug report was two years ago. The “beginnings of a manual” was last updated 7 years ago. A better example might be Guix, depending how “operating system” is defined.
Re: C isn't a programming language anymore (2022)
#159Earlier quoted context omitted.
I think so to, for most devs C is like Latin, or Roman Law, not something we develop and use, but rather something we learn for context and to understand future developments. There's some people that still develop on C for sure, but it's limited to FOSS and embedded at this point, Low Level proprietary systems having migrated to C++ or Rust mostly. I agree with the main thesis that C isn't a language like the others,…
There is also still a lot of low-level proprietary code developed in C. I would guess far more than what is developed in Rust. I fully agree about your last point. The proposed solutions to some of the deficiencies of C are sometimes worse than the disease while its benefits are often exaggerated, at the same time adding unnecessary layers of complexity that will haunt us for decades. In contrast, my hope would be to…
Do you mean that there's still code being developed, or that it still exists? Because I meant the former, the latter is true of a lot of dead languages like fortran and cobol, and it would cement the idea of being a dead language.
Re: C isn't a programming language anymore (2022)
#160Earlier quoted context omitted.
There is also still a lot of low-level proprietary code developed in C. I would guess far more than what is developed in Rust. I fully agree about your last point. The proposed solutions to some of the deficiencies of C are sometimes worse than the disease while its benefits are often exaggerated, at the same time adding unnecessary layers of complexity that will haunt us for decades. In contrast, my hope would be to…
>There is also still a lot of low-level proprietary code developed in C. I would guess far more than what is developed in Rust. Do you mean that there's still code being developed, or that it still exists? Because I meant the former, the latter is true of a lot of dead languages like fortran and cobol, and it would cement the idea of being a dead language.