News for hackers. Stuff that matters.
Re:Cdecl: C Gibberish ↔ English by thwd on Saturday April 23, 2022 @09:56AM (#31134309)
Go solves 99% of the problem quite nicely. You don't often deref pointers in Go, because of auto-addressing. E.g. there's no arrow operator as in C, the dot derefs when necessary.

I would say `v := (p.)` could've been the deref operator, but what do I know.

Re:Cdecl: C Gibberish ↔ English by masklinn on Saturday April 23, 2022 @10:21AM (#31134498)
That you don't deref pointers in Go is not what fixes this issue.

What fixes this issue is that, like most other languages which are not C, Go understands that "is a pointer" is a property of the type, not the name / value.

So even if it used C-style declaration, Go would say

    *int p
or, using a more verbose syntax

    Pointer[int] p
Re:Cdecl: C Gibberish ↔ English by kevin_thibedeau on Saturday April 23, 2022 @01:07PM (#31136078)
Even C isn't consistent about this:

  int * a, b; // "Property" of the variable

  typedef int * pint;
  pint x, y; // Property of the type
This has created so much bad legacy code where pointer typedefs are created for no good reason.
Re:Cdecl: C Gibberish ↔ English by xscott on Saturday April 23, 2022 @10:25AM (#31134540)
Why not solve 100% of the problem? And since pointer syntax is really so rare, you wouldn't even see the suffix operator.