Skip to content

Pod is Ugo's logical unit. It's not your source files. Pod can thus contains multiple entities from differents files.

U makes it easy to structure large systems through the use of Pod. In other languages, they are kind of modules. As modules have different meanings, we use Pod.

Like the lotus seed pod depicted below, pods encapsulate elements as a whole under the same namespace: values, classes, errors, functions signatures, and implementations.

Lotus Pod

But pods go beyond that to ensure that all elements share a common implementation base, specified in ugo like inheritance rules, array indices, errors rules. For example,

  • in a fault-tolerant environment, you want to prevent loops and concurrency in a pod. There will be no loops, no mutex in entities,
  • in a low-level system, you want to prohibit inheritance or forces function to have direct memory mapping.

It's then easier to manage Pod as domain-specific package. With example above, a low-level system will be part of a fault-tolerant environment, but with specific rules.

Pods' inputs are files, and outputs are a namespace with interfaces and binary objects.

Files and Pods Imports

Files and Pods share a common syntax for importing. Importing is done with keywords:

  • ::import_sys or ::Imps: for system import,
  • ::import or ::I: for user code import.
::import_sys 'io', :*"
::import 'io', :*"
::I 'io', (:Read, :MyRead)"

Pods Exports

Same as above with keywords ::export, or ::Exp:

::export *
::Exp a, B, ...
::Exp :/^(abi_)/
::Exp ::A :User, {
  :name : @string,
  :id : @int
}

::Exp ::Enum :Vehicle, [:Car, :Bus]