---
# System prepended metadata

title: Vertical slice and lowering of FieldView
tags: [functional cycle 7]

---

# Vertical slice and lowering of FieldView

###### tags: `functional cycle 7`

Appetite: first 1/2 cycle (Rico, Till)

## Goals

1) Allow a copy field operator to be defined using the field operator decorator
2) Allow a copy stencil program ("fencil") to be created using the field program decorator
3) The return value of the field program decorator is executable throught the embedded execution prototype
4) Repeat the above for as many FieldView language constructs as are implemented in the parsers already

The software design should take future requirements into account:

* The lifting and deref-ing in the lowering to IteratorIR should follow the simplest possible logical rules (the current special casing must be replaced)
* Decorators should contain only one call to a public API and no logic
* Decorators should return objects that handle parsing of the given function and creation of the executable objects (implicitly or on-demand)

Ideally parsers should have unified interfaces where possible, etc.

Currently parsed:
* arithmetic and logical operations
* composition
* shifting

End-to-end tests for the supported functionality are explicitly part of this project.

## Stretch Goals

* clean out gtc or older code from the functional branch.
* Enabling field-view syntax constructs that aren't parsed at the moment should only be undertaken after everything else is merge-ready (Tests and docstrings and all)
* If we get this far, features required for simple ICON stencils are to be prioritized.

## Non-Goals
* Editing the embedded prototype (unless can't be avoided)

## Todos

A list of todos encountered during the project. Not necessarily part of the project itself.

- Equalize naming of function args (sometimes params (ir), sometimes args (types))
- Convention for dynamically generated symbol names
- Closure ints, floats, externals etc.
- Field datastructure in geranal
  - They currently do not support non-zero starting range
  - The interface in the Iterator embedded prototype is not user friendly and needs to be reworked
  - Offset / Axis is confusing / wrong as it is in the Iterator IR right now
- PAST type deduction tests
- Rename type attr in nodes and common_types to type_
- Typeinfo / type system
  - Designed as simple system, but some methods are already complicated to understand (i.e. is_complete)
  - {past, foast}.Expr.type use deferred type as default
- Better error messages for invalid calls in foast (signature checks)
- Improve file structure of frontend and tests
  - For someone new to the frontend it is hard to find what components belong together
- Split decorator file into its part and place the GTCallable interface in a seperate file
- Truely embedded execution GTCallable: __call__, from_function
- Add constants to foast (mul by 2 doesn't work)
- Typing of Iterators for beautified iterator (and raw ITIR)