Packets (The GNU Algol 68 Compiler)

### 2.1 Packets ¶

Each Algol 68 source file, which are files using the file extension `.a68`, contains the definition of a so-called packet. Packets therefore play the role of compilation units, and each packet can be compiled separately to an object file. A set of compiled object files can then be linked in the usual fashion into an executable, archive or shared object by the system linker, without the need of any language-specific link editor or build system.

This compiler supports two different kind of packets:

- Particular programs constitute the entry point of a program. They roughly speaking correspond to the `main` function of other languages like C.

  See Particular programs.

- Prelude packets contain the definition of modules, which publicize definitions of modes, procedures, variables, operators and even the publicized definitions of other modules. Each prelude packet defines a single packet, defined at the top-level, which can be accessed by other packets (be them particular programs or other prelude packets) via an `access` construct. Prelude packets are so-called because their contents get conceptually stuffed in the user-prelude in the case of user-defined modules, or the library-prelude in the case of module packets provided by the compiler. They are usually used to compose libraries that can be used in a bottom-up fashion.

  See Modules.

Future versions of this compiler will eventually support a third kind of packet, oriented to top-down development:

- Stuffing packets contain the definition of an actual hole, an `egg` construct, that can be stuffed in a matching formal hole in another package via a `nest` construct. Formal holes are used in order to achieve separated compilation in a top-bottom fashion, and also to invoke procedures written in other languages, such as C functions or Fortran subroutines.

A collection of packets, all of which must be compatible with each other, constitutes either a program or a library. Exactly one of the packets constituting a program shall be a particular program. In libraries at least one packet must be a prelude packet.