RustConf 2023 - How Powerful is Const

  Рет қаралды 12,718

Rust

Rust

3 ай бұрын

Пікірлер: 11
@knolljo
@knolljo 3 ай бұрын
Const generics look very interesting to me, especially since i like the typestate pattern and const generics look like they could be an easy way to implement it
@dmitriidemenev5258
@dmitriidemenev5258 3 ай бұрын
I've implemented yet not published the crate called ctoption (compile-time option). They allow to do that.
@Babakinha
@Babakinha 2 ай бұрын
16:18 Meta programming flashbacks (。o_o。)""
@RootsterAnon
@RootsterAnon 3 ай бұрын
👏👏👏👏 nice presentation, really enjoyed the deep dive into consts and what they can offer at certain depth level. I mostly use it very basically but now I see that there are more stuff to learn about them.
@jocketf3083
@jocketf3083 2 ай бұрын
Awesome!
@9SMTM6
@9SMTM6 3 ай бұрын
Sure the AppendNull struct works correctly? I don't know whether alignment could not mess that up, I sure am not certain that a single u8 is never handled differently with alignment from a corresponding slice. I would certainly try to test/ assert that the resulting byte pattern for at least some tests (up to the total size of 64 bit) is the same as with manually adding a terminating null. Alternatively, I believe using repr(packed) provides stronger guarantees.
@Baptistetriple0
@Baptistetriple0 3 ай бұрын
if you look at the book on data layout, the repr(C) guarantees that the alignement is 1 with the AppendNull struct as it is aligned with the biggest field alignement (so 1 here as [T] has the same alignement as T), and the algorithm that is used to calculate fields offset also guarantees that when all fields have the same alignement there is no padding. repr(C) also guarantees field ordering, something repr(packed) nor repr(Rust) guarantees. Sure you could use repr(C, packed) and be absolutely sure, but it is already well defined with just repr(C).
@KyleSmithNH
@KyleSmithNH 3 ай бұрын
Could the usize example be solved with a cfg directive?
@nvzqz
@nvzqz 3 ай бұрын
Yes but you would need to handle each pointer width. This approach works with a single statement using a bool condition, which is simpler in some regards.
@davidjaz7663
@davidjaz7663 3 ай бұрын
The people yearn for dependent types…
@sayaks12
@sayaks12 2 ай бұрын
how would that even work when rust is a completely type erased language?
RustConf 2023 - Profiling async applications in Rust
30:11
Did you find it?! 🤔✨✍️ #funnyart
00:11
Artistomg
Рет қаралды 67 МЛН
ISSEI funny story😂😂😂Strange World | Magic Lips💋
00:36
ISSEI / いっせい
Рет қаралды 125 МЛН
格斗裁判暴力执法!#fighting #shorts
00:15
武林之巅
Рет қаралды 31 МЛН
Learning Rust the wrong way - Ólafur Waage - NDC TechTown 2022
51:54
NDC Conferences
Рет қаралды 97 М.
Async Rust: the good, the bad, and the ugly - Steve Klabnik
46:20
All Things Open
Рет қаралды 9 М.
Use Arc Instead of Vec
15:21
Logan Smith
Рет қаралды 131 М.
Rust Before Main - Ryan Levick - Rust Linz, July 2022
31:34
RustConf 2023 - The Art and Science of Teaching Rust
28:01
Nicholas Matsakis - Rust 2024 and beyond
33:48
Rust Nation UK
Рет қаралды 10 М.
Jon Gjengset - Towards Impeccable Rust
55:59
Rust Nation UK
Рет қаралды 21 М.
Phone charger explosion
0:43
_vector_
Рет қаралды 54 МЛН
Introducing GPT-4o
26:13
OpenAI
Рет қаралды 3,5 МЛН
Я Создал Новый Айфон!
0:59
FLV
Рет қаралды 3,1 МЛН
Я Создал Новый Айфон!
0:59
FLV
Рет қаралды 3,1 МЛН