Types

Bismuth has both data types for describing the type of a resource in a program (e.g., a variable) as well as session types which represent the communication protocols that programs use to communicate via channels with. The former of these is often represented by an uppercase T when referring to any data type. The latter is often represented by a P when referring to any session type. These are each ellaborated in their respective sections on this page.

Data Types

Type NameVersionDescription
int0.0.1A 32-bit signed integer
boolean0.0.1A 1-bit boolean value
str0.0.1A constant string literal
Box<T>1.2.0A pointer to data allocated on the heap
Unit0.0.1The type which only has one value
T[N]0.0.1An array of type T of fixed length N
T[]1.3.4An array of type T dynamically sized
enum0.0.1(AKA. Sum Type, Tagged Union) A type of data which can store one of multiple specified data types
struct0.0.1(AKA. Product Type) A type of data which can store multiple pre-specified types of data simultaneously
func0.0.1A synchronous function
Program0.0.1A program which can be executed asynchronously
Channel<P>1.0.0A channel which allows for communicating to another program

Session Types

Protocol NameSyntaxVersionDescription
Send-T1.0.0Send data of type T to the other process.
Recieve+T1.0.0Recieve data of type T from the other process.
SequenceP_1;P_21.0.0Follow protocol P_1, then P_2.
Why not?P1.0.0Repeat protocol P any number of times as chosen by the local process.
Of course!P1.0.0Repeat protocol P a number of times chosen by the other process.
Internal ChoiceInternalChoice<(lbl_1 :?) P_1, (lbl_1 :?) P_2, ...>1.0.0The local process gets to determine which of the provided protocols (P_1, P_2, etc) to follow). Since 1.3.4, a unique label may prefix options in a choice to provide semantic meaning and allow duplicate protocols to exist within a choice.
External ChoiceExternalChoice<lbl_1 :?) P_1, (lbl_1 :?) P_2, ...>1.0.0The other process gets to determine which of the provided protocols (P_1, P_2, etc) to follow). Since 1.3.4, a unique label may prefix options in a choice to provide semantic meaning and allow duplicate protocols to exist within a choice.
CancelableCancelable<P>1.3.4Allows the protocol P to be canceled by either party privy to the protocol at any time.