Live data from Hacker News

C meeting is over. C23 added:

twitter.com

121–130 of 363 posts

Re: C meeting is over. C23 added:

#121
post #102
post #69

Earlier quoted context omitted.

I don’t see my SIMD instructions anywhere.

The word "portable" means a subset of everything possible. Do you think every CPU architecture supports SIMD?

> The word "portable" means a subset of everything possible.

Exactly; for example, C has single precision and double double precision floating point, 64 bit types, and complex arithmetic because every CPU architecture has those built-in.

Re: C meeting is over. C23 added:

#122

I can't tell if this is serious. Surely if you're still using C now it's for legacy reasons. And if using it for legacy reasons you are likely stuck using an old C standard. So who will use C23?

I will continue to use C because I haven't seen an appealing alternative.

Re: C meeting is over. C23 added:

#123
post #77

Earlier quoted context omitted.

What's being removed in C23 is the ancient K&R syntax for function definitions: int max(a, b) int a, b; { return a>b?a:b; } My understanding is that C23 does not change the meaning of function declarations. So "void foo();" remains a declaration of a function accepting an unknown number of parameters.

Wow, that's annoying. There's a bunch of old code we have that'll need updating (written that way to keep the line lengths down).

Maybe the compiler will add a extension flag? I mean the K&R declarations still need to be supported in the compiler for earlier standards.

Re: C meeting is over. C23 added:

#125

C is the only sane language left. It never changes and it lets us write code that just works. We can focus on getting things done and shipping rather than learning new features and Googling compiler errors. Learn once, ship forever.

It’s also upwardly compatible so no messing with code from a deprecated version. Python 2 to python three has this issue. If I need to change my code to make it run on the latest language standard then that is a big red flag for me.

Re: C meeting is over. C23 added:

#126
post #100

Earlier quoted context omitted.

Languages exist that compile to C which gives them many of the above advantages and more, so why choose C over them?

Depending on transpiler (compilers that will compile to C), you can get near representation in C (rarely) or something completely different (frequently). In Scheme/LISP world (where transpilers were popular for a while), even a simple expression like "(+ 1 1)" will rarely give you something like: "int a = 1 + 1;". I've seen these things would produce dozen of lines of various boxing/unboxing calls, type checks and GC…

A compiler that translates to another language used to be called a translator.

Re: C meeting is over. C23 added:

#127
For all of us that follow an "I do not want to log in to twitter" philosophy, can someone here please post an alternative link?

Incidentally, I'm glad Twitter now blocks you from reading if not signed in. I'm hoping this will encourage the use of alternatives.

Re: C meeting is over. C23 added:

#130

> [dropped] Representations for signed integers other than two's complement May I assume that there won't be signed int undefined behavior after C23? INT_MAX + 1 == INT_MIN?

I doubt it, and wouldn’t want it. It would break all kinds of optimizations. For example, with wrapping

  for(int i = 0; i 
Wouldn’t terminate if m = INT_MAX. That means compilers either have to special-case that value, or can’t use the loop instructions of some CPUs (M68000 has “decrement and branch if larger than zero”, for example)

Also, with wrapping, a[i] and a[i+1] aren’t guaranteed to be adjacent. That can make auto-vectorisation difficult.

Post reply on HN