Actually, Rust strenght is allowing you to write high-level code (iterators) and make it fast. You can pretty much copy this code to C#, Haskell, Elm, F#, Kotlin etc and it will work in the same way. If you do some tricks in C# (like use structs, spans [stack allocated array]), Rust isn't even THAT much faster
once_cell might be better than lazy_static now (since it's on track to be added to the standard library, and avoids macros). Also for the top_3 case using smallvec / tinyvec might be a good trade-off between ergonomics and not allocating.
I actually started to use once_cell lately (i don't think it was in the std at the time of this talk, or certainly it wasn't when I was doing AoC :D). I didn't know about smallvec and tinyvec. I must give them a shot! Thanks a lot for the comment and the suggestions.
so, Vector vs fixed size array difference is actually quite big. Compiler can use the fixed size for optimization. array.rev().take(1) can be optimized to array[array.length -1] and so on - the Primagen has video on this :)
can't you simply use array.last() instead? time complexity would remain the same but space complexity should be vastly better as we are not storing the entire vec, right?
@@theycallmesloth that would work, but in runtime. The point I made was that with fixed length arrays this can be done in como time. For example a for loop on array.rev().take(5) can be compiled as a series of accesses instead of a loop. In comp time, working directly on the pointer.
great presentation / thank you very much. I currently try to learn Rust on solving AoC 2019 - today on day 14. But I'm not so hardworking in refactoring a running solution 🙂 Congratulations for your learnings on refactoring.
Hello Harry and thanks a lot for this awesome piece of feedback! I think I often end up over-engineering my solutions just because I end up taking all the excuses I can see to try something new. I think there's merit in trying to be pragmatic, get the exercises done and move on to the next one. Everyone is a bit different in how we solve exercises and how we learn and that's the beauty of it!
I tried posting the link here but youtube doesn't like me doing that (maybe pending in some moderation queue). You can see the slide link in the first slide at the beginning of the video (cover slide, just under my name)
No way an hour just passed… I really enjoyed the presentation, time flew 🎉
Thank you, Ricard :) this means a lot to me since this was my very first talk at a Rust conference (and I was freaking out about it :D )
wow, this was pretty cool talk. thank you.
coming from JS and C# to rust has been a real breath of fresh air. Iterators in rust are just beyond fun! Great talk tooo.
Thanks a lot! I really appreciate this kind of feedback :)
I really liked your talk, thanks Luciano! Wish you do more talks in a similar format.
Ciao Luciano! What a great debut talk! I'm currently learning rust and can relate to many things you mentioned.
Thanks! It was great to see these real-world examples.
This talk was great. I need to remember that traits are so useful and it was good to learn that const generics exist. Thanks for that.
Low level programming is another world. Really amazing and educational.
Indeed! Thanks for your comment. I am glad you liked the talk
Actually, Rust strenght is allowing you to write high-level code (iterators) and make it fast. You can pretty much copy this code to C#, Haskell, Elm, F#, Kotlin etc and it will work in the same way. If you do some tricks in C# (like use structs, spans [stack allocated array]), Rust isn't even THAT much faster
I've been surprised that functional solution is so easy to think, since people assumed that functional programming is hard.
Really thorough analysis!
I'd love another talk with the listed at the end items.
Thanks, Oleks! I can't promise anything right now, but I added that idea to my list of TODOs, so stay tuned :P
Great talk! I have been on and off AOC, and this year I hope to solve the problems in Rust! So thanks for all the helpful pointers!
once_cell might be better than lazy_static now (since it's on track to be added to the standard library, and avoids macros).
Also for the top_3 case using smallvec / tinyvec might be a good trade-off between ergonomics and not allocating.
I actually started to use once_cell lately (i don't think it was in the std at the time of this talk, or certainly it wasn't when I was doing AoC :D). I didn't know about smallvec and tinyvec. I must give them a shot! Thanks a lot for the comment and the suggestions.
Awesome talk, really enjoyed it!
thank you!
so, Vector vs fixed size array difference is actually quite big. Compiler can use the fixed size for optimization. array.rev().take(1) can be optimized to array[array.length -1] and so on - the Primagen has video on this :)
Thanks for your lovely comment. I should check that video out!
can't you simply use array.last() instead? time complexity would remain the same but space complexity should be vastly better as we are not storing the entire vec, right?
@@theycallmesloth that would work, but in runtime. The point I made was that with fixed length arrays this can be done in como time. For example a for loop on array.rev().take(5) can be compiled as a series of accesses instead of a loop. In comp time, working directly on the pointer.
great presentation / thank you very much.
I currently try to learn Rust on solving AoC 2019 - today on day 14. But I'm not so hardworking in refactoring a running solution 🙂
Congratulations for your learnings on refactoring.
Hello Harry and thanks a lot for this awesome piece of feedback! I think I often end up over-engineering my solutions just because I end up taking all the excuses I can see to try something new. I think there's merit in trying to be pragmatic, get the exercises done and move on to the next one. Everyone is a bit different in how we solve exercises and how we learn and that's the beauty of it!
Very good presentation and thank you for advice and analyses you did.
Thank you! Really appreciate the feedback
Amazing talk!
Thanks, Roberto! :) You deserve a big one
awesome talk
Thanks a lot!
loved the talk
Thank you, Richard! This kind of feedback helps me a lot!
Very nice video
tnx a lot!
Implement a trait on a trait: 24:20 Cool.
"it's traits all the way down" 🐢
ah, ma c'è Luciano?! Ok, prima metto like e poi guardo il video
LOL, Grazie mille Emanuele! :) Non so se si vede che me la stavo facendo sotto all'idea di parlare in una conferenza su Rust :D
I went to download the slides using the link 48 seconds in and the link has expired. Any chance of posting the slides?
I tried posting the link here but youtube doesn't like me doing that (maybe pending in some moderation queue). You can see the slide link in the first slide at the beginning of the video (cover slide, just under my name)
💛💚💙💜🦀🤝💯
💌🦀💌
juniors are doomed