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.

Ask HN: Rust vs. Golang

1 pointsby the_dripperalmost 5 years ago
I am conflicted.<p>I want to learn an new Programming language, and eventually build a project with it. But Im not sure what language i should choose for that. I have already been programming a little bit of Golang, which I really like, but Rust also interests me.<p>So I have to ask, what pros and cons there are to both languages. I don&#x27;t know if I should learn both of them, because I think it might be too difficult.

5 comments

dragonshalmost 5 years ago
If your final goal is building something today which can be used in production especially networking, server or web api go for golang as it’s mature, fast and performant with a very good and large eco-system of libraries. So if your systems programming involves network, servers or web API go with golang.<p>If you need to experiment with a new language and build something may be a new OS library encapsulating it’s C libraries around safety guarantees provided by borrow checker syntax try Rust. Also Rust with it’s rich type system and support of generics give you nice development experience similar to C++.<p>Rust still has a long way to go before it becomes 10% of what’s written in C++. But given it’s support from Microsoft and popularity among some programmer community, it might become popular in coming 10 years. So it will still be nice to learn for future. Just remember Rust has a large syntax area, expressive type system and steep learning curve especially with borrow checker syntax. So be prepared to spend 2x-3x developtment time compared to golang if doing systems programming where golang is strong like networking and servers, even though you will hear from Rust evangelist it won’t, but given current eco-system it will take time.<p>Golang has become old boring technology which just works and highly productive.<p>So given small syntax area and opinionated design like C, you will either like golang or hate it. People who tend towards Rust are in the opposing camp of golang.
评论 #23923868 未加载
dathinabalmost 5 years ago
Rust:<p>- more versatile (both PRO and CON)<p>- better error handling (IMHO)<p>- more powerfull type system (i.e. more to learn but also more you can use to your advantage) (both PRO and CON)<p>- has good support for more different forms of concurrency&amp;parallelism then go (your can use it better as a tool to play around with that forms) (both PRO and CON)<p>- LLVM backed (allowing cross language optimizations, I don&#x27;t remember if they are currently on the way of being implemented in llvm or already implemented) (both PRO and CON)<p>Go:<p>- simple syntax<p>- mainly one form of concurrency&amp;parallelism but backed into the language and all libs use that one (also very neat if you want to look into certain paradigm which are heavily based on this paradigm)<p>- as far as I know pretty solid &quot;first party&quot; library for common server middle ware task<p>- maybe some other things<p>Also in rust you have more control over memory, but for many use cases this doesn&#x27;t matter that much until you scale up to a high degree, then there are some differences about package management but I can&#x27;t judge those as I&#x27;m not experienced enough with using third party go libraries.<p>Another thing I haven&#x27;t list is the rust borrow checker, it can be a bit of a handful to learn but it tends to force you to write better structured code so I think it&#x27;s worthwhile even if you never again use rust later one.<p>Generally learning more programming languages (or more precise the concepts behind them and the concepts frequently used in libraries of them) can make you a much better programmer. And with learning I don&#x27;t mean &quot;going to be a experienced ... programmer&quot; but just understanding the concepts good enough so that you can use them and recognize them when they appear in a different language with different syntax and naming.
karmakazealmost 5 years ago
&gt; I want to learn an new Programming language, and eventually build a project with it.<p>Which part is more important to you?<p><pre><code> I want to learn an new Programming language =&gt; Rust build a project with it =&gt; Go. </code></pre> As a language Go is not very large or interesting, introducing a couple unique ways of doing things. This let&#x27;s you pick it up quickly and get going. Rust is far more interesting a language to learn but you will spend much more time investing in it.<p>&gt; learn both of them, because I think it might be too difficult<p>If you&#x27;re concerned about difficulty, consider learning Go first. Learning Rust is likely about as hard as learning both. Learning both takes longer but the Go part is not nearly as difficult (until you get deep into Go which isn&#x27;t often needed).
catacombsalmost 5 years ago
Go and Rust have different use cases and have different learning curves. The first question you want to ask yourself is, &quot;What do you I want to build?&quot; Go is good for CLI-based programs and server work. Rust is more low-level and can be used to build, say, operating systems. It depends on your goals.<p>Now, if you don&#x27;t have any in mind, then I suggest Go because it&#x27;s easier to learn and you can still be pretty productive in it.
kgravesalmost 5 years ago
learn both, it would make you a better programmer.