3 ms·
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 p
by dragonsh 6y 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.
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++.
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.
Golang has become old boring technology which just works and highly productive.
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.
- mlindner 6y agoGolang hit 1.0 in 2012. Rust hit 1.0 in 2015. Rust is only 3 years behind golang in maturity.
- dragonsh 6y agoGolang is widely adopted as systems programming language for servers (e.g. Traefik, NATS, Caddy and many many more), database (e.g. yugabyte, cockroachdb etc.), web applications (e.g. gitea), docker, kubernetes (k8s), LXD, nomad, consul, etcd etc. and this is just tip on the iceberg. Golang has become very important language for internet related programming and managing container and serverless infrastructure. Rust is used only in some part of it's core project Mozilla browser which still primarily a C++ application. Also Rust community is slowly building some software in it and may have some internal applications within some companies, but there is nothing substantial or crucial yet. So Rust has a mountain of 10-15 years to climb before it comes close to golang eco-system for systems programming tasks especially servers and network related. Rust might be closer to work as wrapper around C/C++ code in short term to give a start but given it's complex syntax, type system and borrow checker syntax it will still take sometime. Again since golang is highly opinionated it might not suite everyone so it is still nice to see a parallel eco-system around other language like Rust. This will keep golang on it's toes to improve continuously.
- steveklabnik 6y agoYou are missing a lot of places Rust is used in a “substantial or crucial” way. For example, the core of AWS Lambda and Fargate are both Rust these days. It is true that there is more Go usage than Rust. But there’s a lot more serious Rust usage than you’re implying.
- dragonsh 6y agoThere are some uses of Rust in some companies but nothing really significant or ground breaking yet, and not to an extent as important as golang and Swift. Rust can not compare with C/C++ as most of the important crates in Rust still depend on underlying C/C++ library and will continue in foreseeable future, meaning those libraries still needs to be maintained in C/C++. I do not have access to open source code of fargate or AWS Lambda written in Rust to see the extent of it’s use. Having seen kubernetes (k8s) in golang and many of the CNCF softwares using golang, Rust is still a fringe language and will need another 10-15 years to reach parity. Rust has yet to prove anything critical for internet or general computing infrastructure. Still waiting when Mozilla browsers C++ code will be replaced by Rust, given it’s the reason it was created.