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.

Hello, Rust – Go vs. Rust: Concurrency and Race Conditions

3 pointsby omn1over 6 years ago

1 comment

omn1over 6 years ago
One could also write the Go version using channels [1] and the Rust version in a more functional way [2], but overall the code is quite straightforward in both languages.<p>Only thing I don&#x27;t like about the Rust version is, that the error message is still a bit cryptic:<p>``` Cannot borrow data mutably in a captured outer variable in an `Fn` closure. ```<p>But the important part is that Rust prevents a data race at compile time, which is nice.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;hello-rust&#x2F;show&#x2F;pull&#x2F;46" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hello-rust&#x2F;show&#x2F;pull&#x2F;46</a> [2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;hello-rust&#x2F;show&#x2F;pull&#x2F;45" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hello-rust&#x2F;show&#x2F;pull&#x2F;45</a>