The Darkside Of Rust

preview_player
Показать описание
Recorded live on twitch, GET IN

MY MAIN YT CHANNEL: Has well edited engineering videos

Discord

Рекомендации по теме
Комментарии
Автор

I have zero interest in writing Rust but still watch these videos.

captainfordo
Автор

4:57 actually 🤓 RefCell doesn't store values on the heap. RefCell<T> contains an UnsafeCell<T> which is just a wrapper around T.

villuna_
Автор

Personally i grasped pointers in C/C++ much faster than I grasped the borrow/owner thing. I never understood why pointers were hard to grasp as a concept for other people, it felt very intuitive for me.

daniel
Автор

I think the reason Rust is not easy for beginners is because most resources teach it by comparing with other languages instead of just teaching Rust

NphiniT
Автор

"I think I can beat Ruby in a foot race" 😂

ShkumbinMaksuti
Автор

I think what the article meant is that rust has a lot of ways of writing code in an elegant way, which makes it easy to read. Like iterator chaining, question mark errors, and match statements. Where it often gets very complicated (in my opinion) is when generics/macros are involved. I love them macros, just look at the generic VecX types of a crate like nalgebra-glm...

mathijsfrank
Автор

I actually think that the syntax of pointers in c is one of the most difficult parts, especially with how they conflate array syntax and pointer syntax.

sirhenrystalwart
Автор

Everything looks complicated when you don't know how it works. I got into this field late, but I agree with the chat you quoted, scope was harder for me than borrowing. Mostly because of OOP and abstraction getting in the way of what is otherwise a very simple concept, but that's why Rust is easy to learn for true* beginners.

*by "true" beginners, I mean people who are learning for themselves. The hungry type of person. I often see people getting their hand held through the process, and they act very differently than the ones who would voluntarily start up conversations about work/programming because they're excited to learn the concepts and ideas.

grawss
Автор

9:00 - I recently was wrestling with this and ended up having to use unsafe blocks with mutable static variables to do what I wanted. It felt wrong, but I was able to accept it when I realized the reason Rust has those features is to accommodate things like what I was trying to do.

CamembertDave
Автор

3:16 - "There's definitely an Arc<Expertise>..."

FJL
Автор

Its always the half baked knowledge folks writing medium articles smh

avnishjha
Автор

8:30 I believe CSP model is better for concurrency.

Communicating sequential processes is a well thought out model imo

grim.reaper
Автор

My god, I was watching this and missed the "I'm VSCode" part, and now I'm dying here HAHHAHAHHA

pesterenan
Автор

When I was weighing languages to use on a project several years ago, I ended up ruling out Rust and Go because of their executable size (> 1 MB). I needed the smallest binary I could get, and I just couldn't get it small enough from Rust or Go. I ended up using C++ to get the smallest binary I could (~40 kB). I'd like to run that experiment again though.

MrJdsteinhauser
Автор

When talking about whether or not Rust is for beginners we have to state what level of expertise we are looking for as a result. If we want to be able to use some libraries and make some simple job done is one thing. If we are willing to cross boundaries of unsafe Rust where strong knowledge of UB is required, there where the fun begins.

RuslanKovtun
Автор

There is a reason Rust and C/C++ are not for beginners...

JavaScript, Python, C#, etc: "Grab bread, peanut butter, and jelly. Spread peanut butter on slice of bread. Spread jelly on another slice of bread. Put bread together with peanut butter touching jelly. Eat sandwich."

Rust, C/C++, etc: "Go to cupboard. Grab peanut butter jar. Go to fridge. Grab jelly. Go to counter. Grab bread. Deposit all items to cutting board. Realize you forgot to grab a cutting board. Grab cutting board. Place cutting board in workspace. Deposit all items to cutting board. Grab 2 slices of bread. Realize you have the wrong kind of bread. Go to counter. Grab the right kind of bread. Go to cutting board. Deposit bread. Grab 2 slices of bread. Name the first slice bread0, name the second slice bread1. Hold the knife and spread the peanut butter on bread0. Realize you didn't get a knife to spread the peanut butter. Go to the drawer. Grab a knife. Deposit the knife to the cutting board. Grab the knife and spread the peanut butter on bread0. Use the same knife to spread jelly on bread1. Realize you didn't wipe the knife off first, so you're adding peanut butter into the jelly. Realize you don't have anything to wipe the knife off with. Go to the counter. Grab the paper towel. Deposit the paper towel to the cutting board. Wipe the peanut butter off the knife with the paper towel (stackoverflow: "use the bread's built-in function next time, you inefficient wasteful heathen! also, this was closed because it was tangentially asked 6 years ago"). Use the knife to spread the jelly. Put the knife down. Realize you don't have hands to put the bread together with. Invent hands. Put bread together. Grab the peanut butter. Grab the jelly. Grab the bread. Grab the paper towels. Grab the knife. Grab the cutting board. Put each thing away. Realize you put the cutting board and knife away without cleaning them. Clean them. Put them away. Realize the sandwich was on the cutting board when you cleaned it. Make new sandwich. Grab the sandwich, deposit it to the counter. Re-do the cleaning. Grab the sandwich from the counter. Open the jaw and bite the sandwich. After every bite, chew and swallow, until there is no more sandwich."

Assembly: "First, gather yeast which will be used to make bread with..."

connorskudlarek
Автор

When I hear programmers say they program in Rust it reminds me of all linux distro hoppers saying I use Arch btw. Unno why -- but I wanted to share my input.

quelchx
Автор

I find rust quite easy to refactor... I can fearlessly move multiple files around and separate a whole bunch of functions and types out into different modules.. Then just hit compile and the compiler and rust-analyser will walk me through fixing everything... Library code can be hard to read but a lot of application code with the expressive type system can be quite easy to read or at least understand an overview of how things work

tyrellnelson
Автор

As far as speed.. I DID make Rust faster than Go... don't get me wrong, Go is faster than shit! But here is the thing, Rust is actually faster in many cases; BUT!!! The compiler is not optimized for speed, it is optimized for safety. So, if you tell the Rust compiler that you prefer speed, it WILL deliver. I have done so many tests between the three (Rust, Go, C++) - from something simple like just iterating to 1 BILLION, to some more advanced stuff like prime sieves... with Rust, the trick is not optimizing the code, the trick is learning the compiler.

AndrewErwin
Автор

Coming from C++ through rust to zig and C, I realized that if you need to constantly debug your knowledge about the language, there is something wrong with the language. Sure If you already spent so many hours writing in such language that you are a chad then ok, but when I came from C++ and then started learning rust, I just said after sometime 'fuck it i don't want to go through such deep rabbit hole again'.

However sometimes I get drawn into rust, because I see all those people around bathing in rustelitism and I envy...

regbot