A primitive data type is a concrete type that represents a single value rather than a collection of fields. Integers, characters, and floating-point numbers are primitive types in Julia; they cannot be broken down into smaller parts. section 7.1 section 7.3.1
The type controls what an object can do. For example, a Bool can participate in an if statement or while loop, whereas a floating-point value cannot be used directly as a Boolean condition. section 7.0
Primitive types become useful when contrasted with other kinds of Julia types:
- A composite type contains zero or more fields and can combine primitive values, such as a String containing multiple Char values. section 7.1 section 7.5
- An abstract type cannot contain fields or hold a value; it organizes type hierarchies rather than representing an individual data value. section 7.3.1
- Primitive types are concrete, so they occupy the concrete leaves of Julia's type hierarchy and can be used to create values. section 7.3.1 section 7.5
Checking primitive types in the REPL
julia> isprimitivetype(Int8) true julia> isprimitivetype(Char) true julia> isprimitivetype(String) false The predicate identifies Int8 and Char as primitive types, while String is composite because it consists of multiple characters. section 7.1
julia> isprimitivetype(Int8) true julia> isprimitivetype(Char) true julia> isprimitivetype(String) false
Inspect the compact REPL comparison of Int8, Char, and String to see primitive and composite classification directly. section 7.1





