Live data from Hacker News

C isn't a programming language anymore (2022)

faultlore.com

131–140 of 217 posts

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

#131

Earlier quoted context omitted.

The idea is mostly that we shouldn't worry. The user of the lib on an arduino will feed it arduino sized problems and the amd64 user will likewise larger problems. Again I think just think of the transition from 32 to 64 bit. Most ranges are "input"/"user " dependent and it would have been needlessly messy to have to even with automatic conversion help rewrite say every i32 to i64 or which ones to convert.

That's size_t. What about counting milliseconds?

Like fucking what? If you do any TS.. you just use unsigned whatever fastest type you have on targeting platform, and you do NOT care. 16bit? wrapping at 1 min? Thats eternity even on 2MHz 6502... You just count and substract to get difference. Usually you are If you target about 32bit and 16bit, you either think about and using long (on 16 bit is more costly) or you just count seconds.. Or ticks.. or whatever you need.

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

#132
post #115
post #109

Earlier quoted context omitted.

First of all C did not had any generics, so same playing field. C has a runtime, even if tiny. That is what calls into main(), handles floating point arithmetic when none is available, functions that run before and after main(), nowadays also does threading. Heap memory handling in Pascal, Modula-2, Ada, is much safer than C, first of all no need to do math to calculate the right size, arenas are available on the sta…

C uses pointer casts all over the place to fake generics. If you don't have that (in Pascal or MODULA-2) then life becomes very unpleasant. There is a quite a bit of C code that makes creative use of the size of allocations. For example linked lists with a variable sized payload. Again one of the things that would prevent a C programmer from switching to Pascal. I don't expect the Zig user base to become larger than…

Same tricks are possible in Modula-2, Pascal, Ada, if fake generics count.

Creative use of the size of allocations are also possible in those languages, the BIG difference is that they aren't the default way everything gets done.

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

#133
post #85

Earlier quoted context omitted.

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.

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.

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

#134
post #82

Earlier quoted context omitted.

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

JNA is a whole dependency of its own, shame it's not built into the JRE

It is nowadays, that is what Panama is for.

Unless one is stuck with Android Java, Google's J++.

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

#135
post #116

Earlier quoted context omitted.

Don't forget about branch prediction (GCC may have __builtin_expect, but that's not standard C).

The compiler usually can't do anything about branch prediction. Expect is more about keeping cold paths out of the cache.

Actually that was one of the problems with EPIC architectures, where compilers are expected to be the ones doing those kind of optimizations.

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

#136
post #129

Earlier quoted context omitted.

I wonder why there aren't many successful European hardware products.

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)

#137
post #131

Earlier quoted context omitted.

That's size_t. What about counting milliseconds?

Like fucking what? If you do any TS.. you just use unsigned whatever fastest type you have on targeting platform, and you do NOT care. 16bit? wrapping at 1 min? Thats eternity even on 2MHz 6502... You just count and substract to get difference. Usually you are If you target about 32bit and 16bit, you either think about and using long (on 16 bit is more costly) or you just count seconds.. Or ticks.. or whatever you ne…

cool, it's an app that lets me set a 2 minute timer and counts in milliseconds, oh what's that, it doesn't work right on Arduino

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

#138

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 were making it all up as they went along at a time when computers had 8, 12, 16, 18, 32, and 36 bit word lengths.

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

#139
post #56

What languages does this author like which has a written spec?

This article isn't about languages. It's about the protocol for two or more languages to talk to each other. There is no specification for this. The System V ABI is as close as we get to an actual specification but not everyone uses it and in any case it only covers a small part of the protocol.

> He’s trying to materially improve the conditions of using C itself as a programming language.

> I’m trying to materially improve the conditions of using literally any language other than C.

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

#140
post #129

Earlier 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

" any company that doesn't go bankrupt is successful"
Post reply on HN