#generators

[ follow ]
fromFortune
2 weeks ago

Russian attacks on Ukraine's energy infrastructure are the biggest threat to its economy, which could shrink as much as 3% | Fortune

It is pre-dawn in the historic Podil district of the Ukraine capital, Kyiv, and warm light from the Spelta bakery-bistro's window pierces the darkness outside. On a wooden surface dusted with flour, the baker Oleksandr Kutsenko skilfully divides and shapes soft, damp pieces of dough. As he shoves the first loaves into the oven, a sweet, delicate aroma of fresh bread fills the space.
Miscellaneous
#javascript
fromAlex MacArthur
1 month ago
JavaScript

I used a generator to build a replenishable queue.

Use generators plus promises to implement a replenishable FIFO queue that stays alive and pauses when empty, resuming when new items arrive.
fromAlex MacArthur
9 months ago
React

I think the ergonomics of generators is growing on me.

JavaScript's recent syntactic sugar enhances programming by addressing real pain points, while the practical use of generator functions remains less established.
Python
fromMathspp
3 months ago

A generator, duck typing, and a branchless conditional walk into a bar

Generators provide lazy evaluation in Python, enabling iterable objects like range to create values on demand and avoid upfront computation.
Python
fromAntocuni
15 years ago

Improving Memory Behaviour to Make Self-Hosted PyPy Translations Practical

Deallocating unused JIT-generated loops via a loop_longevity policy dramatically reduces PyPy translation memory usage, enabling successful 32-bit compilations and lower RAM on 64-bit.
[ Load more ]