Rust vs Go : Hands On Comparison in 2024

  Рет қаралды 17,404

Melkey

Melkey

Күн бұрын

Let me know which language you prefer to learn in the comments below!
Golang 1.22 or Go 1.22 released earlier this year and has brought in a new era for developers on they build their apps. Rust has been the dominant factor for programming for a long time. BUT:
Which is the better language between Go and Rust? Which offers the best opportunities? Which should you learn?
Is rust the best programming language to learn?
is golang the best programming language to learn?
Kodaps Academy Original Video: • Go vs Rust: Which To L...
Code: github.com/Mel...
Video Editor: @TheMason
Twitch
I stream live on Twitch every weekend
Twitch : / melkey
Join the amazing community on Discord
Discord: / discord
I post memes and host Twitter Tech Spaces
Twitter: / melkeydev
The Best Resources to Learn Golang (If I Could Start Over)
Golang Has Entered A New Era for HTTP Routing
SUBSCRIBE OR GET LAID OFF
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
#coding #neovim #typescript #programming #vim #softwareengineering #codinglife #webdesign #webdevelopment #webdev #javascript #rustlang #rust #twitch #twitchstreamer #programmerhumor #codinghumor #software #softwareengineer #softwaredeveloper #softwaredevelopment #gymbro #gym #programmerhumor #programming #coding #golang #go #golanguage

