News for hackers. Stuff that matters.
Re:C’s Biggest Mistake (2009) by Upvoter33 on Saturday September 12, 2020 @06:15PM (#24456338)
"C is finished if it doesn't address the buffer overflow problem"

You should keep making this prediction ... one day you might be right! :)

Re:C’s Biggest Mistake (2009) by WalterBright on Saturday September 12, 2020 @06:36PM (#24456477)
I suspect C has been steadily losing ground since I made it.
Re:C’s Biggest Mistake (2009) by throwaway_pdp09 on Sunday September 13, 2020 @06:47AM (#24459962)
"you suspect" is pretty vacuous.

More usefully, if you want people to use D instead, what is stopping them, what reasons do they give? How can these be mitigated, cos while I like C I sure would like something better.

Re:C’s Biggest Mistake (2009) by konjin on Saturday September 12, 2020 @10:05PM (#24457589)
It's been 11 years, and C is running on more hardware than it ever has before, viz every android device.

By what measure would C be losing ground?

Re:C’s Biggest Mistake (2009) by xmprt on Saturday September 12, 2020 @10:33PM (#24457723)
Is the number of devices that C is running on a good metric? I think the number of developers or number of projects using C makes more sense to track. And then get the market share. If there are 10x more devices today than 10 years ago then I'd sure hope C was running on more devices but anything less than 10x means C is losing ground.
Re:C’s Biggest Mistake (2009) by pjmlp on Sunday September 13, 2020 @02:34AM (#24458877)
The pyrrhic victory, other than the Linux kernel, everything else is a mix of C++ and Java, with a native compiler written in C++.

And the history of Linux kernel and Android might come to an end if Zirkon ever replaces it, then it will be no more C on Android.

Re:C’s Biggest Mistake (2009) by konjin on Sunday September 13, 2020 @04:08AM (#24459294)
[[citation needed]]
Re:C’s Biggest Mistake (2009) by pjmlp on Sunday September 13, 2020 @05:00AM (#24459481)
Citations for what?

Android and Fuchsia source code are public available, just as their code reviews and ongoing work to port ART to Fuchsia.

Anyone skilful to use C without creating CVEs of their own, is surely able to find that information.

Re:C’s Biggest Mistake (2009) by giancarlostoro on Saturday September 12, 2020 @11:56PM (#24458188)
> By what measure would C be losing ground?

When we start seeing Rust or similar being used instead of C would be a good metric and / or major OS development.

Re:C’s Biggest Mistake (2009) by AlphaSite on Sunday September 13, 2020 @04:11AM (#24459313)
Linux is currently investigating using Rust in drivers (The main issue being lack of compiler support for the more isoteric architectures).
Re:C’s Biggest Mistake (2009) by YeGoblynQueenne on Sunday September 13, 2020 @08:09AM (#24460302)
Thank you for the new knowledge that "eso" is pronounced similar to "iso" in some dialects of English, I didn't know that.

However, the word "isoteric" is more correctly spelled (in non-phonetic spelling) as esoteric. The prefix "eso-" means "inside" in Greek, as in "esothermic", or "esophagus". The prefix "iso-" means "equal", as in "isomorphism", "isosceles", "isometric", etc.

Re:C’s Biggest Mistake (2009) by hanche on Sunday September 13, 2020 @08:56AM (#24460550)
Maybe dial back the sarcasm a notch or two?
Re:C’s Biggest Mistake (2009) by YeGoblynQueenne on Sunday September 13, 2020 @12:30PM (#24461942)
Many apologies - I was not being sarcastic and I'm sorry that this is how my comment came across. As chongli says I'm a native speaker of Greek and I really didn't know how "eso" is pronounced by native English speakers. I've lived for 15 years in the UK and I'm still surprised to hear how people pronounce the more obscure words in their language (some of which come from Greek).
Re:C’s Biggest Mistake (2009) by hanche on Sunday September 13, 2020 @03:48PM (#24463415)
Oops, sorry, I apologise for the mistake. I have seen too much bad behaviour on the 'net, so naturally I assumed the worst. It's a valuable lesson at the modest cost of a few karma points. (I guess I violated HN guidelines too, there. Good thing I don't have the power to downvote yet. I might have done so, and never discovered my mistake.)
Re:C’s Biggest Mistake (2009) by YeGoblynQueenne on Monday September 14, 2020 @01:40AM (#24467139)
Hey, it's OK, no need to apologise. Sorry I caused you to be downvoted.
Re:C’s Biggest Mistake (2009) by hanche on Monday September 14, 2020 @05:47AM (#24468385)
You didn't cause the downvote. Really. But in any case, there are more important things in the world than HN karma. And keep up your Greek lessons. That's one language I'd love to learn, if only I had the time. But I understand it is fiendishly difficult for non-native speakers. (Source: Greek to Me: Adventures of the Comma Queen by Mary Norris.)
Re:C’s Biggest Mistake (2009) by chongli on Sunday September 13, 2020 @11:05AM (#24461301)
I’m pretty sure they’re a native speaker of Greek, given their name on GitHub.
Re:C’s Biggest Mistake (2009) by extempore on Sunday September 13, 2020 @10:39AM (#24461151)
He wasn’t being sarcastic.
Re:C’s Biggest Mistake (2009) by YeGoblynQueenne on Sunday September 13, 2020 @12:30PM (#24461950)
He, who? :)
Re:C’s Biggest Mistake (2009) by pjmlp on Sunday September 13, 2020 @02:36AM (#24458884)
Like C++ on Windows, Arduino, ARM mbed, macOS,...
Re:C’s Biggest Mistake (2009) by mytherin on Sunday September 13, 2020 @05:46AM (#24459671)
The same is likely true of Fortran, since Fortran code is shipped around with several Python data science libraries and included in R. Does that mean Fortran is a thriving language, or does it just mean Fortran was used a long time ago to write some important libraries that are now hard to get rid of?
Re:C’s Biggest Mistake (2009) by pjmlp on Sunday September 13, 2020 @07:06AM (#24460043)
Except Fortran 2018 is quite modern, supports modules, generics, and even OOP, first class support on CUDA alongside C++, whereas C18 hardly changed since C89 besides some cosmetic stuff and it is as secure as when it got used to rewrite UNIX in the early 70s.
Re:C’s Biggest Mistake (2009) by estebank on Sunday September 13, 2020 @01:18PM (#24462368)
It could be argued though that less usage means fewer stake holders to convince of the need for specific changes to the language, which helps with increased evolution. (I have only cursory knowledge of what's happening in C and none about what's happening in Pascal nowadays, just pointing out that being a smaller community might ironically help the language).
Re:C’s Biggest Mistake (2009) by munificent on Saturday September 12, 2020 @11:21PM (#24458009)
The relevant metric would be what fraction of hardware it's running on.
Re:C’s Biggest Mistake (2009) by konjin on Saturday September 12, 2020 @11:31PM (#24458056)
Literally all of it.
Re:C’s Biggest Mistake (2009) by raverbashing on Sunday September 13, 2020 @02:03AM (#24458760)
By number of new projects using it (without counting legacy code)

Nobody would do a project in C today with Go/Rust/C++ etc unless it's for a very specific situation

Re:C’s Biggest Mistake (2009) by the_hoser on Sunday September 13, 2020 @02:49AM (#24458933)
Careful with generalizations like that. You're forgetting the most important reason anyone uses a language:

It's the one they know.

A C programmer isn't automatically going to switch to Rust for new projects that they would use C for, unless their goal is to use Rust.

Re:C’s Biggest Mistake (2009) by tonyarkles on Sunday September 13, 2020 @07:37PM (#24464870)
Lol C programmer since 1994 here... just started a Rust project with the specific goal of learning Rust. The project itself is just to scratch my own itch. I’d honestly probably write it in Python if I didn’t want to see what Rust was all about :)
Re:C’s Biggest Mistake (2009) by baylessj on Monday September 14, 2020 @11:32AM (#24471358)
C is also used a lot in embedded environments where the hardware won't support languages with a larger footprint. Quite common in my line of work.
Re:C’s Biggest Mistake (2009) by ayende on Sunday September 13, 2020 @05:44AM (#24459659)
I started a project this year, I write it in C.
Re:C’s Biggest Mistake (2009) by sriku on Sunday September 13, 2020 @12:42AM (#24458425)
C doesn't "run on hardware" .. unless you're talking interpreted C. Of course compiled machine code is running on more hardware but that's just a truism.

The question is are people using C to program these hardware more? .. or are people gravitating towards safer compiled languages (Rust?). That's a valid question, even if the answer is "no C's usage is only increasing."

Re:C’s Biggest Mistake (2009) by saagarjha on Sunday September 13, 2020 @05:45AM (#24459667)
You’re being pedantic to the point of being actively misleading.
Re:C’s Biggest Mistake (2009) by rumanator on Saturday September 12, 2020 @06:54PM (#24456598)
C has been "losing ground" not because of random per peeves of those who never wrote a line of code in C but because since C's last standard update there have been other programming languages that offer developers something of value so that the trade-off between using C or any alternative starts to make technical sense.

It also helps that C's standardization proceeds in ways that feel somewhat between sabotage and utter neglect.

Meanwhile, C is still the absolute best binary interop language devised by mankind.

Re:C’s Biggest Mistake (2009) by ratww on Saturday September 12, 2020 @07:01PM (#24456654)
> C has been "losing ground" not because of random per peeves of those who never wrote a line of code in C

This is not a random pet peeve, and WalterBright is as far as you can get from someone "who never wrote a line of code in C". This is the cause of numerous security bugs in the past and currently, and the reason most C material written in the 70s/80s is unsafe to be used today (mostly due to usage of strlen/etc vs strnlen/etc).

Re:C’s Biggest Mistake (2009) by WalterBright on Saturday September 12, 2020 @08:11PM (#24457054)
Frankly I never would have made the proposal if I didn't love C. I've made proposals to add D features to C++, too.
Re:C’s Biggest Mistake (2009) by ratww on Saturday September 12, 2020 @10:06PM (#24457590)
A question: since your company also makes a C/C++ compiler (and the repo has very :), have you considered adding this addition to it, as an experimental feature, perhaps to demonstrate its usefulness to other developers and standard bodies? (Although, now that I think of it, D itself might serve the same purpose)
Re:C’s Biggest Mistake (2009) by WalterBright on Saturday September 12, 2020 @10:13PM (#24457620)
I don't see much point in it. I've proposed this change to C in front of several audiences, and it never received any traction. If you want to experiment with it, you can use DasBetterC, i.e. running the D compiler with the `-betterC` switch, which enables programs to be built requiring only the C Standard Library.

Fair warning - once you get accustomed to DasBetterC, you're not likely to want to go back to C :-)

Re:C’s Biggest Mistake (2009) by ratww on Saturday September 12, 2020 @10:39PM (#24457760)
> If you want to experiment with it, you can use DasBetterC, i.e. running the D compiler with the `-betterC`

I've been meaning to experiment with DasBetterC for a while, and I have a project C I've been wanting to migrate to something with proper strings (it's an converter for some binary file formats, but now I want it to import some obscure text formats too). Maybe that's the push I needed :)

After 20 minutes and about 250 out of 2098 lines converted, the error messages are very good and give very nice hints about what to change, I must say I prefer them to Rust's verbose messages.

Re:C’s Biggest Mistake (2009) by WalterBright on Sunday September 13, 2020 @12:10AM (#24458251)
Great!

DasBetterC's trial-by-fire was when I used it to convert DMD's backend from C to D.

I'm sure you already know this, but the trick to translating is to resist the urge to refactor and fix bugs while you're at it. Convert files one at a time, and after each run the test suite.

Only after it's all converted and passing the test suite can refactoring and bug fixing be considered.

Re:C’s Biggest Mistake (2009) by zestyping on Sunday September 13, 2020 @01:45AM (#24458684)
I don't get why it hasn't gotten traction. When I read it, it was immediately obvious to me that this would be extremely helpful. I want it yesterday, and so should everyone.
Re:C’s Biggest Mistake (2009) by boring_twenties on Saturday September 12, 2020 @07:07PM (#24456689)
Pro tip: Google the name of the person before responding to them, it can help avoid the taste of foot in your mouth which you are currently experiencing.
Re:C’s Biggest Mistake (2009) by msla on Sunday September 13, 2020 @01:00AM (#24458503)
> Google the name of the person before responding to them

Is it a rule at HN that you can't take someone else's name? Otherwise, there's no guarantee that you're talking to the "Real" Walter Bright...

... or that you're talking to that Walter Bright, come to think of it.

Re:C’s Biggest Mistake (2009) by WalterBright on Sunday September 13, 2020 @02:55AM (#24458961)
There can be only one.
Re:C’s Biggest Mistake (2009) by msla on Sunday September 13, 2020 @07:15PM (#24464744)
But The One doesn't get the username.
Re:C’s Biggest Mistake (2009) by sam_lynx on Sunday September 13, 2020 @02:51AM (#24458941)
I’m new here, so this seems like a valid criticism to me — but judging by the number of downvotes, it may not be. Can someone explain why this comment is incorrect?
Re:C’s Biggest Mistake (2009) by Stratoscope on Sunday September 13, 2020 @04:40AM (#24459393)
Perhaps because so many of know Walter from his work and his history here on HN? Sometimes you have to just trust that someone is who we all say they are.
Re:C’s Biggest Mistake (2009) by sam_lynx on Sunday September 13, 2020 @07:15PM (#24464745)
Cool, thanks for the explanation.
Re:C’s Biggest Mistake (2009) by fomine3 on Tuesday September 15, 2020 @08:41PM (#24488394)
It's fair argument but I also check karma point is high so it looks like legitimate account name in this case.
[dead]
Re:C’s Biggest Mistake (2009) by hannasanarion on Saturday September 12, 2020 @11:23PM (#24458015)
There's "arguments of authority" and then there's "accusing Walter Bright of having never written a line of code before".
Re:C’s Biggest Mistake (2009) by terr-dav on Sunday September 13, 2020 @03:50AM (#24459210)
AKA: Conflating authority with expertise
Re:C’s Biggest Mistake (2009) by boring_twenties on Sunday September 13, 2020 @11:05AM (#24461300)
What argument from authority is being made by anyone?

The GP decided, out of the blue, to accuse the author of never having written a line of C code in his life. That's kind of inappropriate in any context, IMO, but just downright laughable when the author is well-known for singlehandedly writing several compilers and a whole new language.

Re:C’s Biggest Mistake (2009) by datman347 on Saturday September 12, 2020 @08:42PM (#24457218)
Anyone that has to rely on their name for an argument isn't worth listening to.
Re:C’s Biggest Mistake (2009) by kortilla on Saturday September 12, 2020 @09:16PM (#24457365)
You misunderstand what the conversation is that’s occurring. The parent implied the person had never written C.
Re:C’s Biggest Mistake (2009) by datman347 on Saturday September 12, 2020 @09:21PM (#24457383)
He never said explicitly, he was just making a general statement. Not that it matters whether he did or didn't, there's a lot of things wrong with C, it will most likely eventually disappear, but not for reasons outlined in this article. That's what he was saying.
Re:C’s Biggest Mistake (2009) by sam_lynx on Sunday September 13, 2020 @02:46AM (#24458920)
Well, he dismissed Bright’s argument as a random pet peeve from people who haven’t written a line of code in C before, so yes, I do think he said it explicitly.
Re:C’s Biggest Mistake (2009) by genocidicbunny on Sunday September 13, 2020 @03:52AM (#24459221)
> Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.

This is one of HN's comment guidelines. If you're not sure that someone is who you think they are, you can just ask, e.g.: "Hey, are you Walter Bright who did X and Y?"

Re:C’s Biggest Mistake (2009) by sam_lynx on Sunday September 13, 2020 @07:17PM (#24464763)
? I’m confused how your comment relates to mine. Did you post on the wrong thread?
Re:C’s Biggest Mistake (2009) by leptons on Saturday September 12, 2020 @10:04PM (#24457584)
Someone once said COBOL would disappear.

C will still be used long after you and I and everyone here have returned to dust.

Re:C’s Biggest Mistake (2009) by xmprt on Saturday September 12, 2020 @10:34PM (#24457731)
Try becoming a COBOL developer and see how that works for you. Likening C to COBOL isn't doing it any favors.
Re:C’s Biggest Mistake (2009) by boring_twenties on Sunday September 13, 2020 @11:10AM (#24461336)
What's the implication here? I only know one COBOL developer but they seem to be doing quite well for themselves, making over $400k a year for something like 15 hours of work a week.
Re:C’s Biggest Mistake (2009) by estebank on Sunday September 13, 2020 @01:28PM (#24462454)
COBOL developers commanding a high salary is directly related to it not being a thriving language.
Re:C’s Biggest Mistake (2009) by jcelerier on Sunday September 13, 2020 @04:55AM (#24459465)
> C will still be used long after you and I and everyone here have returned to dust.

there are also people still riding horses. does not make it relevant in any way.

Re:C’s Biggest Mistake (2009) by shakow on Saturday September 12, 2020 @07:55PM (#24456959)
> Meanwhile, C is still the absolute best binary interop language devised by mankind.

You're mistaking the “C” ABI with the C language. The so-called C ABI should actually be called the UNIX-derived ABI, as (i) C doesn't define an ABI and (ii) C can perfectly produce binaries using another ABI (such as e.g. the “Pascal” one, common on the DOS platform).

Re:C’s Biggest Mistake (2009) by asveikau on Saturday September 12, 2020 @07:42PM (#24456891)
Maybe people are voting this down because they think it's directed at Walter Bright in particular, but I think there is actually some truth in the harsh comment.

Nothing about Walter Bright in this statement, but some of the harshest criticisms from others I have seen of C are not from expert practitioners in C.

People who are experts and also critics seem to have a more practical, realistic, nuanced critique, that understands history and challenges to adoption, admits that the long history and difficulty of replacing C isn't exactly for no reason.

Re:C’s Biggest Mistake (2009) by Gibbon1 on Sunday September 13, 2020 @12:42AM (#24458422)
That's the way I interpreted it because it's true. A lot of the criticisms are misdirected one by people that haven't used C except being forced to use it for few assignments in school, C++ jockeys that think C is the 30 year out of date version of C that's supported by C++, and people that haven't used it at all for anything real.

I also agree that what the standard committee has been doing for the last 20 years amounts to willful sabotage.

Re:C’s Biggest Mistake (2009) by pjmlp on Sunday September 13, 2020 @08:03AM (#24460266)
So what the improvements between C89 and C18 in regards to UB and security, for any ISO C compliant compiler?
Re:C’s Biggest Mistake (2009) by asveikau on Sunday September 13, 2020 @12:10PM (#24461771)
Between c89 and c18 is close to 30 years.

What about between c99 and c18? Is there anything you can think of? I think the _s() functions, advertised as security features, are a weak effort. Anything else come to mind?

Re:C’s Biggest Mistake (2009) by pjmlp on Sunday September 13, 2020 @12:43PM (#24462056)
Nothing really, if anything VLAs have proven such a mistake that Google lead an effort to remove all instances of VLA use out of the Linux kernel.

Also the amount of UB descriptions just increased and are now well over 200.

Annex K was badly managed, a weak effort as you say, given that pointer and size were still handled separately, and in the end instead of coming up with a better design with struct based handles, like sds, everything was dropped.

ISO C drafts are freely available, I recommend everyone that thinks that they know C out of some book, or have only read K&R book, to actually read them.

Re:C’s Biggest Mistake (2009) by will4274 on Sunday September 13, 2020 @02:09PM (#24462726)
> some of the harshest criticisms from others I have seen of C are not from expert practitioners in C.

But were they expert practitioners of C in the past? My experience is that most of the harshest criticisms of C come from former C experts who moved on to other languages because it became clear to them that C would never be fixed - Walter Bright included.

Re:C’s Biggest Mistake (2009) by WalterBright on Sunday September 13, 2020 @04:44PM (#24463816)
I also have extensive (20 years) experience with the solution I proposed.
Re:C’s Biggest Mistake (2009) by asveikau on Monday September 14, 2020 @06:29PM (#24475871)
Yes I know, and for clarity I appreciate your work and insight, and frequently enjoy your comments here.

My point was that people were mistaking the comment for an attack on you, which I don't think was necessarily intended or needs to be without it being a valid point about a different set of critics.

Re:C’s Biggest Mistake (2009) by chromatin on Saturday September 12, 2020 @07:01PM (#24456650)
Lol at “never wrote a line of code in C”. Surely you are not addressing the article’s author?
Re:C’s Biggest Mistake (2009) by teej on Saturday September 12, 2020 @06:32PM (#24456447)
C code is being replaced by Rust fast. The only limit is how quickly programmers can become good at Rust. It's already happening.
Re:C’s Biggest Mistake (2009) by johnisgood on Saturday September 12, 2020 @07:45PM (#24456916)
One of the niceties of C is that I can get anything done pretty damn quickly, without anything getting in my way. The syntax is extremely simple, too, vs. Rust. Rust is close to Perl when it comes to syntax; full of symbols. Too implicit for me. I want to look at the code, and I want to understand what the heck is going on, even if it is written by someone else. I usually do, with C. Rust? Not so much, and believe me, I tried. I would not like to call myself an idiot, either. :)

A viable C replacement is Ada, although it is not for people who dislike the "code is documentation" bit.

Re:C’s Biggest Mistake (2009) by leetcrew on Saturday September 12, 2020 @08:37PM (#24457196)
> One of the niceties of C is that I can get anything done pretty damn quickly, without anything getting in my way.

not saying you're necessarily wrong (c is definitely simpler than rust), but I think most people would write a similar comment for whatever language they feel most comfortable with. I write c++ most days. even though it's the most verbose and complicated language I've ever used, I can still probably get stuff done way faster than in another language I happen to pick up.

if I'm just throwing something together really fast, I do mostly use the old school C functions though. scanf is way nicer than streams.

Re:C’s Biggest Mistake (2009) by peterwwillis on Saturday September 12, 2020 @09:02PM (#24457303)
Agreed - in that I write it in Perl if I need it to just work right now. Perl is still, to me, the most useful programming language for completing a generic program in the smallest amount of time. (Part of that is due to CPAN, and part to the gazillion built-in features of Perl 5)
Re:C’s Biggest Mistake (2009) by jes on Sunday September 13, 2020 @02:17AM (#24458803)
I agree. I’m an older programmer (almost 61) and I’ve been using Perl for a long time - maybe 20 or 25 years. I reach for it when a job feels like a bit too much for a bash (1) script.

I don’t go out of my way to teach or suggest Perl to my younger colleagues. I don’t know why that is. They don’t usually reach for Python, which I think would probably be their best choice.

Maybe I’m just a curmudgeon ... and by the way, can you please stay off my lawn?

:)

Re:C’s Biggest Mistake (2009) by jkoudys on Saturday September 12, 2020 @10:51PM (#24457838)
One way rust's just a different tool for a different job, is it really doesn't optimize for knowing everything that's happening inside someone else's code. It's a great example of the difference in procedural vs functional programming, where in rust you mostly just care what your function args are and what it returns.

Nothing wrong with learning multiple languages, of course. C was my first professional language, and I spend most of my days in rust now. No shortage of rust devs who are big on C too.

Re:C’s Biggest Mistake (2009) by johnisgood on Saturday September 12, 2020 @11:07PM (#24457943)
Sure. I code in C, Go, OCaml, Ada/SPARK, Factor (Forth-like, Lisp-y), Common Lisp (rarely), and Erlang (moving to Elixir).

But I was responding to "C code is being replaced by Rust fast.".

Re:C’s Biggest Mistake (2009) by dnautics on Saturday September 12, 2020 @11:20PM (#24458001)
You might like zig. It's still pre 1.0, but I feel like it really has that "get out of your way" feel of C with a ton of safety. If you write tests, you can get tested memory safety, too.
Re:C’s Biggest Mistake (2009) by TeaDude on Sunday September 13, 2020 @07:52AM (#24460230)
Zig has a LOT of good stuff going for it but one of my pet peeves is how arsey the linter gets about formatting. No tabs (They might begrudgingly fix that one), no multiline comment/string support (and before anyone tries to correct me on the strings front, you look at that syntax and tell me it isn't an intentional joke), you must use these specific line endings (That one was actually fixed in master recently iirc)

The syntax is also currently REALLY unstable. As in: The hello world has changed almost every major version. Hopefully that too will be squashed with 1.0

To be fair though, Zig is probably the lest egregious and most flexible of the modern "C killers". I can see it's really trying to innovate low level programming. I really like it's flexible malloc systems and support for dynamic linking at runtime. It's compile time code execution is excellent too. The fact that they're actually trying to support obscure platforms like the z80 is a good indicator that they're staying true to C's "code anywhere" mantra. That's why I'm mostly focusing on linting issues of all things.

Re:C’s Biggest Mistake (2009) by jkoudys on Sunday September 13, 2020 @09:55PM (#24465951)
Ah. If anything, the whole "rust as better than C for everything" thing is starting to hurt its reputation, regardless of veracity. People get so focused on its use in perf-critical applications they ignore its other strengths. eg I've never replaced C code with it, but we redid our whole PHP backend as a rust app, because it's great for rigidly defined business rules too.
Re:C’s Biggest Mistake (2009) by jkoudys on Sunday September 13, 2020 @09:54PM (#24465944)
Ah. If anything, the whole "rust as better than C for everything" thing is starting to hurt its reputation, regardless of veracity. People get so focused on its use in perf-critical applications they ignore its other strengths. eg I've never replaced C code with it, but we redid our whole PHP backend as a rust app.
Re:C’s Biggest Mistake (2009) by diegocg on Saturday September 12, 2020 @08:09PM (#24457043)
Young programmers seem to prefer learning Rust than C. Generational replacement will take care of making Rust prevalent, no matter what existing programmers think.
Re:C’s Biggest Mistake (2009) by saagarjha on Saturday September 12, 2020 @10:31PM (#24457715)
Do they? Or are they just told that they should be using Rust? Even putting aside outdated curriculum, Rust is a fairly involved language to teach to a new programmer.
Re:C’s Biggest Mistake (2009) by johnisgood on Saturday September 12, 2020 @11:10PM (#24457962)
Indeed. What languages are most common in universities anyways? Haskell? Java? C++? OCaml? Which ones are the most common?

Maybe he meant outside of the education system. I think the reason for that would be hype and peer pressure, and the feeling of novelty, with a hint of FOMO. I do not see any languages being pushed/hyped as hard as Rust.

Re:C’s Biggest Mistake (2009) by souprock on Sunday September 13, 2020 @01:53AM (#24458715)
I investigated this in Florida. I checked Florida Tech, Embry-Riddle, and a half dozen state universities. One was Java, two or three were C++ (really C with cout and maybe vector), and all the rest were plain C.

That is a mighty good showing for C.

Re:C’s Biggest Mistake (2009) by mslm on Sunday September 13, 2020 @04:11AM (#24459312)
I can't imagine universities actually caring to teach new programmers Rust... it's an overly complex language that most professors themselves would steer far away from because they know there's more to programming than following trends.

(We learned C++ in university in New York which was basically C with occasional help from C++'s standard library).

Re:C’s Biggest Mistake (2009) by saagarjha on Sunday September 13, 2020 @05:50AM (#24459691)
Sadly the latter is often how C++ is taught even though it is not at all how modern C++ is used…
Re:C’s Biggest Mistake (2009) by Gene_Parmesan on Sunday September 13, 2020 @05:51AM (#24459692)
My much younger brother is currently enrolled at a a major university in comp sci. His coursework is primarily in Java but with certain classes in C and other languages.
Re:C’s Biggest Mistake (2009) by saagarjha on Sunday September 13, 2020 @05:49AM (#24459685)
My guess is that those four see more use than Rust does, with Java and C++ forming the base of a typical undergraduate curriculum alongside Python and C and Haskell and OCaml showing up in classes where the concepts behind them are typically introduced. (FWIW: my college experience was C++, C, Scala for the required courses.)
Re:C’s Biggest Mistake (2009) by johnisgood on Saturday September 12, 2020 @08:21PM (#24457124)
I believe we will come back to C eventually. Kind of irrelevant but: I learnt C by writing mods for ioquake3 forks. :) Fun times. I was about 13 years old.
Re:C’s Biggest Mistake (2009) by otabdeveloper4 on Sunday September 13, 2020 @04:43AM (#24459409)
Lol.

For every young programmer learning Rust there are probably 10000 learning C.

C is still the only language you can count on anyone with a programming-related education to have knowledge of. (That doesn't translate into being able to program is C, but still.)

Re:C’s Biggest Mistake (2009) by viraptor on Saturday September 12, 2020 @06:39PM (#24456500)
I love the move to d/rust/zig/nim/... but there are other issues too. Ecosystem of libraries, stabilisation of common patterns (futures and Tokio issues are still out there), platform compatibilities, industry support for moving away from known solutions, and many other issues. Even if we all suddenly knew Rust perfectly tomorrow, there are other issues in the way.
Re:C’s Biggest Mistake (2009) by jkoudys on Saturday September 12, 2020 @10:56PM (#24457871)
futures is definitely the big one for me. Getting all concurrency fully on async/awaits is amazing, e.g. actix-web awaiting an endpoint calling juniper for graphql, with async resolver methods making async calls against my DB, without needing to spawn a single thread, is lovely. Still doesn't work as smoothly as that, even though on paper it ought to. Getting close though.
Re:C’s Biggest Mistake (2009) by nordsieck on Saturday September 12, 2020 @07:25PM (#24456787)
> C code is being replaced by Rust fast.

One of the key areas C is used that Rust cannot be used easily is in limited embedded devices. That looks like it'll be the case for at least 10 years and probably much longer than that.

Re:C’s Biggest Mistake (2009) by sam_bristow on Saturday September 12, 2020 @08:32PM (#24457174)
The embedded Rust ecosystem is actually pretty vibrant these days. The number and quality of #![no_std] crates is improving rapidly.

The main limitation is going to be if your MCU is supported by LLVM. If you're targetting ARM, RISC-V, MSP430 or Xtensa you might get further than you'd expect.

There's a hell of a lot of tooling built around C though. So nomatter what happens I don't think we'll ever be rid of it.

Re:C’s Biggest Mistake (2009) by rleigh on Sunday September 13, 2020 @09:43AM (#24460789)
Many, if not most, small MCUs can also run C++ these days as just as well as C. If you want to write simpler and more robust applications, it's easily achievable.
Re:C’s Biggest Mistake (2009) by FpUser on Saturday September 12, 2020 @07:45PM (#24456911)
I used to write whole bunch of firmware for microcontrollers and frankly C was doing just fine for me in this area.
Re:C’s Biggest Mistake (2009) by baybal2 on Saturday September 12, 2020 @09:24PM (#24457398)
> C code is being replaced by Rust fast. The only limit is how quickly programmers can become good at Rust. It's already happening.

I think Rust has been very quickly fading into obscurity. What Rust hast brought to the tables was nearly the same what was brought by 100+ other programming languages in attempts to "fix C."

Re:C’s Biggest Mistake (2009) by IshKebab on Sunday September 13, 2020 @04:42AM (#24459403)
Oh... can you show me those 100+ other languages that have opt-out memory safety, explicit lifetime annotation, a borrow checker and no runtime?
Re:C’s Biggest Mistake (2009) by pjmlp on Sunday September 13, 2020 @08:06AM (#24460281)
Cyclone, ATS, Checked C, Ada/SPARK.
Re:C’s Biggest Mistake (2009) by 59nadir on Monday September 14, 2020 @03:12AM (#24467643)
Footnote: With Ada/SPARK being much more battle-tested and ATS being a much more flexible & complete solution. Though I wouldn't exactly recommend ATS in terms of learning curve.
Re:C’s Biggest Mistake (2009) by saagarjha on Sunday September 13, 2020 @05:52AM (#24459699)
That’s an extremely specific reading of the claim “fix C” that excludes almost everything but Rust.
Re:C’s Biggest Mistake (2009) by IshKebab on Monday September 14, 2020 @07:47AM (#24469032)
I never said those are the only ways to fix C. Try reading the argument again:

> What Rust hast brought to the tables was nearly the same what was brought by 100+ other programming languages in attempts to "fix C."

> Oh... can you show me those 100+ other languages that have opt-out memory safety, explicit lifetime annotation, a borrow checker and no runtime?

Maybe I can make it even clearer:

> What Rust has brought to the tables was nearly the same as 100+ other languages

> Oh... can you show me those 100+ other languages that have (some unique Rust features)

Re:C’s Biggest Mistake (2009) by konjin on Saturday September 12, 2020 @09:58PM (#24457559)
It isn't. You can tell how much a language is used by the inverse of the number of blogposts about it. People who have jobs don't have the time to write about how they would solve problems using that language, because they already are and have better things to do in their free time.
Re:C’s Biggest Mistake (2009) by IshKebab on Sunday September 13, 2020 @04:39AM (#24459387)
It is. Since 2012 C has dropped from about 4% of Github code to 3%. Meanwhile Rust has climbed from 0 to about 1%. That on its own doesn't prove that people are moving from C to Rust but it's not a risky guess. I did see some data on language transitions a while ago but can't find it now unfortunately (why is browser history search still so shit?).

https://madnight.github.io/githut/#/pull_requests/2020/2

Re:C’s Biggest Mistake (2009) by noisem4ker on Sunday September 13, 2020 @09:35AM (#24460746)
>(why is browser history search still so shit?)

Because Google wants people to search using the Google search engine, and see ads while they're at it. That would happen less often if Chrome were properly capable of searching the history.

Opera did full text history search a decade ago, but that browser doesn't exist anymore.

Also, history is expected not to be tied to the device in the cloud era. What more history data could you scalably sync other than URLs and page titles?

Re:C’s Biggest Mistake (2009) by noisy_boy on Saturday September 12, 2020 @11:52PM (#24458168)
Number of blogposts about Python is a counter-argument.
Re:C’s Biggest Mistake (2009) by konjin on Sunday September 13, 2020 @06:00PM (#24464291)
The number of people employed as python programmers is vastly smaller than the number of people who can write hello world in python, which is what the majority of blog-spam is about.
Re:C’s Biggest Mistake (2009) by shaklee3 on Sunday September 13, 2020 @11:57AM (#24461651)
There's a lot of truth in it, but for a slightly different reason. Almost everyone I work with knows or writes C regularly. They're usually very senior people, and not once have I ever heard them talk about a blog, let alone write one. so there is this large group of C practitioners out there that simply don't know or care about all these other things happening around them. To some degree, it doesn't matter since there are plenty of jobs doing this.