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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A half-hour to learn Rust (2020)

219 点作者 onderkalaci将近 2 年前

15 条评论

jetpackjoe将近 2 年前
The YouTube channel &quot;No Boilerplate&quot; turned this into a 10-minute video version, for anyone that prefers video:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=br3GIIQeefY">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=br3GIIQeefY</a>
评论 #37246951 未加载
评论 #37244886 未加载
nathell将近 2 年前
As a recent newcomer to Rust, I find Amos&#x27; articles an indispensable source of knowledge. His post on recursive iterators [1] has been a lifesaver while I was working on my problem. Thanks, Amos!<p>[1]: <a href="https:&#x2F;&#x2F;fasterthanli.me&#x2F;articles&#x2F;recursive-iterators-rust" rel="nofollow noreferrer">https:&#x2F;&#x2F;fasterthanli.me&#x2F;articles&#x2F;recursive-iterators-rust</a>
skulk将近 2 年前
This is, more or less, how I learned Rust circa 2015 (might have been a couple years later). I quickly started to write programs like I would have in C but got completely thwarted by the borrow checker because I wanted pointers everywhere. This made me throw my hands up and leave for other languages.<p>However, 8 years later I did eventually come to love rust after learning the One Weird Trick of using indices instead of pointers.
评论 #37237957 未加载
评论 #37237791 未加载
评论 #37239874 未加载
评论 #37237863 未加载
评论 #37238399 未加载
karimf将近 2 年前
Previous discussion with 333 comments (2021):<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25610741">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25610741</a>
评论 #37237949 未加载
Thaxll将近 2 年前
half an hour to learn Rust, the other half to wait for compilation.
评论 #37237789 未加载
评论 #37246966 未加载
评论 #37237752 未加载
ramesh31将近 2 年前
Why do I love this language so much having never written a line of it? Something about it is just so damn aesthetically pleasing.
评论 #37238894 未加载
distcs将近 2 年前
I know this is not going to make me an expert in Rust. That&#x27;ll probably take 10 years. But this is just the kind of thing I was looking for to get started with Rust. Thanks for sharing it here.
评论 #37237659 未加载
评论 #37237883 未加载
评论 #37239111 未加载
评论 #37238651 未加载
gtani将近 2 年前
Helps a lot to track toolchain improvements:<p>- in distrib: cargo, analyzer, clippy<p>- others: Aquascope godbolt intellij flowistry<p>__________________________<p><a href="https:&#x2F;&#x2F;www.infoworld.com&#x2F;article&#x2F;3267624&#x2F;whats-new-in-the-rust-language.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.infoworld.com&#x2F;article&#x2F;3267624&#x2F;whats-new-in-the-r...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;cognitive-engineering-lab&#x2F;aquascope">https:&#x2F;&#x2F;github.com&#x2F;cognitive-engineering-lab&#x2F;aquascope</a><p><a href="https:&#x2F;&#x2F;intellij-rust.github.io&#x2F;thisweek&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;intellij-rust.github.io&#x2F;thisweek&#x2F;</a>
trevor-e将近 2 年前
Feels like every language should have an introduction like this. It&#x27;s frustrating that lang intros are either your very basic and trivial example, or a full-blown set of tutorials, nothing in-between.<p>I also chuckled at the &quot;20 minute read&quot;.
g4zj将近 2 年前
Also useful is the &quot;Learn X in Y Minutes&quot; page for Rust.<p><a href="https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;rust&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;rust&#x2F;</a>
mstaoru将近 2 年前
<p><pre><code> fn tail&lt;&#x27;a&gt;(s: &amp;&#x27;a [u8]) -&gt; &amp;&#x27;a [u8] { &amp;s[1..] } ... fn main() -&gt; Result&lt;(), std::str::Utf8Error&gt; { let s = std::str::from_utf8(&amp;[240, 159, 141, 137])?; println!(&quot;{}&quot;, s); Ok(()) } </code></pre> Sorry, `|::|&amp;(_Rust!){}?`. I know you&#x27;re sexy. But I&#x27;ll prefer my eyesight and sanity over you.
评论 #37246939 未加载
WilliamCarlos将近 2 年前
Wish there was a version of this for C++!
AlanSE将近 2 年前
Can someone explain to me where the feeling_lucky variables comes from in the match example? I don&#x27;t get it. The variable isn&#x27;t defined anywhere in the relevant scope.
评论 #37239729 未加载
bornfreddy将近 2 年前
This might not be a popular opinion, but - I love the idea of Rust, but the language itself seems needlessly complex to me. It looks like the authors tried to cover so many esoteric usecases that the result is more like C++ than C (which is not good in my eyes).<p>One example:<p>&gt; `let` patterns can be used as conditions in `if`:<p>Anyway, this tutorial looks great, I&#x27;ll give Rust another go when I have a good project for it, but to me it seems there is a great need for a simpler language with similar memory management. Rust is just too complex, imho.
评论 #37238092 未加载
评论 #37238119 未加载
评论 #37238600 未加载
评论 #37238718 未加载
评论 #37238373 未加载
评论 #37238642 未加载
molenzwiebel将近 2 年前
(2020)
评论 #37237617 未加载