You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compilation for async for comprehensions is not yet implemented #2510
i.e. [x async for y in z]. There's an unimplemnted!("async for comprehensions") in compiler/src/compile.rs, which is where an implementation could start out. Take a look at how normal compile_for works for async and how compile_for's non-async implementation is structured somewhat similarly to compile_comprehension.
@coolreader18 I'm looking into this, not committing to when I can implement it. However, I was wondering if there was a good guide for the Instruction enum? I can generally get an idea for each operation. However, I have never really worked on a programming language, so a guide, definition, or something would be amazing.
@aaronclong ah, we don't really have that, the closest thing would be doc comments on the enum variants but there aren't many. That's definitely something to improve. However, you can check the CPython docs for the dis module, we share many of the same instructions (although renamed to CamelCase, obviously) and you can usually check how CPython compiles things using dis.dis() for inspiration for how to do it in our compiler
#5276 adds basic async for comprehension support. but still missing lots of features.
Including compile error (test_asyncgen.test_async_gen_expression_02) and runtime error (test_asyncgen.test_async_gen_expression_01)
Activity
aaronclong commentedon Mar 4, 2021
@coolreader18 I'm looking into this, not committing to when I can implement it. However, I was wondering if there was a good guide for the
Instructionenum? I can generally get an idea for each operation. However, I have never really worked on a programming language, so a guide, definition, or something would be amazing.coolreader18 commentedon Mar 4, 2021
@aaronclong ah, we don't really have that, the closest thing would be doc comments on the enum variants but there aren't many. That's definitely something to improve. However, you can check the CPython docs for the dis module, we share many of the same instructions (although renamed to CamelCase, obviously) and you can usually check how CPython compiles things using
dis.dis()for inspiration for how to do it in our compilerHyeockJinKim commentedon Aug 7, 2021
If no one is working on this issue, can I take this issue?
DimitrisJim commentedon Aug 7, 2021
@aaronclong are you available to finish this up?
youknowone commentedon Apr 25, 2024
#5276 adds basic async for comprehension support. but still missing lots of features.
Including compile error (test_asyncgen.test_async_gen_expression_02) and runtime error (test_asyncgen.test_async_gen_expression_01)
youknowone commentedon Dec 25, 2025
now it is supported