google / google/heir

Support multiple functions in Python frontend

Open
#1,312 1 comment 0 reactions 0 assignees View on GitHub
python frontend
Dominant language
MLIR
Stars
906
Forks
171
Avg merge
4d 12h
Merged PRs (30d)
32

Description

Currently, the frontend primarily relies on a decorator that captures a single function.

```python
@heir.compile()
def foo():
# ....
```

There seem to be (at least) two ways to achieve multiple function support:
* have multiple decorated functions and use global state to collect all the functions
* use a ContextManager:
```python
with heir.compile():
def foo():
# ....

def bar():
# ....
```

I'm currently leaning towards the latter version, but since there's plenty of C++-side work that needs to be done first to fully support this, we have some time to decide.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.