context manager plugin API in nac3core #23
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#23
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
So nac3embedded can implement
with parallel
/with sequential
.What should we pass to
__exit__()
? PEP343 requires the signature of the exit function to be__exit__(self, type, value, traceback)
, i.e. exception type, exception value, traceback. We probably won't have these...?I don't think this is relevant for the special context managers at hand - they would be AST transforms, implemented in Rust, and not behave like regular Python context managers.
Supporting user-defined context managers in kernels is another issue and a very low-priority one.
OK, so the context manager API you mentioned is for AST transform but not for the actual python one right? Why not implement it at the application level? The transform would be mostly application code instead of the core compiler code anyway.
Could codegen become a trait? Then the application would have a lot of flexibility to intercept those special context manager AST nodes and emit corresponding LLVM IR.
Doing a pure AST transform is a pain for the reasons explained in https://github.com/m-labs/artiq/issues/1555#issuecomment-922652441
done