Тёмный

Monads in Modern C++ - Georgi Koyrushki and Alistair Fisher - ACCU 2023 

ACCU Conference
Подписаться 16 тыс.
Просмотров 6 тыс.
50% 1

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

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@GxdKxller
@GxdKxller Год назад
Would have loved to see a performance overhead graph for this
@bernhardmanfredgruber7156
@bernhardmanfredgruber7156 Год назад
yeah, I immediately wondered about that with the std::vector monad, turning a single loop with three elemental functions into three. I wondered if the compiler can fuse the loops back again, otherwise there would be three passes over memory instead of one.
@georgikoyrushki7825
@georgikoyrushki7825 11 месяцев назад
Things like std::ranges would do a single iteration with the functions applied all together on each element. Would translate more or less to the imperative way of doing it. I have attended a few talks recently mentioning that higher level, more expressive abstractions, actually end up allowing the compiler to carry out better optimizations. Ending up being faster in the end, contrary to what you would think. Either way, the talk was more going over the concepts, rather than worrying over performance. It should have been mentioned that if you're on a hot path within a low latency environment: always carry benchmarks when choosing ur poison. For a general purpose use case, however, you would win on average, if you go for the simpler, more expressive and understandable way of doing things.
@ErikBongers
@ErikBongers 7 месяцев назад
The main reason to write an algorithm in a functional way: "So, here I wrote an imperative version of this [...] there's nothing particularly wrong with this code [...] but I didn't really feel very fulfilled writing this code..." ok...
@coolben601
@coolben601 2 месяца назад
Great talk!
@TheTimur123
@TheTimur123 Год назад
how to get the pdf of this? please, provide the link to download the pdf of this!!! Thank you!!!!
@ACCUConf
@ACCUConf Год назад
Sorry that the slide repository is not yet available. We shall correct this asap. Thank you!
@aniketbisht2823
@aniketbisht2823 Год назад
awesome!
@ACCUConf
@ACCUConf Год назад
Thanks!
@gonzajuarez4918
@gonzajuarez4918 Год назад
I've recently started paying attention to the sender/receiver proposal. Receivers, representing some sort of callback, remind me a lot of continuation passing style. There is one of eric niebler's talk from cppcon 21 where he explains the nesting of operation_state, senders, and receivers, and it looks a lot like an explanation on CPS. Squinting your eyes hard enough, it is possible to see a bit of the Cont monad spill from senders/receivres. Haskell with Cont monad: factorialS :: Int -> Cont r Int factorialS x = reduceS (*) 1 (rangeS x) where rangeS x = return [1..x] reduceS op init xs = fmap (foldl op init) xs C++'s libunifex library: auto factorialS (int x) { return range_stream{1, x + 1} | reduce_stream(1, [](int acc, int x){ return acc * x; }); } One difference I've found so far is that recursive definitions of functions are not possible - skill issue? - due to senders being template expressions (the whole expression must be in the code at compile time). But recursive schemes can be achieved through sender algorithms anyways ;)
Далее
Being Competent With Coding Is More Fun
11:13
Просмотров 85 тыс.
МАЛОЙ ГАИШНИК
00:35
Просмотров 342 тыс.
Microservices are Technical Debt
31:59
Просмотров 383 тыс.
Moving back to JavaScript after my Elixir journey
15:46
Java 23 - Launch Stream
3:16:18
Просмотров 18 тыс.
C++ Coroutines From Scratch - Phil Nash - ACCU 2023
1:16:12