Discussing effects in Rust's type system

  Рет қаралды 1,167

timClicks

timClicks

Күн бұрын

Пікірлер: 13
@vei_bean
@vei_bean 7 ай бұрын
8:40 functions in rust already have a type that is unique to each function, and they all implement traits those being Fn FnMut and FnOnce, they also are implicitly converted to fn pointers when necessary idk if that is done through Deref. Closures are similar, with the exception they can't be converted to fn pointer if they capture any variables. The behaviour you are looking for is almost what we have with the Fn traits and closures, that being implicitly implementing the trait based on how the closure interacts with its environment, the only difference being you want the trait to be implemented if a function called implements it. At some point it will need to implemented explicitly, especially if you want to allow custom traits, which may or may not have to be marked as this special kind of trait. btw fun fact the Fn traits are actually the traits for the fn call operator so you can impl them on a struct and call it like a function tho there is a caveat that you need to some funky dereferencing to convince the compiler that it is a function, something like (&&T)()
@timClicks
@timClicks 7 ай бұрын
Thank you so much for the added context. When recording this ad lib, those details were not coming to me!
@ericshimizukarbstein6885
@ericshimizukarbstein6885 7 ай бұрын
I personally feel that coloring in effect system languages is sort of different. All langs I saw that have effect system have a syntactic unified way to handle effects, removing that effect coloring on the used function, so if you have a function f1 that has the IO effect and you use it in function f2 but f2 handles IO effect inside, it won't have the IO effect
@timClicks
@timClicks 7 ай бұрын
The difficulty for Rust would be how to create that unified feel when effects would need to be bolted on to a pre-existing language. However, my own knowledge is quite limited in this area which is one of the reasons why I published this video. I was hoping to foster some of the informed discussion like your comment. Thank you!
@ericshimizukarbstein6885
@ericshimizukarbstein6885 7 ай бұрын
Yeah, I agree on that difficulty for Rust, and I don't even have an idea of how that could be accomplished for Rust. My knowledge in this area is also limited, I just have about a couple of months of experience trying and reading about effect system languages, but that aspect was the thing I saw in common between the 4 languages I tried out. Thank you for bringing that subject up! I think these should be discussed more and on more platforms!
@JhraumG
@JhraumG 7 ай бұрын
No matter the resolution I choose, the video is at 14fps 🧐
@superstarben37
@superstarben37 7 ай бұрын
Completely offtopic, is there any particular reason why this video is at 1080p 14fps? It's definitely *very* choppy, almost distracting even
@LibreGlider
@LibreGlider 7 ай бұрын
Its at 2160p for me def not 14 fps.
@timClicks
@timClicks 7 ай бұрын
14 fps sounds very odd. Perhaps YT is downscaling to conserve bandwidth? Try selecting your own quality with the gear icon.
@Hellbending
@Hellbending 7 ай бұрын
Yeah, I'm with you on this one mate, hellaaaaaaaaa choppy idk what's happened here
@zachhoward9336
@zachhoward9336 7 ай бұрын
Same
@MarcusBrito
@MarcusBrito 7 ай бұрын
Good discussion, Tim. A lot of people already think Rust is too complex, adding an effect system is bound to make that worse - unless we can make it completely opt-in; not like async where it taints/colors return types, but truly opt-in, as in you could write a program with effects disabled while using effects-awae libraries. I don't know how that could be done. Even if that could be done, do we want Rust to become one of those languages so full of features that very few people can master it, like C++, or some might add, Scala? Rust today might not be simple, but it's very composable; there are a few building blocks (functions, traits, lifetimes), and after you get them, you get everything else.
@timClicks
@timClicks 7 ай бұрын
Thanks Marcus. I'm not sure either. I presume that's why it will take a lot of delicacy to design.
RustConf 2023 - Extending Rust's Effect System
29:53
Rust
Рет қаралды 9 М.
Interview with Senior Rust Developer in 2023
9:46
Programmers are also human
Рет қаралды 743 М.
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 254 МЛН
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 13 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
Why start a conference series on Rust? 🦀
4:42
timClicks
Рет қаралды 650
iced GUI | Rust Language
17:00
Learning Rust
Рет қаралды 10 М.
Modern Python logging
21:32
mCoding
Рет қаралды 205 М.
Type Theory for the Working Rustacean - Dan Pittman
19:24
Rust Belt Rust Conference
Рет қаралды 18 М.
Mind-bending new programming language for GPUs just dropped...
4:01
Why Rust is NOT a Passing Fad...
8:54
Travis Media
Рет қаралды 44 М.
Ukraine has nuclear weapons? / Important statement
11:20
NEXTA Live
Рет қаралды 389 М.