Engine type & terminology

I find the term engine family confusing and unnecessary in specs v2.

In v1 we used engine to refer to the type of an engine, and engine instance to refer to a specific instance of an engine.

In v2 engine family is used to refer to the type of an engine (thus family is a synonym for type), and engine sometimes refers to an engine instance (it is defined as a synonym for an actor and used as a synonym for an engine instance), and sometimes refers to a family, e.g. since Engine Family Environment is too long and cumbersome, it’s often shortened to Engine Environment anyway*, leading to inconsistencies.

I’d find it much more clear to use the already known type and instance terminology from type system theory, i.e. engine type and engine instance, and use engine as a synonym for engine type.

This way we don’t need to introduce a new term (family) that readers are unfamiliar with, and would have simpler and more natural terms too.

Then we can define Engine as:

The Engine type encapsulates the concept of engines within Anoma.

type Engine (S M H A L X : Type) :=

And refer to engines as before, e.g. Router Engine and PubSub Engine instead of Router Engine Family and PubSub Engine Family.

@jonathan @graphomath @cwgoes @degregat

I agree. Even though the terminology originates with the actor model literature which strongly influenced the engine defintions, I think it will convey more useful intuition for a larger audience if we stick to what @tg-x proposes.

We can still note in the docs which concepts from the actor literature type and instance correspond to.

First, a question: are you aware of the following? Before I reply more.
Also, I think the current example of the Ticker is missing the type for their engines.
This is different from the definition of the engine family.

The following is taken from the current specs, see that:

Engine type

Additionally, we define the Engine type, which represents an engine within a family.
A term of this Engine type is referred to as an engine instance. Each engine instance
is associated with a specific name and a family of engines, plus a declaration of its own
execution context, that is, the specific state, mailbox cluster, acquaintances, and timers.

type Engine (S M H A L X : Type) := mkEngine {
  name : EngineName;
  family : EngineFamily S M H A L X;
  initEnv : EngineEnvironment S M H;
};

For the record, we agreed to changing the term engine family to engine behaviour, the change is applied in PR #193.

1 Like