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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Criticizing the Rust Language, and Why C/C++ Will Never Die (2015)

41 点作者 federicoponzi将近 9 年前

14 条评论

naasking将近 9 年前
It&#x27;s interesting that his own points argue against his own conclusion. For instance, &quot;I can&#x27;t but remind you for one more time that the source of troubles is usually in humans, not technology&quot;, doesn&#x27;t jive with the conclusion that C&#x2F;C++ are here to stay, nor does it agree with his point that he was annoyed with the restrictions Rust placed on him.<p>If humans are the problem, then a language that restricts these problematic human urges in a way that maximizes safety and extensibility is an important solution. C&#x2F;C++ does only one of these, and not very well either. Any solution that strikes a better balance will replace C&#x2F;C++ eventually, and I think Rust is on the right track.
评论 #12232848 未加载
kibwen将近 9 年前
As I remarked when this article originally came out last year, there&#x27;s a certain delicious irony in a hit piece on Rust coming from a company that makes its money writing static analysis tools to try and plug the safety holes in C++. :P
评论 #12233612 未加载
wyldfire将近 9 年前
&gt; take, for instance, the inevitable &quot;stop the world&quot; issue during garbage collection. ... Rust is safe indeed but, unfortunately, far from fast. By the moment of writing this article, it is comparable to Java, Go, and Haskell regarding performance<p>...and then he goes on to show a boxplot graph of (likely) CPU-bound benchmarks. C++ pays a penalty (~1.7x?) and so does Rust (~2.5x).<p>Well, who cares about CPU?! Yes, okay, lots of you. But if you really care, you rewrite that inner loop of your C++ system in C. And if you really, really, care, you rewrite that inner loop in assembly (or corresponding intrinsics). So, hey, here&#x27;s what I care about: latency! Many systems designed in C&#x2F;C++ are thus because until recently it was just about the only game in town for predictable low latencies (refer to the &quot;stop the world GC&quot; paragraph above).<p>Also, there&#x27;s no other language out there offering both memory safety and the ability to do things like I&#x2F;O and system control with memory-mapped registers.<p>Linking your rust code against C libraries and executables is not-super-painful. So phase-in of rust code is easier than other languages described.<p>&gt; On the one hand, it&#x27;s not bad to make programmers ponder if their variables are stored in the stack or heap and if they can or cannot be handled by several threads at a time.<p>Indeed! All the C&#x2F;C++ static checkers in the world can only hint &quot;Hey this might not be safe, but WTF I have no idea...&quot; only to be declared [FALSE_POSITIVE, IGNORE].<p>BTW authors of static checkers (like the translators at PVS-Studio) have a vested interest in unsafe languages like C&#x2F;C++.
评论 #12235297 未加载
评论 #12233574 未加载
Cshelton将近 9 年前
It&#x27;s hard to follow this author&#x27;s arguments because so many of them are simply wrong and off base.<p>I&#x27;ve used Rust since 1.0 stable release, I have yet to write a piece of unsafe code. Almost all of my code has run at speeds similar to C&#x2F;C++. If something in Rust is slow, then it is a bug. Of which the Rust contributors are very good at getting rid of. The new MIR stuff will change a lot.<p>This guy also makes many blunt assumptions on what other programmers will do. He says no sane programmer will write a webserver&#x2F;service in Rust. Uhhh.. yes they will and do. When they need to benefits that the Rust lang comes with, they will&#x2F;do already.<p>This guy clearly doesn&#x27;t like Rust, which is fine. Most programmers have a language they really dislike that is popular. Nothing wrong with that.<p>As for &quot;replacing&quot; C&#x2F;C++, no, in the near future it won&#x27;t It may never. But the fact of the matter is old programmers will....grow older, retire and be gone. Young programmers just getting started in their career&#x2F;education will look at the ecosystem of tools available to them and make their own choices on what to use. Which in turn has the potential to make C&#x2F;C++ go the way of COBAL. Rust isn&#x27;t the only language either. Many new languages will arise in the next few decades that will completely displace some of the most popular languages now. That&#x27;s how it is. I frankly do no see C++ being used for new programs 20 years from now. Unless it is a new subset of C++ that does not resemble anything like C++ today...which for that matter...is a new language.<p>Sure, C&#x2F;C++ programs will be around for at least a few decades. But will anyone new program in them? Highly doubtful. Rust is just one of the first displacing languages. And this is not a bad thing. We SHOULD rewrite many of the things that we heavily rely on. They have to evolve and not be tied down to something written decades past. System kernels will be re-written. Linux itself, eventually, will effectively be re-written. (Yes...it will take a while, may be something else, not called Linux...Redox perhaps?)<p>If it were up to this author, all language developers would only be working to make C++&#x2F;C faster&#x2F;safer.(The author calling C++ &quot;safe&quot; is laughable, he even counters his own argument elsewhere in the article about humans being the weak point. ) No. We have to reject that. Just as Henry Ford said, &quot;If I asked people what they wanted, they would say &#x27;faster horses&#x27;&quot;.
评论 #12233236 未加载
nickpsecurity将近 9 年前
I&#x27;m not upvoting this toward the front page because, although the writer makes some smart observations, the piece largely doesn&#x27;t apply to Rust due to key misconception:<p>&quot;You know, it&#x27;s like the &quot;Chicken or the Egg&quot; dilemma. On very rare occasions, this problem does get resolved (relatively representative examples are Go and Scala) - mostly thanks to investments of time and money from some large company (Google, Typesafe) who for some reason finds it worthy to popularize a new language.&quot;<p>Which is exactly what happened with Rust. A large company put significant resources into language, compiler, libraries, and community. Already meant his write-up didn&#x27;t apply to Rust if that was a precondition of its truth. It then of exploded in usage and available code. It was also deployed at Dropbox for mission-critical apps. So, many things he says it will need to prove something are already there. Amazing thing is the article from 2015 was disproven by Rust ecosystem by 2016.
评论 #12232812 未加载
评论 #12232661 未加载
评论 #12232733 未加载
greydius将近 9 年前
C and C++ will eventually die in the same way that COBOL has died. That is, they&#x27;ll never go away, but there will be fewer and fewer people able and willing to use them.
评论 #12232789 未加载
评论 #12232902 未加载
dcu将近 9 年前
So Rust has started to receive criticism which means it&#x27;s becoming popular. As the creator of c++ says:<p><pre><code> &quot;There are only two kinds of languages: the ones people complain about and the ones nobody uses.&quot;</code></pre>
评论 #12233148 未加载
评论 #12233331 未加载
sickbeard将近 9 年前
I always chalked it up to the &quot;I&#x27;m old&quot; sentiment. There hasn&#x27;t been a language that has actually caused us to think of writing a different kind of software. Sure we write nicer easier code but the software remains the same in the end, buggy, full of problems and not maintainable. These are the problems we should be solving.. the result of what WE code, not how pretty it looks in the ide.
zaphar将近 9 年前
He considers Racer to be insignificant. And while It&#x27;s true that it doesn&#x27;t yet do everything an IDE usually does it&#x27;s also true that Racer is exactly the path that Languages should be taking in the future. Locking all of that logic up in an IDE in ways that it can&#x27;t be factored back out makes automated refactoring and analysis tools harder to build.<p>It locks people into editors they may prefer not to use and just generally splits your user base up in ways that are unnecessary.<p>Providing a build your own IDE api is a superior approach that more and more languages are moving over to.
评论 #12233157 未加载
legulere将近 9 年前
&gt; Wikipedia tells us that there were a lot of other attempts besides D to kill C++ - for example Vala, Cyclone, Limbo, BitC.<p>Vala pretty much is a DSL for writing GTK+ programs. Cyclone is a safe dialect of C. Both don&#x27;t really have anything to do with C++.
lmm将近 9 年前
&gt; Note: Further in this text, I am presuming that Rust is a conscious attempt to create a fast and safe language. After all, it was initially conceived by the guys from Mozilla as a tool to develop a browser engine. But if it proves to be yet another just safe language, then I just don&#x27;t get the whole thing. There is plenty of very different safe languages to choose from to any taste, and if Rust is not meant to replace C++, then (1) why does it need to include an unsafe subset?; and (2) why did the authors throw away lightweight processes from Rust? They are convenient, after all, aren&#x27;t they? In other words, if I&#x27;m wrong in my assumption, then the whole affair just doesn&#x27;t seem to make any sense at all.<p>&gt; I sincerely hope that programmers will find a way to speed it up in time, but until then, it&#x27;s going to be of hardly more interest than Scala or Go from the viewpoint of the safety&#x2F;speed compromise. The question is still open if it is possible at all to make a language both fast and safe or if it is automatically doomed to be twice slower than C&#x2F;C++ because of the constant checks for array overruns, safe wraps of bindings to C-libraries, and other stuff like that.<p>If it ends up being a factor of 2 slower than C I really don&#x27;t think that matters. The point isn&#x27;t to be faster than Ada&#x2F;Go&#x2F;Scala&#x2F;Java&#x2F;Haskell&#x2F;OCaml, it&#x27;s to be as safe as those without GC - primarily for the sake of using it in a Javascript runtime and not having to run two GCs.<p>&gt; Anyway, in any serious project, you use a continuous integration system and run tons of tests when compiling builds. If you don&#x27;t, then your troubles are much worse than the language&#x27;s lack of safety because static typing doesn&#x27;t guarantee correct execution logic!<p>Guarantees are absolutely possible. Most practical programs don&#x27;t guarantee everything in the type system, but test suites don&#x27;t guarantee everything either. For a practical program where you have a certain acceptable defect rate, it&#x27;s not at all clear that a large test suite will be a cheaper way to achieve that than a type system, and my experience is in fact the opposite.<p>&gt; Following its logic, we could rewrite 90% of WebKit or VirtualBox or GCC into Java and get the same result. But it is obviously wrong.<p>Not at all obvious - I suspect not in fact wrong at all.<p>&gt; Well, it depends on the project scale. For Google, even a few percent may help save millions of dollars (see Section 5, &quot;Utilization&quot;, in the paper). Or imagine that with a next update, JVM will suddenly start requiring 10% more resources!<p>So maybe C++ is worth using at Google. Most of us aren&#x27;t Google.<p>&gt; But if we want to follow it word for word, why not use bubble sort instead of quicksort in all of the code?<p>Go ahead. See if I care. See if you care. 99% of the time, bubblesort really isn&#x27;t a problem. (Not using library functions is a problem, so in practice this would never come up, but it really isn&#x27;t a performance problem if you do end up using bubblesort)<p>&gt; After all, who will dare to argue that finding a hot spot, rewriting the code (perhaps tons of it) and proving it has become really faster is an easier job than think about performance in advance?<p>What are you talking about? That is absolutely a lot easier. Needing to rewrite tons is extremely rare, at least in a well- or even moderately-structured program.<p>&gt; So, to sum it up, personally I will be investing my time into studying C&#x2F;C++ rather than Rust in the next 5 or so years. C++ is an industrial standard. Programmers have been using it to solve a huge variety of tasks for over 30 years now. As for Rust and stuff like that - they are just odd toys with vague future. People have been predicting C++&#x27;s soon death since the 2000-s, but C&#x2F;C++ hasn&#x27;t become less used and demanded for since then. Quite on the contrary, in fact. It is evolving (C ++11, C++14), new tools are released (take CLion and Clang, for example), and the number of vacancies is just huge.<p>If you believe the future looks like the past then sure. Personally I think the Internet will become both more vital and more hostile: the security requirements of a web browser are a canary for things that will become requirements for every program in 5 or 10 years&#x27; time. Mozilla started Rust because they couldn&#x27;t write a safe enough browser in C++. That should be a warning to anyone who wants to continue using the language.
评论 #12233660 未加载
GreaterFool将近 9 年前
What is dead may never die!<p>(sorry, couldn&#x27;t help myself :P)
评论 #12233468 未加载
rkangel将近 9 年前
This title needs editing with a [2015] tag.<p>The original was written in April last year and some of the things it talks about are out of date.
评论 #12232836 未加载
jbb555将近 9 年前
Rust isn&#x27;t a proper systems language, it restricts how you can access the machine in the name is spurious &quot;safety&quot;. A small number of people are making a lot of noise about it, but it&#x27;s not going anywhere.
评论 #12233160 未加载
评论 #12233323 未加载
评论 #12233049 未加载