Live data from Hacker News

C isn't a programming language anymore (2022)

faultlore.com

81–90 of 217 posts

Re: C isn't a programming language anymore (2022)

#81
post #6

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

COM, WinRT, XPC, AIDL.

Now you can move the goal posts and assert that any data serialized into a memory buffer is an array of ints.

Re: C isn't a programming language anymore (2022)

#82
post #40
post #6

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…

In pieces of my code, I need to call setuserid() to manage some of the security that I designed in 2010. There was no Rust at that point, and I used the most basic tool that could do it. Could I have done this in Java with gymnastics of JNI, linking C into the JRE? Definite maybe.

Yes, nowadays with Panama, and before Rust was around, JNA was already there so using JNI wasn't strictly necessary.

Re: C isn't a programming language anymore (2022)

#83
post #31

Earlier quoted context omitted.

> why C gets to be the foundation for how systems software is written. Is there an answer here more interesting than "it's what Unix and Windows were written in, so that's how programs talked to the OS, and once you have an interface, it's impossible to change"?

Yes and no. Clearly what you said is true, but the more profound reason is that C just minimally reflects how computers work. The rest is just convention.

How does C reflect how AVX works?

Re: C isn't a programming language anymore (2022)

#84
post #68
post #52

Earlier quoted context omitted.

It minimally reflects PDP-11 assembly, which is not how modern computers work.

This is a meme which is repeated often, but not really true. If you disagree, please state specifically what property of PDP-11 you think it different from how modern computers work, and where this affects C but not other languages.

It lacked SIMD instructions.

Re: C isn't a programming language anymore (2022)

#85

Earlier quoted context omitted.

It seems to be a meme on HN that C doesn't reflect hardware, now you're extending that to assembly. It seems silly to me. It was always an approximation of what happens under the hood, but I think the concepts of pointers, variable sizes and memory layout of structs all represent the machine at some level.

> the concepts of pointers, variable sizes and memory layout of structs all represent the machine at some level. Exactly. Everything in assembly is still one-to-one in terms of functional/stateful behavior to actual execution. Runtime hardware optimization (pinhole instruction decomposition and reordering, speculative branching, automated caching, etc.) give a performance boost but do not change the model. Doing so w…

Lets play a game of what ISO C can do, and no other systems programming language has similar feature available?

If language extensions to ISO C are allowed, then same goes for my selection on competing systems languages.

Re: C isn't a programming language anymore (2022)

#86

Earlier quoted context omitted.

> why C gets to be the foundation for how systems software is written. Is there an answer here more interesting than "it's what Unix and Windows were written in, so that's how programs talked to the OS, and once you have an interface, it's impossible to change"?

It wasn't a coincidence, or an accident. C was specifically designed to write Unix, by people who had experience with a lot of other computer languages, and had programmed other operating systems including Multics and some earlier versions of Unix. They knew exactly what they were doing, and exactly what they wanted.

They wanted to play and ignored other languages on purpose, that is all.

> 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.

https://www.nokia.com/bell-labs/about/dennis-m-ritchie/chist...

Pity that in regards to secure programing practices in C, community also ignores the decisions of the authors.

> Although the first edition of K&R described most of the rules that brought C's type structure to its present form, many programs written in the older, more relaxed style persisted, and so did compilers that tolerated it. To encourage people to pay more attention to the official language rules, to detect legal but suspicious constructions, and to help find interface mismatches undetectable with simple mechanisms for separate compilation, Steve Johnson adapted his pcc compiler to produce lint [Johnson 79b], which scanned a set of files and remarked on dubious constructions.

Also to be noted that on Plan 9 they attempted to replace C with Alef for userspace, and while the experiment failed, they went with Limbo on Inferno, and also contributed to Go.

And that C compiler on Plan 9 is its own thing,

> The compiler implements ANSI C with some restrictions and extensions [ANSI90]. Most of the restrictions are due to personal preference, while most of the extensions were to help in the implementation of Plan 9. There are other departures from the standard, particularly in the libraries, that are beyond the scope of this paper.

https://doc.cat-v.org/plan_9/4th_edition/papers/compiler

Re: C isn't a programming language anymore (2022)

#87

Earlier quoted context omitted.

I'm not sure what you mean by "coincidence" or "accident" here. C is a pretty OK language for writing an OS in the 70s. UNIX got popular for reasons I think largely orthogonal to being written in C. UNIX was one of the first operating systems that was widely licensed to universities. Students were obliged to learn C to work with it. If the Macintosh OS had come out first and taken over the world, we'd probably all be…

It is often said that C became popular just because Unix was popular, due to being free -- it just "rode its coattails" as you put it. As if you could separate Unix from C. Without C there wouldn't have been any Unix to become popular, there wouldn't have been any coattails to ride. C gave Unix some advantages that other operating systems of the 1970s and 80s didn't have: Unix was ported to many different computers s…

> Unix wasn't the first operating system to be written in a high-level language. The Burroughs OS was written in Algol, Multics was written in PL/I, and much of VMS was written in BLISS. None of those languages became popular.

Of course, they weren't available as free beer with source tapes.

> Apple replaced the original Macintosh OS with a system based on a Unix.

Only because they decided to buy NeXT instead of Be.

Had they bough Be, that would not been true at all.

Re: C isn't a programming language anymore (2022)

#88

Earlier quoted context omitted.

I'm not sure what you mean by "coincidence" or "accident" here. C is a pretty OK language for writing an OS in the 70s. UNIX got popular for reasons I think largely orthogonal to being written in C. UNIX was one of the first operating systems that was widely licensed to universities. Students were obliged to learn C to work with it. If the Macintosh OS had come out first and taken over the world, we'd probably all be…

Repeating a previous comment of mine ( https://news.ycombinator.com/item?id=32784959 ) about an article in Byte Magazine (August 1983) on the C programming language: From page 52: > Operating systems have to deal with some very unusual objects and events: interrupts; memory maps; apparent locations in memory that really represent devices, hardware traps and faults; and I/O controllers. It is unlikely that even a low-…

The irony is that all wannabe C and C++ replacements are exactly the "Pascal model" brought back into the 21st century, go figure.

"A consequence of this principle is that every occurrence of every subscript of every subscripted variable was on every occasion checked at run time against both the upper and the lower declared bounds of the array. Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interests of efficiency on production runs. Unanimously, they urged us not to they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980 language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law."

-- C.A.R Hoare's "The 1980 ACM Turing Award Lecture"

Re: C isn't a programming language anymore (2022)

#89

Earlier quoted context omitted.

I'm not sure what you mean by "coincidence" or "accident" here. C is a pretty OK language for writing an OS in the 70s. UNIX got popular for reasons I think largely orthogonal to being written in C. UNIX was one of the first operating systems that was widely licensed to universities. Students were obliged to learn C to work with it. If the Macintosh OS had come out first and taken over the world, we'd probably all be…

> 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)

#90
post #35
post #6

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…

I'd never thought I'd see the day that anyone praises COM.

If you read Don Box’s book on COM he goes through every decision they made and the rationale for it. It all seemed to make sense.

Unfortunately I think Don Box’s was the only person in the world who really understood it all.

Post reply on HN