Pick the wrong type in Verse, and you won't find out until your game does something weird at runtime. Health regenerates in fractions instead of whole numbers. A timer that should tick smoothly jumps in odd increments. Nine times out of ten, the culprit is a type mismatch you didn't even know you'd made.
Verse's type system is smaller and stricter than what you're probably used to, but that's actually a feature. Once you know what each primitive does—and why it exists—you stop fighting the compiler and start using it to catch your mistakes before they ship.
Here's what's actually going on under the hood.
Numbers: Three Types, Not Just One
Most languages give you a couple of number types and call it a day. Verse splits things up more deliberately, and once you see why, it makes sense.
int — Whole Numbers, No Surprises
An int is exactly what it sounds like: a whole number, positive, negative, or zero. Under the hood, Verse integers actually support arbitrary precision at runtime—but any literal you type directly into your code has to fit inside a standard 64-bit signed range. That's a subtle distinction, and it rarely bites you, but it's worth knowing it's there.
Health : int = 100
Damage : int = 25
RemainingHealth := Health - Damage # Results in 75
Addition, subtraction, multiplication—all behave the way you'd expect. Division is where things get interesting, and we'll get to that in a second.
float — For Anything With Decimals
Reach for float when you're dealing with speed, physics, timers, or anything that needs fractional precision. It's 64-bit IEEE-754 under the hood, which means it also understands special values like NaN and infinity—handy when you're debugging a physics calculation that's gone sideways.
Speed : float = 3.5
TimeElapsed : float = 2.0
Distance := Speed * TimeElapsed # Results in 7.0
rational — The Type You Didn't Know You Needed
Here's where Verse diverges from almost every language you've used. Divide one int by another, and you don't get a float. You get a rational—an exact fraction.
Half := 1 / 2 # rational fraction: 1/2
Third := 1 / 3 # rational fraction: 1/3
Rounded := Floor(Third) # Evaluates to 0
Why does this matter? Because floating-point division introduces rounding errors. Divide 1 by 3 as a float, and you get an ugly, imprecise decimal that can compound into real bugs over thousands of calculations. A rational keeps the exact value—1/3, not 0.333333—until you explicitly decide to round it with something like Floor(). And since int acts as a natural subtype of rational, you can mix the two without extra conversion steps.
This is one of those design choices that feels unfamiliar at first and then feels obvious once you've been burned by float rounding in another engine.
Logic: Just True or False
logic is Verse's boolean type. Nothing fancy here—just true or false, controlling your branches and conditions.
IsAlive : logic = true
HasKey : logic = false
if (IsAlive? and HasKey?):
Print("Player can open the door!")
else:
Print("Access denied.")
Notice those ? marks again. You'll see this pattern everywhere in Verse—testing a logic value inside a condition requires that explicit success check.
Text: Split Into Three Layers
Most languages hand you a single string type and call it done. Verse breaks text down further, and it's actually useful once you're dealing with emojis or extended characters.
char holds a single 16-bit UTF-16 code unit—your standard letters and symbols.
char32 steps up to a full 32-bit Unicode scalar value, which you need for emojis and other characters that don't fit in 16 bits.
string is your immutable sequence of UTF-16 code units, built for player names, UI text, and on-screen messages. Strings support interpolation right out of the box using curly braces.
Letter : char = 'A'
Emoji : char32 = '\u{1F600}' # 😀
PlayerName : string = "Joash"
Print("Welcome, {PlayerName}!")
Try to cram an emoji into a plain char, and you'll hit a wall—that's exactly why char32 exists.
The Two Special Cases
any — Use Sparingly
any is the universal supertype. It can hold literally anything.
var Varied : any = 42
set Varied = "Now I'm a string!"
That flexibility comes at a cost, though: you lose compile-time type safety the moment you use it. Reach for any when you're building a genuinely generic container or framework—not as a shortcut to avoid picking the right type. If you're using any because you're not sure what type something should be, that's usually a sign to slow down and figure it out.
void — Nothing to See Here
void represents a function that runs, does its job, and hands nothing back.
LogMessage() : void =
Print("This function returns nothing.")
If your function's whole purpose is a side effect—printing something, updating game state—void is your return type.
A Note on Intrinsic Functions
Functions like Abs() and Floor() aren't written in Verse—they're baked directly into the runtime. That has a practical consequence: you can call them, but you can't store them in a variable or pass them around as a parameter.
# Valid execution:
Result := Abs(-42)
# Compiler Error:
# MyFunctionVariable := Abs
Try to treat an intrinsic function like a regular first-class value, and the compiler will stop you cold. Worth remembering before you spend twenty minutes wondering why your "clever" abstraction won't build.
Seeing It All Together
Here's a script that pulls every primitive type into one place:
using { /Verse.org/Simulation }
RunTypeDemo() : void =
PlayerName : string = "Joash"
Score : int = 10
Multiplier : float = 1.5
Bonus := Score / 2 # rational = 5/1
IsWinner : logic = true
Letter : char = 'J'
Emoji : char32 = '\u{1F44D}' # 👍
Print("Player: {PlayerName}")
Print("Score: {Score}")
Print("Bonus: {Bonus}")
Print("Winner: {if (IsWinner?) then "Yes" else "No"}")
Print("Initial: {Letter} {Emoji}")
Notice that Bonus—dividing an int by an int still hands you back a rational, even here in a simple demo. That's Verse quietly protecting you from precision loss before you even asked for it.
Get comfortable with these seven types, and you've got the foundation for basically everything else in Verse. The rest of the language—collections, classes, concurrency—all builds on top of these same primitives.