/
The core types of Lua

The core types of Lua

Lua has only 8 basic types in the language:

  1. Number (which can be a double or integer)

  2. String

  3. Boolean

  4. Function

  5. Userdata

  6. Table

  7. Nil

  8. Thread

This is very significant design choice in the language. Compared to something like Python which has dozens of built in types and which is often adding new types with each revision of the language. By only having one built in complex data-structure in the language - this is the Lua table which can behave as an array or hash table the language is extremely small.

The small size allows the code to be much less in size to implement the language which is why it’s so fast, stable and reliable.

Related content

Lua only has one complex data-structure
Lua only has one complex data-structure
More like this
User data
User data
More like this
Lua
More like this
How does Lua's simplicity make it more secure?
How does Lua's simplicity make it more secure?
More like this
Example code showing the eight basic types in Lua
Example code showing the eight basic types in Lua
More like this
The core eight types in Lua.
The core eight types in Lua.
More like this