Skip to content

Types

CL++ is statically typed in what you write and in the Luau it emits.

CL++LuauUse
int / float / doublenumbercounts, damage, alpha
boolbooleanflags
stringstringnames, paths (not std::string)
voidno return annotationprocedures
func(...any) -> anycallbacks / lambdas
autoinferrednew, GetService, datatype ctor
Player / FolderPlayer / FolderInstance (class name)
array<T> / LuaArray<T> / vector<T> / span<T>{T}arrays
dictionary<K, V>{ [K]: V }tables / maps
optional<T>T?missing value
const / static constexprLuau constimmutable
nullnilabsence
Vector3 CFrame UDim2 Color3same namesdatatypes (copy)
Enum.Material.PlasticEnum.Material.Plasticenums

Examples:

int coins = 100;
float speed = 16.5;
string name = "Kartz";
bool isActive = true;
func callback = func () {};
auto dynamicVal = DataService.Server;
Player playerRef = null;

Always initialize: int coins = 0;int coins; emits nil.

There is no delete, no address-of, and no ->. Numbers copy; Instances mutate through . (property and instance method).

Player player is an Instance of class Player. Properties and instance methods use .. Protected calls use :. Static names use ::. match arms write Part p =>.

player.Name = "Kartz";
player.FindFirstChild("leaderstats");
player.Name = "Kartz"
player:FindFirstChild("leaderstats")

There is no pointer arithmetic and no std::unique_ptr. Lifetime is Roblox’s: Destroy or Janitor.

Inferred when the value is new Class(...), GetService<T>(), or a datatype constructor. Prefer an explicit type on parameters and struct fields.

static_cast<T>(x), const_cast, reinterpret_cast, and dynamic_cast emit the argument. (void)x; disappears (silences unused in clangd). Luau has no casts — they do not check ClassName.