News for hackers. Stuff that matters.
Re:C array types are weird by throwaway27448 on Tuesday May 26, 2026 @07:19PM (#48287358)
Why are we still discussing c in 2026? Why are you intentionally hamstringing yourself unless you're using fucking hp-ux
Re:C array types are weird by smackeyacky on Tuesday May 26, 2026 @08:00PM (#48287647)
Embedded programming is still in C for a lot of micro controllers and whatnot. If you’re programming with limited resources it’s essential to understand pointers and arrays. Likely you won’t be doing anything useful without them
Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @01:37AM (#48290096)
I understand certain programmers are chained to C. We should use this opportunity to castigate the people who don't target better languages rather than trying to work with clearly outdated tools.
Re:C array types are weird by flohofwoe on Wednesday May 27, 2026 @02:57AM (#48290672)
What about just letting people decide for themselves instead of telling them what they should and shouldn't do.
Re:C array types are weird by pjmlp on Wednesday May 27, 2026 @03:10AM (#48290763)
Some times they need a little help from legislators.
Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @03:23AM (#48290846)
Bruh
Re:C array types are weird by Biganon on Wednesday May 27, 2026 @09:51AM (#48294381)
Could you crawl back to reddit? Thanks
Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @03:47PM (#48299564)
Sir (generously), we deserve better than half-assed software in 2026. Please leave your racist-ass bigotry in the alps
Re:C array types are weird by pjmlp on Wednesday May 27, 2026 @03:09AM (#48290759)
With very few exceptions like PICs, most of them also support C++, which has nice goodies like span and views, that can be optionally bounds checked.
Re:C array types are weird by cartoonfoxes on Tuesday May 26, 2026 @07:33PM (#48287446)
Re:C array types are weird by mianos on Tuesday May 26, 2026 @07:38PM (#48287487)
p.s. in case you don't want to follow the link, number 2 on the list
Re:C array types are weird by pdpi on Tuesday May 26, 2026 @08:30PM (#48287912)
As always, the TIOBE Index is of dubious value. The fact that it ranks Delphi above both Go and Rust should give you an idea of why.
Re:C array types are weird by keyle on Tuesday May 26, 2026 @08:52PM (#48288065)
Yeah it's rather odd, also jumps like this in ADA makes you wonder

https://www.tiobe.com/tiobe-index/ada/

Re:C array types are weird by flohofwoe on Wednesday May 27, 2026 @02:55AM (#48290658)
Ada is being discussed a lot on HN as some sort of 'lost utopia', and AFAIK Tiobe doesn't count actual usage but (more or less) mentions.
Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @03:08AM (#48290747)
C is hardly any path forward
Re:C array types are weird by flohofwoe on Wednesday May 27, 2026 @03:52AM (#48291043)
It's not much different from any other high level programming language. Just a different set of compromises to accept.
Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @07:37AM (#48292669)
Yes why would anyone choose to make a fool of themselves when they could choose to build instead?
Re:C array types are weird by cozzyd on Tuesday May 26, 2026 @11:48PM (#48289385)
And yet so few other languages attempt to have a stable ABI (other than by...mimicking C).
Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @01:37AM (#48290099)
The ABI is not the issue.
Re:C array types are weird by cozzyd on Wednesday May 27, 2026 @12:40PM (#48296809)
It's an issue if you want different software components to talk to each other without IPC.
Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @03:43PM (#48299500)
Most languages can interoperate with the C abi without commiting you to using the language itself. In fact I can't think of a single language that both produces software people actually use and doesn't interoperate with the c abi.
Re:C array types are weird by pjmlp on Wednesday May 27, 2026 @03:11AM (#48290770)
C doesn't have a stable ABI, most folks mistake the ABI from OS written in C, with an imaginary C ABI.
Re:C array types are weird by flohofwoe on Wednesday May 27, 2026 @04:06AM (#48291157)
OS ABIs are usually stable though ;)

Finally someone getting it right though. C doesn't have any ABI per se, compilers need to implement whatever ABI a specific operating system defines (otherwise the language would be pretty useless since it couldn't call into operating system functions).

Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @03:21AM (#48290834)
Even then, arrays can be encoded and enforced on each side. It would be simpler to enforce this via the abi—but the abi itself does not open issues with array description and access
Re:C array types are weird by cozzyd on Wednesday May 27, 2026 @12:39PM (#48296795)
Sure that's technically correct, but in practice it means I get a stable ABI :).
Re:C array types are weird by flohofwoe on Wednesday May 27, 2026 @02:48AM (#48290600)
Because C is an exceptionally unopinionated language. For some people having a programming language that doesn't have a strong opinion on how things are supposed to work is a good thing.

Most modern languages start with fixing C's warts (good) but then at some point turn into 'tech manifestos' (for lack of a better word). C is refreshingly devoid of opinion and that's what makes it so extremely flexible and timeless.

Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @03:07AM (#48290738)
> Because C is an exceptionally unopinionated language.

Compared to what?

Anyway I find it hard to believe enabling suicide is a good thing

Re:C array types are weird by flohofwoe on Wednesday May 27, 2026 @03:50AM (#48291024)
> Compared to what?

...for somewhat recent languages: Rust, Zig, Odin... (with differing intensity, but they all want to nudge the programmer into a certain direction of how to do things).

> Anyway I find it hard to believe enabling suicide is a good thing

"War is peace, Freedom is slavery, Ignorance is strength" ;)

Seriously, if people want to write their programs in assembly code or whatever weird kink, just let them. In the end it is the job of the runtime environment to sandbox untrusted code.

Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @07:34AM (#48292645)
Oh so by "unopinionated" you want to embarrass yourself. You think the authors of unix would have used c if they could have bootstrapped rust instead? How fucking stupid do you think we are
Re:C array types are weird by flohofwoe on Wednesday May 27, 2026 @08:25AM (#48293196)
> How fucking stupid do you think we are.

Well in your case specifically, I'm really not sure tbh.

> You think the authors of unix would have used c if they could have bootstrapped rust instead?

Considering that Ken Thompson later helped building Go, which is pretty much an anti-Rust, I do indeed think that they wouldn't have gone with an overengineered boondoggle like Rust if they had the choice.

Apparently Brian Kernighan also isn't a big fan of Rust, quote:

"I have written only one Rust program, so you should take all of this with a giant grain of salt,” he said. “And I found it a — pain… I just couldn’t grok the mechanisms that were required to do memory safety, in a program where memory wasn’t even an issue!"

Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @10:37AM (#48295085)
I think we can build much better software with rust than we can with c.
Re:C array types are weird by yxhuvud on Wednesday May 27, 2026 @07:19AM (#48292480)
Because half the world revolves around C fundamentals, sadly enough. Things would be a lot better if there existed a non-C portable way to share libraries across language boundaries (including libC).
Re:C array types are weird by throwaway27448 on Wednesday May 27, 2026 @03:42PM (#48299493)
The C abi is not C. Using C is a bad decision.