TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Death to C

39 pointsby simasabout 10 years ago

21 comments

vezzy-fnordabout 10 years ago
I think what a lot of people don&#x27;t realize is that, at least if you&#x27;re writing Unix userspace code that mostly interacts with POSIX and&#x2F;or kernel-specific interfaces, C remains the most convenient because the API&#x2F;ABI standards are all designed with C semantics in mind, and a lot of wrapper&#x2F;binding libraries in other languages are either too clunky or too abstracted, unless you decide to roll your own... and depending on the language, FFIs can be quite a nuisance.<p>The only languages so far that seem to have really gotten this are Go... and OCaml, to some extent (see the &quot;Unix system programming in OCaml&quot; document). Go in particular bypasses libc entirely by directly using the syscall interface, from what I recall.
评论 #9478124 未加载
jblowabout 10 years ago
The problems described are accurate. From a modern standpoint, C and C++ are terrible. The only problem is that most new languages are more terrible along other axes, making them unusable for what C and C++ get used for.<p>The author is accurate that Rust may be a substantial improvement.<p>I don&#x27;t necessarily want to program in Rust, which is why I am designing my own alternative, but I think if you are building safety-critical software than something Rust-like is a pretty good idea.<p>For my own experiments I am going more in the direction of giving the programmer auditing power, rather than just having the programmer have to silently worry about what code may or may not be doing.
ColinWrightabout 10 years ago
Extensive discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9477006" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9477006</a><p>Nice to see all the same arguments from just 4 hours ago being repeated again here.
Yetanfouabout 10 years ago
I&#x27;m almost tempted to pull out the old adage &quot;if you can&#x27;t stand the heat, get out of the kitchen&quot;. Yes, the C family of languages allows you to do many terrible things. It also allows you to do many great things. It is up to the programmer to decide what path to choose.<p>While the appropriate territory for the C family has decreased with the increase in processing capacity, there are still many areas where these languages are the right tool for the job. When another language family finally arises which offers the flexibility, conciseness and low-level access which characterises C (and its siblings, to a lesser extent) it&#x27;ll be welcomed as a saviour, until that time they&#x27;re the right time for the job.
ddingusabout 10 years ago
Not gonna happen.<p>We need close to the metal tools for a whole pile of things, and that&#x27;s not going to change.<p>If anything, tools to help write C, or find errors, test, etc... are the more likely path.<p>That said, we could reduce the number of use cases for C now, and not lose too much, but that&#x27;s not going to be the death of it by any means. More like a rational pruning.
评论 #9478048 未加载
评论 #9477985 未加载
lukaslalinskyabout 10 years ago
Every time I look at it, I have a very hard time taking Rust seriously. I really don&#x27;t get whoever decided to use the shortest keyword names possible. It looks like a nice alternative to C, but wrapped in a horrible syntax. fn, f64, i32, u8, mut, mod, pub, ...
评论 #9478091 未加载
TYPE_FASTERabout 10 years ago
&gt; Can we stop hand-writing parsing code in C please?<p>I think that tweet is more about using Lex or Yacc instead of hand-coding logic to parse strings.
评论 #9478084 未加载
bla2about 10 years ago
C tooling is much better these days. If you run your code under valgrind or address sanitizer with a good fuzzer, most of these concerns go away. True, you might not need that for a memory-safe language, but you probably still need to fuzz your parsing code if you want it to be any good. And enabling address sanitizer requires adding one flag, so it&#x27;s not all that much harder.<p>Hm, this arguments sounds similar to the &quot;you need to write tests with good coverage anyway&quot; argument that fans of dynamically typed languages make when they&#x27;re told that static typing catches many errors at compile time :-)
warrenmillerabout 10 years ago
Who writes this crap?
评论 #9478003 未加载
评论 #9478043 未加载
raverbashingabout 10 years ago
Problem is: C, while very powerful, ends up being a burden in today&#x27;s complex software.<p>It won by being less verbose and &quot;more powerful&quot; (for some uses) than Pascal (amongst other things), however, the way software evolved it starts to pull down.<p>There&#x27;s a lot of unmanaged complexity in C (and in C++ it just ballooned); things like Go, Python (and even Java) taught us that managing complexity is important<p>It&#x27;s very easy to shoot itself in the foot in C, C++ gives you a laser scope on top.<p>Some software gets away with C (like the Linux Kernel) by being very careful with it.<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;id_aa_carmack&#x2F;status&#x2F;329210881898606593" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;id_aa_carmack&#x2F;status&#x2F;329210881898606593</a><p>Can C be salvaged? Maybe D is the answer?<p>What I would do: built-in strings into the language (C&#x27;s strings are pretty much a syntax shortcut to a char array), safe strings, bounds checking, if you want an array of bytes you get an array of bytes, not a string. Type aware allocations (no more sizeof all around), maybe exceptions.
评论 #9478211 未加载
jjawssdabout 10 years ago
Blah blah blah. Another batch of anti-C&#x2F;C++ propaganda by a technologically illiterate ignoramus. If C&#x2F;C++ are too difficult for you then stay out of the way and use Ruby.
Roboprogabout 10 years ago
C! Made in AMERICA! (F--K YEAH!)<p>We can&#x27;t be using any of those sissy languages made in Switzerland!<p>The real tragedy is that [Turbo] Pascal &#x2F; Modula &#x2F; Oberon &#x2F; Eiffel never got any traction. We could have been ahead of where we are now for low &#x2F; medium low level languages DECADES ago.<p>E.g. - Turbo Pascal:<p>* Checks array boundaries, but you can cobble up pointer arithmetic if you really need to squeeze something (it looks funny, as it <i>should</i>, but it converts into the same assembly code as ptr += size ; <i>ptr)<p></i> references (&quot;var&quot; params) used safely as non-optional values in most cases, using pointers for parameters that are truly optional.<p>* much stricter type checking and type range restriction allowed - most of which is only paid for at compile time, rather than run time.<p>* faster compiles, allowing quicker test cycles.<p>I suppose Ada fits in this group as well, but it was expensive in the late 80s.<p>Modern GC languages do well for long running application server programs, but they don&#x27;t make good &quot;transient&quot; utility programs. We still need lower level languages for some types of programs.<p>Mobile could benefit from smaller memory footprints as well. I&#x27;m &quot;gaming the game&quot;, but here are some tests on a 32 bit quad core setup, sorting by memory used for something that grinds through a number of connected objects as a surrogate for bulk data twiddling:<p><a href="http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u32q&#x2F;performance.php?test=binarytrees&amp;sort=kb" rel="nofollow">http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u32q&#x2F;performance.php...</a><p>Alas, the Pascal version used 3 times the CPU seconds that the (fastest, but 2x more memory) GCC version did. However, a lot of work has been thrown into tuning GCC. Also, there were 6 C&#x2F;GCC solutions submitted for this problem, of which 3 were not even correct. Of the other 2 C attempts, one was about the same size and speed as the Pascal version, and the other was twice as big and three times as slow.
评论 #9478297 未加载
gcb0about 10 years ago
inflammatory post. but it&#x27;s techcrutch so what was i expecting?<p>this is the same as saying &quot;armed concrete buildings fail more often then buildings made of paper and bamboo&quot; while completely ignoring that all the world around them not even being possible without talented people building the armed concrete structures around the ego of whoever wrote this.
trhwayabout 10 years ago
Yes, blame the language.
评论 #9477989 未加载
评论 #9477956 未加载
评论 #9478233 未加载
ExpiredLinkabout 10 years ago
&gt;&gt; <i>…Which is why I’m so interested in Rust. It’s the one new programming language that might, finally, at last, replace C and C++ </i><p>Oh, I see ...
fndrplayer13about 10 years ago
All very true, I just think its still a little early to recommend Rust, personally.
halayliabout 10 years ago
The ignorance in this article is way too high.
divs1210about 10 years ago
I think the only way to end C is to port Linux to Rust&#x2F;Nim&#x2F;Julia&#x2F;Scheme&#x2F;etc.
astnabout 10 years ago
Ada.
prhtabout 10 years ago
what a load of tosh
tritiumabout 10 years ago
Pathetic human frailty has nothing to do with the validity of syntax. The machines will do as we say, for the most part.<p>Don&#x27;t be an ass, and don&#x27;t whine about bullshit like extra curly braces and semi-colons. Know your memory map. Get your shit together.
评论 #9478062 未加载