Тёмный

Comparing Rust Traits to C++ Concepts 

Coding with Mat
Подписаться 2 тыс.
Просмотров 324
50% 1

🚀 Ayo! Today we're doing yet another modern C++ stream, where we develop a little profiler tool for my 6502 emulator. In the process, we will talk about how we can use C++20 Concepts to improve compiler errors and development of generic code.
🖥️ I will go over how this works in other languages (like Rust and Golang), and how C++ differs in the implementation of traits/concepts/interfaces.
👨‍💻 Get ready to pair program with me! Tune in to learn, ask questions, and geek out over the coding journey! 🔥
Looking forward to seeing some of you in this cosy Saturday evening 👊
#concepts #cpp #modern #programming
🔗🔗🔗🔗Important Links🔗🔗🔗🔗
Github project: github.com/matheusgomes28/bas...
📱📱📱📣📣Socials📣📣📱📱📱
discord - / discord
twitter - / codingwithmat

Наука

Опубликовано:

 

11 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 5   
@heavymetalmixer91
@heavymetalmixer91 24 дня назад
What you mentioned around 10 mins mark is that Rust is kinda like a GCed language?
@codingwithmat
@codingwithmat 24 дня назад
What I meant is that "drop" in Rust doesn't behave in the same way destructors do in C++. I.e. if you create a struct in Rust at the top of a function and never use it again in the stack, it will be dropped before the end of the function. In C++, the guarantee is that the destructor will be called at the end of the function, making it easier to have a profiler class with that behaviour -> start timing when the object is created, and when object is deleted we save the profile timing :)
@codingwithmat
@codingwithmat 24 дня назад
and to answer the question: Rust isn't a garbage collected language .
@heavymetalmixer91
@heavymetalmixer91 24 дня назад
@@codingwithmat Thanks for both answers, the topic of reference-counting (which I was told Rust does in some way) is complicated sometimes.
@codingwithmat
@codingwithmat 23 дня назад
@@heavymetalmixer91 It is indeed, this is how I think Rust works: when the variable is no longer used, drop it. Reference counting happens in more detail in objects like `std::shared_ptr` in C++, where we keep track of how many different references there are to an object before we're allowed to destroy it. The equivalent in Rust would be a `Rc` object.
Далее
You MUST KNOW These Traits in Rust
18:36
Просмотров 10 тыс.
When someone reclines their seat ✈️
00:21
Просмотров 19 млн
CyberBrawl - The Last Sacrifice
01:35
Просмотров 838 тыс.
C++20 & Rust on Static vs Dynamic Generics
10:29
Просмотров 40 тыс.
Advanced Golang: Generics Explained
13:37
Просмотров 54 тыс.
All Rust features explained
21:30
Просмотров 280 тыс.
Interview with Senior Rust Developer in 2023
9:46
Просмотров 631 тыс.
Rust vs 7 Other Languages You Probably Haven't Tried
8:55
5 traits your Rust types must implement
10:39
Просмотров 55 тыс.
Rust for the impatient
10:43
Просмотров 653 тыс.
Lost Vape Ursa Pocket
0:17
Просмотров 87 тыс.
How charged your battery?
0:14
Просмотров 3,5 млн
Первый день на Computex 2024! 🔥
48:18
Просмотров 24 тыс.
wyłącznik
0:50
Просмотров 24 млн