News for hackers. Stuff that matters.
Re:My favorite prime number generator by vlovich123 on Wednesday August 23, 2023 @02:27PM (#37240192)
> but languages like C/C++/Rust would not have pretty code because it does not have yield

Maybe I'm misunderstanding you, but Rust has native generators with yield: https://doc.rust-lang.org/beta/unstable-book/language-featur...

C++ also does using coroutines + co_yield (https://en.cppreference.com/w/cpp/language/coroutines#co_yie...) or iterators (old syntax).

There are no comments on this comment yet.