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 for Professionals

126 pointsby keewee7over 2 years ago

12 comments

wrsover 2 years ago
An important “unblocker” for me when learning Rust after decades of other languages was internalizing that assignment is <i>destructive move</i> by default. Like many Rust intros, this sort of glides past that in the “ownership” section, but I felt like it should be a big red headline.<p>If you’re coming from C++ especially, where the move&#x2F;copy situation is ridiculously confusing (IMO), but also from a simpler “reference by default” language like Java, this has profound impact on what’s intuitive in the language.<p>For the C++ comparison, this is a pretty good article: <a href="https:&#x2F;&#x2F;radekvit.medium.com&#x2F;move-semantics-in-c-and-rust-the-case-for-destructive-moves-d816891c354b" rel="nofollow">https:&#x2F;&#x2F;radekvit.medium.com&#x2F;move-semantics-in-c-and-rust-the...</a>
评论 #34227278 未加载
评论 #34227181 未加载
attractivechaosover 2 years ago
Nice blog post. Nonetheless, to a new learner like me, the hardest part of rust is not its syntax; it is the ownership management. Sometimes I easily know how to implement a task efficiently in other languages but I have to fight the compiler in rust. I either need to reorganize data structures, which takes effort, or to make a compromise by cloning objects, which affects performance. Note that I do agree with rust designers that it is better to make data dependencies explicit but learning to deal with them properly is nontrivial for me.
评论 #34226429 未加载
评论 #34225157 未加载
评论 #34225167 未加载
xiphias2over 2 years ago
In my opinion this is the way _not_ to learn Rust. These syntaxes are not important at all, and doesn&#x27;t introduce lifetimes (which is by far the most important part of the language for deciding whether to use it or not).<p>Any blog about learning Rust for beginners should just contain information that helps the reader decide _whether_ she should put in the time required for learning it, then refer to the great Rust Programming Language book that&#x27;s really hard to surpass.<p>The reference is great as well, though personally I miss a part that formally defines the type system in its current form (there are some papers about lifetimes, but they are very hard to read).
评论 #34226441 未加载
mlindnerover 2 years ago
It&#x27;d be nicer if there was some way of selection which language is shown on the left side. Expecting readers to understand both C++ and Kotlin and Java and Javascript will be a stretch for most.
评论 #34225050 未加载
评论 #34225509 未加载
评论 #34224746 未加载
评论 #34224806 未加载
评论 #34224796 未加载
deepsunover 2 years ago
&gt; Inner functions. Rust also supports inner functions. ...<p>&gt; Closures (lambdas). Rust supports closures (also called Lambdas, arrow functions or anonymous functions in other languages).<p>That&#x27;s misguiding.<p>Closures are not lambdas. Lambdas are just syntax, but the whole point about closures is that they capture the enclosing environment (have access to variables where it&#x27;s defined). Rust&#x27;s documentation states just that. Closures may or may not be lambdas.<p>In above example of &quot;Inner functions&quot; (which is also a closure) that would be more clearly explained if the inner function used an outside variable. Not all languages can do that.
joaquincabezasover 2 years ago
I keep saving these Rust resources for a near future... Am i the only one??<p>I really hope to start using Rust in 2023, probably for some kind of API gateway experimentation
评论 #34224755 未加载
评论 #34228731 未加载
评论 #34225778 未加载
solomatovover 2 years ago
This document only briefly mentions interior mutability, which IMO, is one of the most important things to become productive in Rust.
ridiculous_fishover 2 years ago
Curious why the author chose not to discuss macros? You encounter them immediately with a Hello World.
评论 #34226251 未加载
ww520over 2 years ago
This is an excellent short tutorial. It helps to compare and contrast to other languages.
jason2323over 2 years ago
As someone coming from a Java background, this seems useful! Thank you!
skorover 2 years ago
any constructive criticism on rust syntax?
评论 #34226170 未加载
评论 #34227746 未加载
评论 #34225277 未加载
评论 #34225818 未加载
tomr75over 2 years ago
the hardest part and barrier are the concepts behind lifetimes&#x2F;ownership&#x2F;borrowing not the syntax
评论 #34227453 未加载