Sabitlenmiş Tweet
@ericniebler.bsky.social
7K posts

@ericniebler.bsky.social
@ericniebler
C++ core compute libraries tech lead at @nvidia, husband, father, @isocpp member, former nomad, and sometimes artist wannabe. Views are mine, not my employer's
Seattle, WA Katılım Eylül 2010
137 Takip Edilen12K Takipçiler

@ashvardanian @lewissbaker @andreas_buhr Sorry for the lag, I'm on the butterfly site now.
Making coroutines go fast is all about structuring the code so that the compiler can elide the dynamic allocation of the coroutine frame. It depends on your compiler. Play around in godbolt and look at the assembly.
English

I'm struggling with C++20 coroutines and must be doing something wrong. Is there some smart (maybe Assembly-level) optimization that can help close the gap between ranges and coroutines?
cc @lewissbaker @ericniebler @andreas_buhr
#L1562-L1993" target="_blank" rel="nofollow noopener">github.com/ashvardanian/l…

English

Did grade school suck for you because you were a "problem child" (read: neurodivergent)?
Yes?
My partner @MERottsolk has created the school that we didn't have when we were kids, a place where different is normal. And they're fund raising.
Click here:
zeffy.com/en-US/fundrais…
English

@static_assert_0 @Nekrolm It's supposed to be is_void_v.
English

@Nekrolm @ericniebler Not sure if it’s a typo, but the code as written all compilers agree on lol
English

@PatriceRoy1 C++17, but it should be is_void_v, I messed it up.
English

@oisyn @Peregringlk oh! you're right of course. silly me.
English

@ericniebler @Peregringlk It is a variable declation of a *function pointer*, the return type of that function that it points to is the whole point of declval 😄.
But to answer my question, yes it appears to work!
compiler-explorer.com/z/7nasG37sx

English

@oisyn @Peregringlk you can use trailing return types in function declarations. this is a variable template declaration. there is no return type.
English

@ericniebler @Peregringlk Can't you use trailing return syntax in pointer declarations? Generally wondering if that's actually allowed.
English

@__phantomderp i suppose nothing is stopping a compiler implementors from replacing `std::declval` with an intrinsic.
English

@ericniebler We keep doing this experiments and keep coming up with these gains but have we considered just... making this stuff be part of the language? Like it's fun to be able to flex our muscles like this but the language can't be too pure to literally add something like this in it right?
English

@CoderCasey @wakomeup @LouisDionne ... and this implementation is 3x faster than the standard `declval`, but it doesn't handle abominable function types correctly. <shakes fist>

English

tagging some stdlib implementors: @CoderCasey @wakomeup @LouisDionne. Also, thanks to @LouisDionne for his wonderful metabench tool: github.com/ldionne/metabe…
English

@Peregringlk it's not strictly needed, but it looks funny using the raw C declaration syntax:

English

@pixibonnie you have your wish! i live-coded part of this for CppEurope '22.
youtube.com/watch?v=xiaqNv…
i didn't have time to get to the when_all algorithm and cancellation though. that would need another hour.

YouTube
English

@ericniebler Would love to watch you walk through or develop something like this in a youtube video! 🙏🏻
English

What comes after "Write a simple sender"?
This gist shows how to implement `just`, `then`, `when_all`, `run_loop`, `sync_wait` and more, and it doesn't leave out the cancellation bits.
And it's only ~500 LOC.
gist.github.com/ericniebler/dd…

@ericniebler.bsky.social@ericniebler
This remains my favorite tweet about senders.
English




