Hacker News new | past | comments | ask | show | jobs | submit login

I already had spent too much time on this discussion so this comment will be the last one for anyone still following this.

> Thus Asking questions like "why was * used for pointer syntax" is meaningless since Ritchie himself says he took it from B; [...] Thinking about the evolutionary path BCPL->B->C answers your other questions.

It rather means that Ritchie took it from B and didn't feel like it should change. It should be noted that B did change its dereference syntax from BCPL, which eventually settled on `!e` and `e1!e2` for `*e` and `e1[e2]` in C (with everything implicitly being a byte pointer). As far as I'm aware there is no documented reason why Thompson turned `!` into `*`, which by the way would be used in too many places at this point until C moved away from BCPL-style escape sequences in string literals. Maybe Thompson's other language, Bon, has some clue but I have no information about that. In any case Ritchie clearly didn't think far into this particular change, because C was originally conceived as a largely compatible extension to B (then NB) and then stuck. Isn't that accidental enough?

> Now you can see how "Declaration reflects Use" and variable-centric syntax makes sense.

There are multiple concrete implementations for that driving principle. `int a;` and `a int;` would have been equally okay under this principle, so the only real reason to pick the former is the influence of B (`auto a;`). I wondered that you are using that term only to mean C's strictest implementation, and that you actually don't like ANSI/ISO C's newer function declaration syntax, but then your arguments for the general principle would not back the eventual syntax used by C.

> Nothing comes close to the "C family of languages" by which i mean not just extensions but anybody who took inspiration from it.

There are many different classes to consider. In the broadest sense even Python is said to be inspired by C, even though it would be absurd to consider Python to be a proof of C's inherent quality in addition to its popularity. Some languages are also only syntactically similar to C because its block syntax did have some nice syntactic property (known as "curly-brace languages" nowadays). Those superficial similarities can't imply your claim.

> There is only one "official" one, that was designed by Narain Gehani and explained in the book "The Concurrent C Programming Language".

It was never standardized, and apparently it wasn't available much outside of AT&T Labs. If the book would make it somehow official, I can write and publish my own book with the same title today. In any measure, that Concurrent C language is not as notable as other concurrent languages based on or influenced by C.

> By design and accident C turned out to be a pretty good Core/Kernel language for others.

There are a lot of extension languages that are NOT based on C or C++. In fact, I believe every single language in the TIOBE Top 20 ranking has at least 10 notable ones in average. C was used for extension only because it was popular for many years, and many such extensions had to work around or bend its limitations for their purposes. (For example, C itself doesn't have types for distinct address spaces and many extensions add reserved keywords, which you can add to any existing languages as I noted earlier.)




If you want a discussion on the overall design of C and your opinion of it create a separate thread and i (and others) will be more than happy to engage you there.

> It rather means that Ritchie took it from B and didn't feel like it should change ... Isn't that accidental enough?

That is not called "accidental" but a "design decision".

> In any case Ritchie clearly didn't think far into this particular change,

That is just your opinion and not borne out from Ritchie's own writings and what we can infer from it.

> `int a;` and `a int;` would have been equally okay under this principle,

No, the decision to have "int a" was already done and only a "pointer to int a" was being thought of leading to a variable-centric view.

> Some languages are also only syntactically similar to C because its block syntax did have some nice syntactic property (known as "curly-brace languages" nowadays). Those superficial similarities can't imply your claim

https://en.wikipedia.org/wiki/List_of_C-family_programming_l...

> In any measure, that Concurrent C language is not as notable as other concurrent languages based on or influenced by C.

The point was not popularity nor standardization but the domain into which C was extended. That is why i gave the three specific examples one for each important domain.

> There are a lot of extension languages that are NOT based on C or C++.

That is not the point. I am talking about using C as a "Core/Kernel language" in the design of other languages. No other language (other than the Lisp family) comes close to C in versatility and eventual success here.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: