Live data from Hacker News

C isn't a programming language anymore (2022)

faultlore.com

61–70 of 217 posts

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

#61
C’s biggest sins (also inherited by C++):

- unspecified default type sizes. Should have had i8, u16, i32, u64, f32, f64 from the beginning.

- aliasing pointers being restricted by default (ie an alias keyword should have been added). Performance matters. All these benchmarks which show something beating C or C++ are mostly due to dealing with aliasing pointers. C++26 still doesnt have standardised restrict keyword.

There are more but I understand the logic/usability/history behind them. The above points should have been addressed in the 80’s.

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

#62
post #19

I really don't understand why people keep misunderstanding this post so badly. It's not a complaint about C as a programming language. It's a complaint that, due to so much infrastructure being implemented in C, anyone who wants to interact with that infrastructure is forced to deal with some of the constraints of C. C has moved beyond merely being a programming language and become the most common interface for in-pr…

> could things be better if we had an explicitly designed interoperability interface? Yes, we could define a language-agnostic binary interoperability standard with it's own interface definition language, or IDL. Maybe call it something neutral like the component object model, or just COM[1]. :) [1] https://en.wikipedia.org/wiki/Component_Object_Model

The general idea is sound. The implementation less so.

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

#63

Earlier quoted context omitted.

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.

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 spanning a large range of cost and size, from microcomputers to mainframes.

In Unix both the operating system and the applications were written in the same language.

The original Unix and C developers wrote persuasive books that taught the C language and demonstrated how to do systems programming and application programming in C on Unix.

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.

IN the 1970s and 80s, Unix wasn't universal in universities. Other operating systems were also widely used: Tenex, TOPS-10, and TOPS-20 on DEC-10s and 20s, VMS on VAXes. But their systems languages and programming cultures did not catch on in the same way as C and Unix.

The original Macintosh OS of the 1980s was no competitor to Unix. It was a single user system without integrated network support. Apple replaced the original Macintosh OS with a system based on a Unix.

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

#64
post #31

Earlier quoted context omitted.

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.

> C just minimally reflects how computers work. The rest is just convention. This hasn't been true for decades. x86 assembly is now itself an abstraction over what the CPU is actually doing. Microcode, speculative execution, etc.

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.

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

#65
post #57
post #42

Earlier quoted context omitted.

Yes, because C is, by virtue of its history and central role in the development of all mainstream operating systems, the lowest common denominator. Also, if I remember correctly, the first Rust and Go compilers were written in C.

> Yes, because C is, by virtue of its history Sure history is great and all, but in C it's hard to say reliably define this int is 64-bit wide, because of the wobbly type system. Plus, the whole historical baggage of not having 128-bit wide ints. Or sane strings (not null terminated).

> in C it's hard to say reliably define this int is 64-bit wide

That isn't really a problem any more (since c99). You can define it as uint64_t.

But we have a ton of existing APIs that are defined using the wobbly types, so we're kind of stuck with it. And even new APIs use the wobbly types because the author didn't use that for whatever reason.

But that is far from the only issue.

128 bit ints is definitely a problem though, you don't even get agreement between different compilers on the same os on the same hardware.

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

#66
Do someone pays for anti-C propaganda ?? All that logic breaking accusations...

Eg. here, from memory:

> ...you want to read 32 bits from file but OH NOOES long is 64 bit ! The language ! The imposibility !

But when you read something ot unserialize some format you just need to know based on format schema or domain knowledge. Simple and straightforward like that ! You do not do some "reflections" on what language standard provide and then expect someone send you just that !!

So that anti-C "movement" is mostly based on brainless exampless.

Not saying C is perfect.

But it is very good and I bet IBM and other big corps will keep selling things written and actively developed in C/C++ + adding hefty consulting fees.

In the meantime proles has been adviced to move to cpu-cycle-eating inferior languages and layers over layers of cycle burning infra in cloud-level zero-privacy and guaranteed data leaks.

Oh, btw. that femous Java "bean" is just object with usually language delivered "basic type"... How that poor programmer from article should know what to read from disc when he just have types Java provides ?? How ? Or maybe he should use some domain knowledge or schema for problem he is trying to solve ??

And in "scripting language" with automatic int's - how to even know how many bits runtime/vm actually use ? Maybe some reflection to check type ? But again how that even helps if there is no knowledge in brain how many bits should be read ?? But calling some cycle burning reflection or virtual and as much as posible indirect things is what fat tigers love the moust :)

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

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

The things complained about in the article are not a minimal reflection of how computers work.

Take the "wobbly types" for example. It would have been more "minimal" to have types tied directly to their sizes instead of having short, int, long, etc.

There isn't any reason that compilers on the same platform have to disagree on the layout of the same basic type, but they do.

The complaints about parsing header files could potentially be solved by an IDL that could compile to c header files and ffi definitions for other languages. It could even be a subset of c that is easier to parse. But nothing like that has ever caught on.

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

#68
post #52
post #31

Earlier quoted context omitted.

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.

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.

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

#69

Earlier quoted context omitted.

Yes

Care to share the answer with the rest of the class?

I am not sure what Filip's view on this is. But like to point out the article from Stephen Kell linked below which explains why C is an incredibly useful tool for systems programming and what distinguishes it from all other languages.

https://dl.acm.org/doi/abs/10.1145/3133850.3133867

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

#70

C’s biggest sins (also inherited by C++): - unspecified default type sizes. Should have had i8, u16, i32, u64, f32, f64 from the beginning. - aliasing pointers being restricted by default (ie an alias keyword should have been added). Performance matters. All these benchmarks which show something beating C or C++ are mostly due to dealing with aliasing pointers. C++26 still doesnt have standardised restrict keyword. T…

Arrays decaying to pointers is probably the biggest non-platform specific design oversight.

As you said, it's easy to see where it came from, but it should've been fixed long ago.

Post reply on HN