2. Type
In programming languages, types define the kind of information that can be stored in a variable. Think of a variable as a container that holds something, and the type defines what that something is.
Types are strictly enforced and cannot be mixed. Type safety is crucial because mixing different types can result in unexpected errors with serious consequences. BigBang requires avoiding any type of mixing. Here is an example: The expression above produces an error:
Analysis error - it expects an expression of type 'int', but instead found 'uint' (+ 2 u3).
Before we can determine which type it was expecting, let's review the three categories of types in BigBang: primitives, sequences, and composites.
Primitives are the fundamental building blocks of the language. The data types in JSON include numbers and boolean values (true and false).
Sequences hold multiple values in a specific order,
Composites are complex types made up of other types.
Last updated