JuliaCon 2020 (times are in UTC)

Continuables.jl: Python yield in Julia in blazingly fast
07-30, 17:10–17:20 (UTC), Green Track

When coming from Python (or C#) you may be like me and love using generators yield a lot. Of course I wanted to have this in Julia, too, and wanted it to be blazingly fast. Unfortunately, the recommended approach using Julia Channels is everything else but super fast. That motivated me to build a solution which in many cases can compile down to perfect machine code: Continuables.jl.


I want to present you the simple idea behind Continuables.jl, to interprete yield as withhold computation. Continuables.jl lets you define a generator with @cont and use cont() as the new yield. "cont" stands for continue, which hints at the implementation: A continuable simply expects a function which it can use as the cont() placeholder.
With this basic idea (plus some details) you get many of the standard iterable functionalities and the code compiles perfectly.

Stephan Sahm is senior consultant at Machine Learning Reply for Data Science and Data Engineering. As an outstanding
master of cognitive science, master of stochastics, as well as a
passionate professional programmer he strives towards bringing tomorrow’s Data Science into today’s business.

He launched and organizes the Julia User Group Munich, the main driver for establishing Julia within Munich's Data Science community.