Maintained Views

Ordinary functions produce all computed values. Atlox does not require a Query<T> or separate view value type to expose runtime planning.

fn openTickets() -> Map<Int, Ticket> {
  tickets.filter((_, ticket) => ticket.open)
}

openTickets() means a map value. Whether that value currently exists in memory, is represented by a database plan, or is maintained incrementally is not part of its type.

Planning without semantic leakage

The compiler records dependencies and a logical collection plan. It may:

  • inline the function into its caller;
  • scan authoritative state;
  • use an index;
  • maintain the result from typed deltas;
  • place a replica near a consumer;
  • serialize the complete value only at an external boundary.

The result must behave like the same immutable map in every realization.

Maintained commitments

The deeper runtime unit is a relationship to maintain: given these sources, preserve this result under these guarantees.

A browser list, search index, revenue aggregate, and analytical projection differ physically, but all can be generated from a maintained relationship in the program.