Skip to content
Protocols

What is a protocol?

A protocol is not:

  • An explicit language feature or construct
  • A static type

A protocol is:

  • A set of messages necessary for a value to perform some function. Usually fewer than 4
  • Thats it

Note

gab’s builtin package makes use of protocols heavily. This empowers developers to create their own types which can interoperate with and extend another package’s code naturally.

The protocols that follow in this section are defined and used by the builtin package.