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.

Rust vs C Pitfalls

196 pointsby Anilm3over 8 years ago

10 comments

gravypodover 8 years ago
If you&#x27;re fighting, you&#x27;ve lost. The way to convert everyone to Rust you need to be better the the competition. Not just better as in &quot;look at my features that will make your code safer&quot;. People may see the value but think &quot;I get on just fine without the borrow checker so it isn&#x27;t <i>too</i> important&quot;. You need to be far better then the replacement by providing the following:<p><pre><code> * Great Tooling ( IDEs ) * Great Libraries ( Everything and a kitchen sink ) * Better Documentation </code></pre> Anything that can be done easily in C or C++ will need to be easier in Rust for everyone to move. No amount of language features will pull people who are doing well at their job, currently building everything they need to, and who maintain low level systems. You have to be able to entierly replace the old systems in a completely feature-complete way that&#x27;s also easy to migrate to.<p>Blog posts wont pull me away from C, tooling and docs will.
评论 #13268425 未加载
评论 #13268112 未加载
评论 #13266618 未加载
评论 #13266687 未加载
评论 #13266604 未加载
评论 #13269809 未加载
评论 #13266667 未加载
评论 #13266648 未加载
评论 #13268865 未加载
评论 #13267279 未加载
评论 #13266895 未加载
评论 #13266951 未加载
michaelmiorover 8 years ago
&gt; “Safe” code is guaranteed to be 100% safe. Not statistically safe. Not safe when the compiler feels like it. As long as your code compiles, it will be safe in terms of memory safety and data-race freedom.<p>As far as I am aware, the Rust compiler has not been proved correct. So whether or not your code is correct still depends on the correctness of the compiler. Of course this is probably correct, but still not 100% guaranteed.<p>Edit: Relevant discussion - <a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;issues&#x2F;9883" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;issues&#x2F;9883</a>
评论 #13269839 未加载
sidllsover 8 years ago
The kind of safety guarantees Rust provides are, in my opinion, insufficient justification for experienced developers to move from C or C++. Rust has other features that make it generally superior in certain (many) contexts. The safety is a nice &quot;add-on&quot; effect, I suppose, but my view is that constantly hyping safety as the biggest selling point is missing a mark.
评论 #13269049 未加载
评论 #13268210 未加载
评论 #13266785 未加载
评论 #13269855 未加载
评论 #13266812 未加载
chjover 8 years ago
We are having new languages every year. Instead of debating which language is the best, why can&#x27;t we invent a way to let components implemented in different languages talk with each other easily? We have pipes, sockets and message queues, but it&#x27;s never simple enough to glue everything together.
评论 #13268744 未加载
评论 #13268199 未加载
评论 #13268204 未加载
评论 #13268454 未加载
pklauslerover 8 years ago
A more interesting question for me is: is there any reason why would I want to use Rust over Haskell on any task where Haskell is &quot;fast enough&quot;?
评论 #13267193 未加载
评论 #13276233 未加载
评论 #13269588 未加载
Tempest1981over 8 years ago
Stroustrup has proposed a way to add safety to C++. It&#x27;s called &quot;C++ Core Guidelines&quot;, and &quot;GSL&quot;.<p><a href="https:&#x2F;&#x2F;isocpp.org&#x2F;blog&#x2F;2015&#x2F;09&#x2F;bjarne-stroustrup-announces-cpp-core-guidelines" rel="nofollow">https:&#x2F;&#x2F;isocpp.org&#x2F;blog&#x2F;2015&#x2F;09&#x2F;bjarne-stroustrup-announces-...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;GSL" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;GSL</a><p>I watched his talk -- wondering if anyone is using it. <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=1OEu9C51K2A" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=1OEu9C51K2A</a><p>Using GSL gives adds some safety to pointers and memory allocation -- while providing the bare-metal performance that C is known for. (It still feels very low-level.)
smitherfieldover 8 years ago
To play the devil&#x27;s advocate a bit, most of these are features you already get with C++, especially if you turn on all relevant warnings and treat them as errors. I can see the advantage of having things (sorta, given &quot;unsafe&quot;) statically guaranteed for a shared codebase, but what are some compelling reasons to switch for personal projects?
评论 #13275855 未加载
faragonover 8 years ago
Author forgets some inconvenients of Rust: massive bloat, multi-platform issues, etc.
评论 #13270965 未加载
gensover 8 years ago
Since this is a &quot;vs&quot; can i assume that rust is better in all regards to C ? As in that rust is flawless ? Or should it be &quot;Rust vs C&#x27;s Pitfalls&quot; ?
fungosover 8 years ago
You&#x27;re so wrong that is laughably.<p>That laughably hashing functions are highly specialized implementations for a proposed problem. There is NO MORAL there.<p>I code C for living and if we can use &quot;laughably hashing functions&quot; to gain performance we WILL DO.
评论 #13272186 未加载
评论 #13272178 未加载