---
# System prepended metadata

title: 'C++ backend integration: unstructured and refactoring'
tags: [functional cycle 11]

---

# C++ backend integration: unstructured and refactoring

###### tags: `functional cycle 11`

Appetite: Full cycle

Goal: if reasonable make most of the current tests work with the C++ backend

Developer: Rico + a new person?
Support: Peter/Hannes?


## Steps
1. finish the infrastructure & faster builder (PR in working state, cleanup + more tests required)
2. support unstructured domain
3. support additional argument types (tuples, IndexFields, ConstantFields, etc)
4. there may be more

## Rabbit holes
- Trying to anticipate additional future workflows in the infrastructure design is overkill, since it is lightweight and can be changed / extended easily. Example: branching workflows
- Trying to get caching right will probably be it's own project (or series thereof)

## Infrastructure
Where it sits in GT4Py:

```IR -> source -> python bindings -> compiled python module -> python function```

- end points can be chosen
- useful for external integrations, CLI etc

Usage snippet
```python=
workflow = Workflow.from_steps([
    ir_to_src,
    add_bindings_to_src,
    make_compiler(
        ... # compiler flags, caching strategy etc
    ),
])

run_compiled_fencil = workflow((myfencil, *args, **kwargs))

run_compiled_fencil(*args)
```

How it works:
- each step takes only one argument (can be a tuple)
- any configuration for a step has to be done while constructing the workflow
- no branching in workflows implemented but could be considered in the future
- caching ideally implemented as a step(s), (not yet done)