36 ms·
I don't know what are you trying to say? How does this follow from the parent post?
by nec4b 5y ago
I don't know what are you trying to say? How does this follow from the parent post?
- pjmlp 5y agoIt follows that the Web made JavaScript unavoidable, then nodejs made it available everywhere else. Likewise UNIX made C unavoidable in systems programming for timesharing servers, eventually like JavaScript outgrew the browser, certain people wanted to run C in their microcomputers.
- nec4b 5y agoI don't disagree with you on C being popular because of UNIX. I do disagree if you believe this is the only reason why it still enjoys popularity. And you are selling the UNIX authors short if you think they chose C just for the fun of it.
- int_19h 5y agoThe UNIX authors didn't choose C; they made it, specifically to make UNIX. And, much like the original UNIX itself, it was a hack - because they were trying to make do within the limits of their hardware. So, some of the syntax is the way it is because it was simpler to parse, for example. And some of the semantics was originally "because PDP does that". As for why C has staying power, that's solely a function of its early success. There's nothing about the language itself that isn't better provided for by some of its historic competitors (e.g. Modula-2). But there's a self-reinforcing loop here, where all new hardware platforms start with C as a basis because it lets you write all the existing code; and conversely, using C is the way to ensure that your code will work even on future platforms.
- nec4b 5y agoYou're hung up on words. I know they made it. It was based of Ken Thomson's B. They chose it, when they could have taken some other existing language. I see great beauty and simplicity in C the same way I see it e.g. in Lisp or Javascript for that matter. I dabbled in Modula-2 and it does not offer the same feeling in my opinion. The core features of C are very powerful and simple at the same time, which is the reason it stayed popular. People writing low level code understand that.
- int_19h 5y agoThe core features of Modula-2 are largely the same as C + modules, but with more consistent syntax and fewer footguns (like no unsafe implicit pointer conversions), so I don't see how C can objectively possess "great beauty and simplicity" in comparison. Unless you're referring specifically to the syntax? B was also written as a hack - it was basically a minimal subset of BCPL small enough to fit in the memory of the machines they were working with. B is elegant in a sense that it's a very simple language for a word-oriented architecture - but that's exactly the part that they had to get rid of for C to target byte-oriented ones. Coincidentally, it's also one of the sources of weirdness in C syntax (e.g. implicit int and K&R prototypes are all legacy of B).
- nec4b 5y agoClaiming something is not beautiful because it is "hacky" on HN is a bit unexpected. For me this is beautiful: https://briancallahan.net/blog/20220220.html https://briancallahan.net/blog/20220220.html I'm sure it's just a hack to you, but you can't do that in Pascal. I mostly like C because of what I wrote here: https://news.ycombinator.com/item?id=30404529 https://news.ycombinator.com/item?id=30404529
- int_19h 5y ago"Hacked together" can mean different things. In this case, it means something slapped together on short notice with limited resources. Such things rarely tend to be beautiful. Beautiful hacks absolutely exist, but they are never hacked together in this sense. The only thing your blog post demonstrates is that C has a built-in textual macro facility. But if you wanted the same in Pascal, you could have it just the same, by running it through the C preprocessor; or better yet, something more powerful like M4. Of course, you'd have to deal with various impedance mismatches, such as the fact that the definition of "token" is different between the preprocessor and the compiler - but that's also true of C! In fact, this discrepancy alone is quite sufficient to deem C inelegant, in my opinion.