<story><title>Rewrite Everything in Rust</title><url>http://robert.ocallahan.org/2016/02/rewrite-everything-in-rust.html</url></story><parent_chain><item><author>rubiquity</author><text>I think what GP is saying that you&amp;#x27;ll have problems in logic or other typical programming problems and that it isn&amp;#x27;t a lack of language features&amp;#x2F;safety but rather time&amp;#x2F;money being thrown at these libraries&lt;p&gt;I imagine the top two reasons unsafe memory access happen is:&lt;p&gt;1) other complicated logic seeped into the memory sensitive area or causes programmer fatigue&lt;p&gt;2) memory management is hard&lt;p&gt;Rust helps with #2 but let&amp;#x27;s not kid ourselves, what percentage of a library like glibc would be spent in unsafe blocks? Drawing attention to an unsafe area can help though.&lt;p&gt;As you can see, I&amp;#x27;m running around in circles. Just like every discussion about this does. Until an avid Rust user puts their money where their mouth is, we&amp;#x27;re all just playing Armchair Programmer.</text></item><item><author>pcwalton</author><text>&amp;gt; A rewrite would clean up the code, sure, but then you&amp;#x27;re left in the same situation, only with brand new bugs that nobody has time to fix.&lt;p&gt;The entire point is that you&amp;#x27;re &lt;i&gt;not&lt;/i&gt; in the same situation regarding memory safety problems&amp;#x2F;vulnerabilities.</text></item><item><author>panic</author><text>I think this misses the real problem.  So many pieces of foundational software like glibc and OpenSSL are understaffed, underfunded, and plagued by terrible code.  Go read glibc getaddrinfo: it&amp;#x27;s a mess!&lt;p&gt;Rewriting the software in Rust would not solve these problems any more than rewriting it in C++ would.  A rewrite would clean up the code, sure, but then you&amp;#x27;re left in the same situation, only with brand new bugs that nobody has time to fix.&lt;p&gt;We need to have incentives for maintaining this foundational software.</text></item></parent_chain><comment><author>bluejekyll</author><text>&amp;gt; an avid Rust user puts their money where their mouth is&lt;p&gt;There are lots of people doing this. Look at crates.io. I decided to write a new fully compliant DNS server and client, trust-dns. I work on it in my spare time (it&amp;#x27;s time not money), which is hard with two kids.&lt;p&gt;I&amp;#x27;ve learned a few things. It&amp;#x27;s hard to get it done. There&amp;#x27;s a lot to learn from the rfc&amp;#x27;s. Just because it&amp;#x27;s Rust, doesn&amp;#x27;t mean it&amp;#x27;s easy. There are all the same borrow rules, and I know I have a bunch of TODOs in the code to go fix things like extra clones. The IDEs, while good, are not on par with other languages yet.&lt;p&gt;Basically it&amp;#x27;s a lot of work. And I commend the individuals who&amp;#x27;ve paved the way for me with the std library in Rust, but we still have so much more work to do until there is a full OS env like GNU.</text></comment>
<story><title>Rewrite Everything in Rust</title><url>http://robert.ocallahan.org/2016/02/rewrite-everything-in-rust.html</url></story><parent_chain><item><author>rubiquity</author><text>I think what GP is saying that you&amp;#x27;ll have problems in logic or other typical programming problems and that it isn&amp;#x27;t a lack of language features&amp;#x2F;safety but rather time&amp;#x2F;money being thrown at these libraries&lt;p&gt;I imagine the top two reasons unsafe memory access happen is:&lt;p&gt;1) other complicated logic seeped into the memory sensitive area or causes programmer fatigue&lt;p&gt;2) memory management is hard&lt;p&gt;Rust helps with #2 but let&amp;#x27;s not kid ourselves, what percentage of a library like glibc would be spent in unsafe blocks? Drawing attention to an unsafe area can help though.&lt;p&gt;As you can see, I&amp;#x27;m running around in circles. Just like every discussion about this does. Until an avid Rust user puts their money where their mouth is, we&amp;#x27;re all just playing Armchair Programmer.</text></item><item><author>pcwalton</author><text>&amp;gt; A rewrite would clean up the code, sure, but then you&amp;#x27;re left in the same situation, only with brand new bugs that nobody has time to fix.&lt;p&gt;The entire point is that you&amp;#x27;re &lt;i&gt;not&lt;/i&gt; in the same situation regarding memory safety problems&amp;#x2F;vulnerabilities.</text></item><item><author>panic</author><text>I think this misses the real problem.  So many pieces of foundational software like glibc and OpenSSL are understaffed, underfunded, and plagued by terrible code.  Go read glibc getaddrinfo: it&amp;#x27;s a mess!&lt;p&gt;Rewriting the software in Rust would not solve these problems any more than rewriting it in C++ would.  A rewrite would clean up the code, sure, but then you&amp;#x27;re left in the same situation, only with brand new bugs that nobody has time to fix.&lt;p&gt;We need to have incentives for maintaining this foundational software.</text></item></parent_chain><comment><author>pcwalton</author><text>I don&amp;#x27;t understand the difference between #1 and #2, or why Rust helps with one and not the other. If memory safety is enforced, it&amp;#x27;s enforced.&lt;p&gt;&amp;gt; Rust helps with #2 but let&amp;#x27;s not kid ourselves, what percentage of a library like glibc would be spent in unsafe blocks?&lt;p&gt;string.h is not as interesting as, say, the DNS resolver. Nothing about the DNS resolver needs to be unsafe.</text></comment>