TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Will the C programming language really die?

5 点作者 sanosuke大约 10 年前
There is too much talking about Rust programming language and it&#x27;s great that research on this topic is vibrant.<p>My question.<p>Will the C programming language really die? Meaning, stop being used as a System programming Language or in the Embedded Systems field.<p>It is still worth to invest some time digging these topics with the C programming language?<p>Newbie here, don&#x27;t be rude.

7 条评论

cyber1大约 10 年前
Read this - <a href="http:&#x2F;&#x2F;blog.biicode.com&#x2F;cpp-will-never-die&#x2F;" rel="nofollow">http:&#x2F;&#x2F;blog.biicode.com&#x2F;cpp-will-never-die&#x2F;</a>. And I think C will never die! But it&#x27;s very interesting to known Linus Torvalds&#x27;s opinion about Rust and the future of system programming languages.
paulrpotts大约 10 年前
Well, it&#x27;s an interesting question!<p>I started learning C almost 30 years ago and while I have learned a lot of other languages: C++, Java, Scheme, Dylan, NewtonScript, Visual BASIC, some Haskell, a little Forth, various assembly languages... recently I received training in LabView.<p>I keep winding up using C again. I spent today writing C code that runs on an embedded board. Simple code, really, running on an embedded processor with very little RAM. There&#x27;s still a need for this. I have most of modern C++ available on this platform. It is technically C++, but I&#x27;m not using any classes or templates, so it looks for the most part very much like C99.<p>As someone who is well-acquainted with C&#x27;s weaknesses as well as strengths, I would honestly like it if I could migrate all my work to something else. I really like functional languages and I really like strict type safety. I am looking forward to using Haskell on embedded systems and think it will have a niche there. I&#x27;m looking forward to expressing embedded state machines in FRP (functional-reactive). However, these things are still relatively limited and experimental. As for Rust and Go, etc., it&#x27;s still a chicken-and-egg thing, I think. And I&#x27;m not sure they are really suited for _small_ chips -- what&#x27;s the minimal runtime? Can you get rid of all garbage collection at runtime? And remember that practical issues of tooling are _huge_. They tend to swamp theoretical elegance and even sometimes efficiency by a large margin.<p>So, I guess the answer is &quot;I don&#x27;t know.&quot; C still has a niche. At some point it may truly be unnecessary. As to whether it is worth studying or investing your time understanding, I would say the answer is almost certainly yes. The C runtime model is still the dominant one; C is still the language used to build most of the tools that other languages are built on. If you need to understand what is going on at the low level, just above assembly language, and programmers still do, they still need to understand C.
Blackthorn大约 10 年前
There&#x27;s still nothing that can actually replace C. I think that&#x27;s because of a combination of:<p>1) Being reasonably high level<p>2) Having asm() be usable at all. You can&#x27;t drop into asm with Go, as far as I&#x27;m aware. You can with Rust and C++, but the next point...<p>3) The ABI as commonly implemented is dead simple. I know how to call C from asm, and vice versa, without screwing everything up, having bizarre initialization and destruction to worry about, etc. C++ can&#x27;t claim that. I don&#x27;t think Rust can either.<p>C will live on until there&#x27;s an actually usable replacement. Right now, there isn&#x27;t.
评论 #9545189 未加载
ksherlock大约 10 年前
There&#x27;s a Japanese proverb: If you believe everything you read on hacker news, don&#x27;t read hacker news.<p>Let&#x27;s say rust fares better than go, c#, D, java, limbo, modula (-2, -3), oberon, pascal, etc. Programmers around the world race to convert all legacy C code to rust. C, C++ and Objective C are banned under international treaty and everyone suspected of leaking memory is rounded up and sent to coder bootcamps for re-education. Learning C is the second best (behind assembly) programming language to understand how your computer actually works.
breadbox大约 10 年前
It does feel that there has been a recent boom in new compiled languages (languages that compile to native code, I mean, instead of whatever virtual machine people currently think is hot). One or more of these might well wind up displacing C in the future. C is an elegant language but it suffers from not being able to learn from the lessons of the last 40 years.<p>Fortran is still in use after ~60 years, but it isn&#x27;t really being used for new applications, which seesm to be what you&#x27;re asking. It seems safe to assume that someday C will follow suit.
bnejad大约 10 年前
C is still absolutely standard and huge in both the fields you mentioned. Despite all the new system languages or whatever doesn&#x27;t change the fact that C dominates and will continue to dominate embedded development among other fields.<p>Anyone who claims C is dead likely is working in the Silicon Valley startup bubble. Sure, C isn&#x27;t going to get your far at mostly web based companies but every computing device you own most likely has C and assembly running the hardware bits and the underlying system.
aprdm大约 10 年前
Not in a hundred years, everything we use today is built on top of thousands of C code lines.