Live data from Hacker News

50 years of C, the good, the bad and the ugly [video]

streaming.media.ccc.de

151–160 of 257 posts

Re: 50 years of C, the good, the bad and the ugly [video]

#151
post #128

Earlier quoted context omitted.

> It's really not, though. What C is an abstraction of is computer architecture as it existed by the late 1960s. I don't follow. Barring micro-code, hardware is designed for executing either RISC or CISC instructions. If anything, the industry has matured and we see less esoteric ISA's today than in the 1960s.

A modern low level labguage would expose you to the concepts of cache lines and homogeneous and eterogeneous cores directly, with locality awareness to recognize false sharing. It would be something suitable to program the Cell architecture from PS2.

What about those of us working on microcontrollers that use TCM rather than cache, and that don't have multiple cores? C sure seems like a good fit…

Re: 50 years of C, the good, the bad and the ugly [video]

#152

The more I learn about new and less new languages (Zig, Jai, C#) the more I like C and its true simplicity. The language has a few irritating historical artefacts and the stdlib API is completely outdated and full of bad design, but there it is still versatile enough for my needs.

I like C89 for its simplicity too but after using the Jai beta for over a year I have a hard time seeing myself ever going back.

Re: 50 years of C, the good, the bad and the ugly [video]

#153

Earlier quoted context omitted.

> HN really is a joke sometimes. A lot of what I'm seeing from your comments here is you can't handle people who have something positive to say about C. They're not saying it's the one true way or something. Just that they like it in some respect. And your attempts to dismiss that and call "HN" a joke for harboring someone who thinks this way look kind of childish to me.

Then you are seeing what you want to see. People are straightforwardly arguing that C is semantically rich which is indeed laughable. I have addressed the point under but clearly a lot of you don’t understand what language semantics are. Considering I was having interesting discussion about the subtleties of the Hindley-Milner type system on this same website a decade ago, yes, I do think HN is becoming a joke. The j…

There are plenty of interesting C works out there, as well as data structures or algorithms that C can express elegantly.

Small example, linked lists. I don't think non-C linked list code tends to be as straightforward as I've seen in C.

Or the character-at-a-time style of string processing. It's kind of unique to C.

You can say there is stuff about that you don't like. That's fine. Linked lists suck with modern CPU caches anyway. C strings have lots of misadventures in terms of buffer overflows. But it's unique and interesting. Lots of elegant things have been written this way. Your unfamiliarity with it doesn't make it "a joke" to point this out.

I have my own gripes with HN. Try mentioning politics and it brings out all sorts of fascist-sympathizing crazies. But saying good to neutral things about C (while not even universally praising it) is not one of those issues.

Re: 50 years of C, the good, the bad and the ugly [video]

#154
post #144

Earlier quoted context omitted.

The argument is not about what can and can’t be done in C. C is Turing complete and low level. You can do anything in C. The debate is not even about if it’s good idea (I don’t think it is but that’s separate). The question is about C semantics. Given the reply I get it’s pretty obvious that some here don’t understand what language semantics are. It’s about the amount of concepts you can express in the language. Hask…

You’re whitewashing history if you think Pascal was superior to C. There was no conspiracy among compiler developers as you imply. Also you complain about semantic richness of C, but then only point to semantically rich languages you despise. A curious reader would wonder: why care about semantically rich languages then? An observant reader would wonder: so aren’t there times where semantic richness is not useful?

What conspiracies are you talking about? C won because its compiler was widely available for free. That’s pretty much a fact. Pascal was indeed a superior language but limited by the proliferation of extensions, paid compilers and its compiler performance.

I’m not even complaining about the semantic richness of C. I’m just stating the fact that it doesn’t really have semantic richness. Then again don’t get me wrong. I do think C is a terrible language and I say that having worked on a C static analyser. It’s full of avoidable undefined behaviours and silly sharp edges.

Thankfully, nice languages with rich semantic exist. I was just pointing some I don’t like to separate the issue of semantic richness from likability. I enjoyed working in Ada a lot. Ocaml is awesome. I have never used Rust but from what I have seen that seems nice.

Semantic richness is useful because it helps programmers express what they want to do in way which are clearer and therefore more likely to be correct.

Re: 50 years of C, the good, the bad and the ugly [video]

#155
post #141

Earlier quoted context omitted.

Have you looked at Nim? https://nim-lang.org/ or Zig? https://ziglang.org/ or D? https://dlang.org/

Yes I know about all of them, they're all a bit too complex for my taste. They're great languages, but they're not what I want.

I understand. I wrote a language once, a while ago. To get the speed I wanted, I wrote it in assembly language - and it took over 2 years of fairly consistent effort to get something that really worked. (I would call it "Pythonic" but this was before Python existed.)

So, go for it, and keep us updated on your progress. Good luck.

Re: 50 years of C, the good, the bad and the ugly [video]

#157

Earlier quoted context omitted.

Art is often about constraint, and mastery of simple tools. I identify with @antirez's sentiment. I know both C and C++ very well. I find C definitely more artistic. C++ is utilitarian. Prolog is the other language I code in "artistically". It too is quite simple and constrained, though it is on the opposite end of the high/low-level spectrum as C.

What is your take on Perl and Ruby? They seem to be the two languages where the communities themselves talk the most about poetry and elegance.

Perl (5) I find quite complex, the opposite of C and Prolog. I suppose the elegance some find comes from packing lots of behavior into very few characters of code. When I want to code as art though, I prefer simpler, less "magical" tools.

I've never used Ruby but from what I've seen I understand it to be similar to Perl in that regard.

Re: 50 years of C, the good, the bad and the ugly [video]

#159

The more I learn about new and less new languages (Zig, Jai, C#) the more I like C and its true simplicity. The language has a few irritating historical artefacts and the stdlib API is completely outdated and full of bad design, but there it is still versatile enough for my needs.

I like C89 for its simplicity too but after using the Jai beta for over a year I have a hard time seeing myself ever going back.

I'll probably give Jai a go when it is released, but I am a bit afraid the idiosyncrasies are already creeping up.

Re: 50 years of C, the good, the bad and the ugly [video]

#160
post #41

A different take on the matter: I write code mainly artistically, and I found that C is one of the best languages available to code as a form of art. It allows to be both brutal and honest, or abstract and deceiving. Not many languages are so semantically powerful.

What are your goto sources of knowledge for C? I’m learning it to write embedded stuff and so far it’s mainly the k&r book, one from no starch press, and a udemy course. Thanks!

Not the GP, but cppreference.com [1] is the best reference I've found for C (and C++) in 20+ years, short of just reading the standards themselves.

[1] https://en.cppreference.com/w/c

Post reply on HN