Пікірлер: 71
@FloWoelki
@FloWoelki 10 ай бұрын
I am honestly all in for learning both languages. Golang is beautiful when it comes to its simplicity (sometimes too simplistic :D). Rust on the other hand teaches you the fundamental things which increase the general code security (memory safety etc.)
@dmh20002
@dmh20002 10 ай бұрын
Rust for critical, operating systems and embedded. Go for general purpose cli, server and cloud. Developing with go is less expensive than rust.
@dmitry-lz1ny
@dmitry-lz1ny 10 ай бұрын
Yep. Goroutine just work
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
Based on your message, you have little or no experience in Rust. I can argue that Rust is great for writing CLI apps due to clap crate. Take a look at the difference between Go and Rust and you'll most likely be pleasantly surprised. For backend development, Rust is amazing due to Axum/Actix-web and sqlx crates. Originally designed as a systems programming language, Rust is an amazing general-purpose programming language.
@pyyrr
@pyyrr 10 ай бұрын
just use c when you need something mission critical, os and embedded
7 ай бұрын
I would say Go is absolutely fantastic for games as well, it's fast enough and makes your life a breeze. And unlike what wannabe developers on the internet says, GC is not an issue and you can always handle allocations yourself, noone is preventing that.
@pyyrr
@pyyrr 7 ай бұрын
yeah, if gc was such a big issue then python and js certainly wouldnt be used so much in production
@lazyh0rse
@lazyh0rse 10 ай бұрын
Go's abstractions doesn't prevent you from customizing it's behavior, it's important to note that some "easy languages" are easy because they over abstract a lot of apis. Making them ironically harder to learn, like C#. Go is very different in that I have absolute control over my application while being actually easy to write.
@LibreGlider
@LibreGlider 9 ай бұрын
"Go does the right thing for you by default." This guy has never spent 1 second with the Rust compiler.
@dezly-macauley
@dezly-macauley 10 ай бұрын
They are both amazing languages, however the things I really want to build fall more into the low-level, high performance, embedded space so I have to invest more in Rust. Also I chose to learn C in 2024 so I think I've lost the right to complain about any programming language being hard.
@leifelliott1500
@leifelliott1500 10 ай бұрын
Honestly the similarities between Rust and Go end at: - Can Write Software with them Personally I use Rust even when I could use Go because eventually I just got more comfortable with it. For example yes gorutines are easy, but is it really hard to understand and apply cpu bound vs io bound tasks? if you understand that is it hard to know when to apply stdlib spawn and tokio task scheduling? Like thats not complicated you know? Thats third year uni here in new york.
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
4:17 - About memory management. I can agree with the interpretation of "Rust forces you to do the right thing" but not with the interpretation "Rust makes you do it for yourself". Rust will do it for you if you follow the rules of ownership and borrowing. Once you understand the rules, it's very easy to follow them. However, the learning materials could do a better job of explaining the why's and the mindset, which is helpful for writing borrow-checker-friendly code. If you don't follow the rules, the compiler provides helpful explanations. By reading the compiler errors, you can start to understand the rules. Indeed, it's easier to get started with Go. However, it's also easy to use Rust if you write it in a borrow-checker-friendly way. This is a skill but it is manageable and the learning are applicable to other programming languages.
@RambodDev
@RambodDev 5 ай бұрын
I come from a C++ and game development background, and I've tried both Go and Rust. I fell in love with both, and I'm definitely inclined to explore them further. Rust is a bit challenging-you need to appreciate the pain to fall in love with it, but I've grown to love Rust too. In the end, I'm now deciding between these two, and I think Go will be my choice because of its similarities to C++ and C-like languages.
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
5:54 The beauty of Rust is that it makes garbage code obvious. You won't clone anything, unless you explicitly write it. And when you do, cargo clippy the linter will tell you where you messed up. And LLVM makes an amazing job of making pretty much any Rust code pretty fast. It takes effort to make your Rust code slow. High performance in not guaranteed in Rust (unless written properly) but the average case is 5-20% improvement in terms of CPU and 30% in terms of RAM over Go.
7 ай бұрын
But then again, only if you don't care about CPU and ram when you write your code. When you don't care about CPU or RAM these numbers are general which means they are acceptable. If you care you pre-allocate.
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
8:28 The difference in numbers highlights the problem that Rust is commonly (mis-)understood as an only-systems programming language as opposed to general purpose programming language that is suitable for real-time systems programming.
@dog4ik
@dog4ik 10 ай бұрын
I prefer rust after i tried it. I guess i like more strictly typed languages.
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
I prefer Rust due to macros. With them, Rust actually is more productive than Go in my hands. And I believe it's the case for those who invested 6+ months in both languages.
@fernandobalieiro
@fernandobalieiro 4 ай бұрын
​@@dmitriidemenev5258both are equally great, Go is best for fast prototyping and more of a cloudy scope and rust better when the scope is known imo
@vitalyl1327
@vitalyl1327 10 ай бұрын
Rust and Golang niches do not even overlap, why would you choose between them?
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
That's a misconception. For example, Rust and Go are both used for writing backend and microservices. Rust is first and foremost a systems programming language but it is also amazing as a general-purpose programming language. And I can say that for that purpose Rust actually has advantages. E.g. sqlx crate offers compile-time SQL query validation against the database schema. And Rust has a lot of conveniences for serialization and serialization due to serde crate.
@vitalyl1327
@vitalyl1327 10 ай бұрын
@@dmitriidemenev5258 Rust may be a "general-purpose" language (though I don't believe in general-purpose languages), but Golang is definitely not one. I don't see how their use cases overlap.
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
@@vitalyl1327 I provided an example of the overlap above. Contrary to what you might think, Rust is on par in terms of productivity with Go. So, for example, Rust is just as sane for a simple CRUD backend as Go, even if Rust's performance isn't needed. Due to Rust being touted as "C++ killer", many wrongly assume that Rust is just as slow for development as C++, which is not the case. Rust's complexity lies in some of its usage where it exposes the inherent complexity of the problems.
@vitalyl1327
@vitalyl1327 10 ай бұрын
@@dmitriidemenev5258 your example is very much outside of the Golang niche. Rust seems like a natural choice there. Golang makes sense in those few cases where its peculiar approach to concurrency is needed and yet its GC is not too detrimental.
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
@@vitalyl1327 Can you provide a concrete example where Go would shine compared to Rust?
@macc4773
@macc4773 27 күн бұрын
@5:48 disagree with your take. He is right. For example: In rust, abstractions like traits (interfaces in golang) are compiled away to nothing; if you don't use dynamic dispatching (the dyn keyboard). In go, every single interface use, requires an allocation and a dynamic dispatch by the runtime. To not talk about generics (which in golang are based on interfaces). Does that means you can't write absolute garbage in Rust, NO. But you have to get out of your way and explicitly do it. There are many other examples of 0 cost abstractions and how that improves performance by default. This whole debate are based on the tradeoff (dev time) vs (runtime time). As Rust devs get more experienced, and rust improves, the dev time gap is closing.
@space7panda
@space7panda 5 ай бұрын
Go is caring mother and Rust is strict father
@werren894
@werren894 10 ай бұрын
dunning-kruger in software engineering is when beginner thinks some programming language are better than the other and help you to be a better programmer but then they forgot the meaning of "engineer" in software engineering, you are not engineer if you only productive because of one language/technology that's makes you a "user", so please learn what you don't want to learn and experience it, be a hacker, you might save humanity one day.
@ofadiman
@ofadiman 10 ай бұрын
Crabs walk sideways 🦀
@mr.k8660
@mr.k8660 10 ай бұрын
😬
@zachend2750
@zachend2750 10 ай бұрын
yeah I think the issue with that guy's video is that he is comparing two totally different things with totally general terms and that is just a resipe for arguments because of all the ambiguity. It reminds me of trying to explain goroutines to js or c# people around 2016 and they would always reply back with "async". It just is a loaded thing even after sending them rob pike videos. When you have a certain way of doing things for years its hard to accept different ideas.
@taquanminhlong
@taquanminhlong 10 ай бұрын
The only thing i don't like about go is the folder based module, import syntax, and the lack of enum, everything else is great 😂
7 ай бұрын
Folder based really is the way to go. Comments like this from randoms are really confusing people. Are you an engineer? Are you working with it? How many languages do you actually know?
@mattcoursecareers
@mattcoursecareers 10 ай бұрын
Hey Melkey - CourseCareers is interested in a paid partnership. How should we reach out to you?
@syedinsaf7481
@syedinsaf7481 4 ай бұрын
your outro is way too loud in this vid btw
@emil_l889
@emil_l889 10 ай бұрын
That video has such conspiracy theory vibez in its style i was expecting to hear how illuminati created rust
@DavidAlsh
@DavidAlsh 8 ай бұрын
I have used both, like both and write Rust as my current day job. In my opinion, even though Rust is more complicated to get started with, it is way easier to be productive in. With Go, concurrency is so easy that many engineers stumble into race conditions without even knowing they are - while the same thing is largely impossible in Rust. I write a lot of concurrent programming and Rust makes writing concurrent/multi-threaded code incredibly easy. You will never come across memory data races - though your program might still do things out of order if you don't consider the control flow of what you're doing. Professionally - I'd rather let a less experienced engineer loose on a Rust codebase than a Go codebase. From a reviewing standpoint, I know they cannot shoot themselves in the foot with race conditions so I don't have to look for that. While with Go, reviewing concurrent code is very involved.
@pieterrossouw8596
@pieterrossouw8596 10 ай бұрын
False choice, use both where they are the best fit. The real choice is do you want to spend years of your career doing performance critical or embedded work or is servers and cloud more your thing. Are you trying to be a generalist or a specialist. Can your business model pay for Rust's much higher development costs?
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
According to Microsoft, Rust's initial development costs are measured to be 15% higher. However, this doesn't include code maintenance costs, which are lower for Rust. And, according to studies, maintenance of the code takes 80% of the development resources. And with 5-20% saving in CPU resources and 30% saving in RAM usage, the operational costs of Rust code are better. And it's before the implementation of widespread carbon taxes. Go is better for prototyping, no arguments. However, Rust wins costwise in the mid-term.
@crimsionCoder42
@crimsionCoder42 6 ай бұрын
I'm in love with the Go compiler that's what did it for me. It's just near instant feed back. Go is the kind of language where you don't have to get fancy just stick to the basics. For most things you can use the standard library. Most of the web frameworks like gin have goroutines already built in making them very efficient. Then they added generics which was a breath of fresh air. Not gonna lie it can't do everything just not a fan of Go with htmx for an MVC, data science is still owned by python, C++ still owns robotics and if you need EVERY micro second like HFT platform then yeah Rust would be a better option. But if you are prototyping or start-up and your team isn't ride or die OOP then GO is a damn fine choice.
@NotherPleb
@NotherPleb 10 ай бұрын
The comparison between go green threads and Rust native threads is not helpful. The real comparison is between go green threads and async Rust, those are the async models chosen by the languages
@noxlupi1
@noxlupi1 9 ай бұрын
Its not the plane, its the pilot. I'm a noob programmer, but it is easy to understand this concept: A regular city driver would make slow laps in a formula 1 car and do faster labs in their family car. Rust is faster than go, and C for that matter. But a new rust programmer, would most likely be overtaken by a new Golang programmer. And none of them, not even a ZIG programmer(faster language than both) would be able to beat John Carmack ig he used regular C, for anything that needs to interact closely with the hardware.
@gourabsarker9552
@gourabsarker9552 10 ай бұрын
Sir do you earn 200k dollars a year? Plz reply. Thanks a lot.
@FlorinPop
@FlorinPop 10 ай бұрын
I don’t
@gdissleeping5719
@gdissleeping5719 10 ай бұрын
​@@FlorinPop Lol
@aarholodian
@aarholodian 10 ай бұрын
This question is always so nonsensical. Only terminally online youtubers or bootcamp NEETS think about programming languages this way. Most major languages are the "same" for the purposes of learning fundamentals, though procedural and OOP langs with "good" typing systems would be preferable for this purpose. Other than that it does not matter at all since if you're a beginner, you don't know what these languages are used in anyway. As such this question is irrelevant and what you should be asking when you got the fundamentals down is what area of development you're more interested in, or which sees more demand, less competition, higher wages, or whatever other metric that is valuable to you. Rust and Go serve completely different purposes, and other than in some quirky startups writing their web backends in them, you will not see them occupy the same niche in the real world.
@AlexanderBorshak
@AlexanderBorshak 10 ай бұрын
You should learn Rust. But use Go. ))) (Actually, it depends on the tasks. If you're writing software for a nuclear reactor, you have to use Rust, to have strict guarantees. But if you writing not a mission-critical application, you can use Go to gain better efficiency.)
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
By efficiency you mean productivity?
@AlexanderBorshak
@AlexanderBorshak 10 ай бұрын
@@dmitriidemenev5258 My mistake, you are correct!
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
@@AlexanderBorshak From my experience, initial costs of writing Go are lower but maintenance of Go are higher. I'm willing to take 15% higher upfront costs for something that will last. However, it's a matter of short-term to mid-term to long-term trade-offs.
@kelvintakyi-bobi3155
@kelvintakyi-bobi3155 9 ай бұрын
This is a good video. Thank you! 👏👏👏
@OldKing11100
@OldKing11100 10 ай бұрын
After trying Rust for a month and running into non-stop skill issues trying to make a simple API I fell back on Go and never looked back. Rust Axum Tokio (the hell are these macros doing!) is somehow the hardest thing I've ever tried to learn and that's coming from C. I could do it and write crap Rust code, but it was bloody slog. I have mad respect to Rustaceans for making the world a safer place, but I'm going to skip over to Zig before I use Rust again.
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
What were the things that slowed you down?
@OldKing11100
@OldKing11100 10 ай бұрын
@@dmitriidemenev5258 Trying to figure out how macros are executed. 7 different string types. Box, Vec, Rc, Arc, Cell gives TS a run for it's money in terms of type complexity. It's the most verbose language and it sucks when variables fall out of memory. Chaining can be nice and evil at the same time. Compiler errors are nice still. If I gave it another 2 month investment I could become half decent at it. Still that's a hell of a hill to climb.
@dmitriidemenev5258
@dmitriidemenev5258 10 ай бұрын
Hi, I'll try to help you. Macros are essentially compiler plugins. Procedural macros are loaded as dynamically linked libraries (.dll or .so) and they are invoked by the compiler to expand the macro invocations. Macros are essentially functions that accept Rust syntax and return Rust syntax (or, more precisely, streams of tokens/ASTs). I'm quite confident that there are more string types than 7 but there are two most common string types - String (owned string) and &str (string slice). Box allows you just to store stuff on the heap. Vec is a growable array (on the heap), Rc and Arc are reference-counted smart pointers. Arc is useful when writing multi-threaded code. Rc has niche uses for interoperability with other programming languages. Cell-types just enable mutation through shared references, which is generally a bad idea. All these are abstractions for very basic things. They're provided to you for convenience and to spare you from writing unsafe code which is necessary to implement them efficiently. In Rust types just express what things are, exposing complexity. It follows Python's principle of "explicit is better than implicit". As for verbosity, I'd like to know which kind of verbosity you're referring to. As for "it sucks when variables fall out of memory", you probably mean it sucks when you move your variables into function calls and can't reuse them. It just means that you should've tweaked the signature of the function to not take ownership of the arguments. If you understand ownership and borrowing, you won't have problems with that. According to Google, it takes anywhere from 2 to 6 months to get up to speed with Rust. The benefit is that you can much easier navigate in code of others because there are few if any hidden assumptions. And it makes the code insanely readable.
@GuillaumeLudwig
@GuillaumeLudwig 5 ай бұрын
​@@dmitriidemenev5258I would add that reading the Rust book is a great help. Especially the experimental version with quizzes.
@SnowDaemon
@SnowDaemon 10 ай бұрын
lets GO
@stephanerebai8005
@stephanerebai8005 4 ай бұрын
you must put "reaction" in the title because this video brings nothing relevant to the video you're watching
@ukaszwolenczak5590
@ukaszwolenczak5590 10 ай бұрын
both
@subjidealist
@subjidealist 8 ай бұрын
So google didn’t know C/C++ so they create a C/C++ based language lol ok
@emil_l889
@emil_l889 10 ай бұрын
skill issued w rust so hard my js code was faster
@owlmostdead9492
@owlmostdead9492 10 ай бұрын
Kodaps Academy, what an annoying video. Not only do I find his speech pattern annoying, he actually added a sound effect to every transition, I can't take people like that seriously. Sorry for the hate but it was a terrible video.
@tinrab
@tinrab 10 ай бұрын
Lmao, so you should definitely learn the boring stuff, like web dev, Python, Go, SQL. That's what you'll do at your job. Rust is too advanced if you just want to be a regular day-job developer. Rust is my top language, but I wouldn't expect to get a job with it. Also, why not learn both?
@vitalyl1327
@vitalyl1327 10 ай бұрын
Why would anyone in a sane mind want to do web or similar boring stuff? Not to mention that those lowly boring jobs are first in line to be replaced with an AI. Do some meaningful development instead.
@tinrab
@tinrab 10 ай бұрын
@@vitalyl1327 I'm talking about getting a job. How many devs can choose where they want to work? I'm guessing not many.
@vitalyl1327
@vitalyl1327 10 ай бұрын
@@tinrab I was under impression that modern slavery is a very rare thing. Most people have a full freedom of choice of where to work and what to do. And I never heard of slave developers in particular.
@tinrab
@tinrab 10 ай бұрын
@@vitalyl1327 Lmao, it's not slavery technically, but I've never got to do what I want yet. At this point, I'd take anything, JS, Python, even hacking WP in PHP.
@vitalyl1327
@vitalyl1327 10 ай бұрын
@@tinrab why? Nobody is forcing you to do it. You're free. Just get a meaningful job, doing meaningful and fun things. There is a lot of them, and a massive shortage of engineers. From embedded, robotics, industrial automation, aerospace and automotive to exotic things like HFT.
@steveoc64
@steveoc64 10 ай бұрын
Go for building stuff. Zig for the performance stuff. I don’t have a use for Rust.
@tester2971
@tester2971 4 ай бұрын
And Java for having a job.
Rust vs Go : Hands On Comparison
50:40
ThePrimeTime
Рет қаралды 244 М.
Rust vs Go: Which is best? THE Definitive Answer
28:30
Michael Mullin
Рет қаралды 59 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Как я писал клиента для YDB на Rust, сравнение с Go. Тимофей Кулин
27:37
Видео с мероприятий {speach!
Рет қаралды 3,4 М.
Async Rust Is A Bad Language | Prime Reacts
28:46
ThePrimeTime
Рет қаралды 113 М.
Go vs Rust vs Bun vs Node | Prime Reacts
18:07
ThePrimeTime
Рет қаралды 179 М.
Golang Channels Or Wait Groups? Let Me Explain.
18:32
Anthony GG
Рет қаралды 29 М.
Golang Error Handling Isn't ACTUALLY Bad
7:53
Melkey
Рет қаралды 15 М.
Where is Rust being used?
11:46
Let's Get Rusty
Рет қаралды 163 М.
Why I’m Learning Rust in 2024 (and new dev environment)
16:53
ForrestKnight
Рет қаралды 72 М.
Why JavaScript Devs are Switching to Rust in 2024
10:35
warpdotdev
Рет қаралды 265 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.