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.

Two Weeks of Rust

323 pointsby mreover 9 years ago

14 comments

taliesinbover 9 years ago
&quot;No segfaults, no uninitialized memory, no coercion bugs, no data races, no null pointers, no header files, no makefiles, no autoconf, no cmake, no gdb. What if all the problems of c&#x2F;c++ were fixed with one swing of a magic wand? The future is here, people&quot;<p>It certainly is.<p>The advantages over C++ seemingly never end. I&#x27;d add to the list: rigorous portability, non-broken macros, ADTs and pattern matching, a careful language stability protocol, standard test and doc tooling, flexible namespacing via visibility and modules, the <i>absense</i> of vast lacunas of undefined behaviour, simple numeric promotion rules, meaningful compile-time errors for generic code. Plus things already mentioned in the post like Cargo.<p>People tend to focus on the safety side of Rust, but as impressive to me is just the... solidity on all these other axes. If you stripped out lifetimes and the borrow checker you would still have an incredibly compelling alternative to C++.
评论 #10887783 未加载
评论 #10887270 未加载
评论 #10887075 未加载
评论 #10886828 未加载
评论 #10888907 未加载
评论 #10887334 未加载
评论 #10887046 未加载
goodplayover 9 years ago
I&#x27;d like to echo the author in that Cargo is the best language package manager&#x2F;build system I&#x27;ve had the pleasure to use.<p>However, there is one serious problem with Cargo&#x27;s packages: They simply aren&#x27;t authenticated. Cargo&#x27;s developers acknowledge this issue and there is a proposal to amend it by adopting the TUF [1]. but this issue doesn&#x27;t seem to enjoy the attention it deserves.<p>As a person living in a country that increasingly edging towards going the Kazakhstan route where all secure traffic will be MITMed, simply relying on transport security as a way to secure crates is not sufficient. and that&#x27;s ignoring compromises due to server security failures. At present, my only options are to include the entire dependency tree in crate or avoid dependencies altogether.<p>Even ignoring my problem (which wouldn&#x27;t effect a large number of rust developers), Mixing transport security with authentication and integrity shouldn&#x27;t happen in vital infrastructure like a language package system.<p>There are other problems like not representing system libraries that a crate depends on in the project manifest, but unauthenticated crates are a ar more serious problem.<p>[1]:<a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;crates.io&#x2F;issues&#x2F;75" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;crates.io&#x2F;issues&#x2F;75</a>
评论 #10886854 未加载
EugeneOZover 9 years ago
I&#x27;m working with Rust 2 months. In my opinion, pluses:<p>+ Compiler with very helpful error messages;<p>+ Cargo is the best package manager in the universe;<p>+ Result&lt;&gt; is the most correct way to return results from function, I dreamed about it;<p>+ Community of smart and friendly people.<p>Minuses:<p>- Functions are not first class citizens - you can&#x27;t return function as result;<p>- Violation of &quot;explicit over implicit&quot; rule in methods declarations: argument self&#x2F;&amp;self is implicitly omitted in call, but exist in signature. Because of this, for example, you can&#x27;t use method of class as request handler in Iron, you need closure wrapper with same order and count of arguments. Pure ugliness;<p>- Often you need just add lifetime definition to satisfy compiler, without doing anything with this lifetime anywhere else in code;<p>- Extremely verbose syntax;<p>- Rust has exceptions (panic), and you can&#x27;t catch them. And with promised panic::recover you&#x27;ll have limitations of supported structures;<p>- Errors handling encourages copy-pasting;<p>- Syntax is not intuitive, especially when traits and lifetimes comes into declaration - in such cases you can look at own code and think &quot;I hope at least compiler can read it&quot;;<p>- Nested structures is pain;<p>- Lack of optional and named arguments, lack of predefined values in structures;<p>- Too few modules for web. Just 1 module for MySQL (thanks to it&#x27;s author - actively maintained);<p>- Usage of safe code can lead to out-of-bounds errors, with thread panic (hello to vec macros).<p>And I still think it&#x27;s best language we have:) Biggest advantage - most of errors can be found on compilation step. But price is all of these minuses.
评论 #10887204 未加载
评论 #10888763 未加载
评论 #10887459 未加载
评论 #10887187 未加载
评论 #10887202 未加载
评论 #10888495 未加载
评论 #10887641 未加载
评论 #10888845 未加载
评论 #10887185 未加载
grabcocqueover 9 years ago
I never found the borrow checker to be that hard to work with. For a start, if you&#x27;re developing a systems language in a modern way, (say C++11&#x2F;14) you&#x27;re already used to thinking in terms of move semantics, const refs and shared vs unique pointers.<p>Secondly, Rust&#x27;s compiler gives INCREDIBLY detailed explanations of what the borrow checker doesn&#x27;t like, where the conflicting scopes begin and end, and helpful suggestions of what to do to make it work.
评论 #10887024 未加载
评论 #10886738 未加载
lifthrasiirover 9 years ago
The submission and expanded discussion at &#x2F;r&#x2F;rust: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;40d8ca&#x2F;two_weeks_of_rust&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;40d8ca&#x2F;two_weeks_of_r...</a>
crncostaover 9 years ago
In 2016 I would like to see a Rust frontend for GCC, with LTO support and all the list of target backends GCC support.
评论 #10886800 未加载
评论 #10886843 未加载
purpled_hazeover 9 years ago
I&#x27;m a little skeptical after first reading &quot;Disclaimer: I&#x27;m digging Rust. I lost my hunger for programming from doing too many sad commercial projects. And now it&#x27;s back. You rock, Rust!&quot; and then seeing comparisons to Python in the text where it seems like the author might prefer writing in Python, especially with all of the Rust cons listed.<p>Is the author saying Rust is a breath of fresh air from C++ or from all other programming languages? Ruby was my breath of fresh air for a while, but lately I&#x27;ve not been enthusiastic about any language or framework, really, so I curious how great Rust really is these days.
评论 #10886952 未加载
评论 #10886989 未加载
beerbajayover 9 years ago
I also tried rust for a couple of weeks, but holy hell is it ugly. Why improve on c++ and not improve the syntax or containers? It&#x27;s like python never existed.
评论 #10887257 未加载
评论 #10890709 未加载
评论 #10888557 未加载
评论 #10887076 未加载
ameliusover 9 years ago
How does Rust interoperate with C++? For example, would it be easy to integrate V8 into a Rust project?
评论 #10887235 未加载
评论 #10887559 未加载
评论 #10888566 未加载
评论 #10887089 未加载
评论 #10890270 未加载
cikeyover 9 years ago
Nice to see rust getting along. Coming from C and C++ is really dig the new ideas for better and more save low level languages.<p>What really bugs me, is what the author describes as being&#x27;concise&#x27;. Shortcuts like fn, pub or vec, in my oppinion, hurt readability more than they help me to write code faster. But maybe thats just my brain, or lack of time using rust.
评论 #10892073 未加载
pjungwirover 9 years ago
I&#x27;ve been experimenting with Rust for a few weeks, and I really like it, but I hope they improve how you write functions that return iterators. I can&#x27;t find all the discussion now, but here is some of it:<p><a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;27535289&#x2F;correct-way-to-return-an-iterator" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;27535289&#x2F;correct-way-to-r...</a><p><a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;2h26cj&#x2F;functions_returning_iterators&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;2h26cj&#x2F;functions_retu...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;pull&#x2F;105" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;pull&#x2F;105</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;pull&#x2F;1305" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;pull&#x2F;1305</a><p>Reading those RFCs can be frustrating, where a discussion goes on for over a year and people add more and more wants to an idea until it sinks. Same thing with the discussion about a `yield` keyword:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;issues&#x2F;7746" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;issues&#x2F;7746</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;issues&#x2F;388" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;issues&#x2F;388</a><p>It reminds me of the JCP in Java. I guess every standards committee is like this, and I actually like how careful the Rust team is about extending the language---but I think we should be prepared for it to evolve slowly. Right now I feel like Rust&#x27;s pace will be more like Java than C#.
评论 #10888595 未加载
评论 #10888643 未加载
vitriol83over 9 years ago
The article is comparing Rust principally to Python (a new dynamically typed language) and C++ (an old statically typed language). It&#x27;s certainly plausible that it can bring benefits over these.<p>More interesting to me would be comparing it to a new-ish multi-paradigm language, of which there are many right now (e.g Swift, OCaml, Haskell, F#, Scala). It seems like in practical applications these newer FP languages will be much more productive than Rust, as memory management is much simpler. Rust&#x27;s principle of zero-cost abstractions is great in theory, but can&#x27;t think of many applications where it&#x27;s the limiting factor except perhaps embedded devices and kernel development.
评论 #10887994 未加载
评论 #10887921 未加载
loaaaover 9 years ago
Future? well, 10 year later, quantum computer maybe come to reality which is much much faster than current computers. At that time who will care about Rust or C++? The easiest language will win.
评论 #10895186 未加载
markqueover 9 years ago
When you&#x27;ve worked with languages with a garbage collector, having to worry about memory management and all that jazz seems a step backwards just to save a few cycles. You want to be focusing on the domain problem not the machine. (This is directed at people who use Rust as a general purpose lang, im sure it&#x27;s good for low level systems programming).
评论 #10886770 未加载
评论 #10886862 未加载
评论 #10887107 未加载
评论 #10886890 未加载
评论 #10886727 未加载
评论 #10886753 未加载
评论 #10888831 未加载
评论 #10892493 未加载
评论 #10886749 未加载
评论 #10886707 未加载
评论 #10887125 未加载
评论 #10889189 未加载
评论 #10886783 未加载