Basic Values
This part covers every basic value in the language: three kinds of binding, the integers and the two decimal families, bool and char, strings and their interpolation, time values, vectors and colors, and explicit type conversions. Each value gets its literal forms, runnable examples, and edge-case behavior.
Variables and BindingsDeclarations bind names to values. There are three binding declarations: const, val, and var.
Intint is not the only integer type; it is merely the default type for integer literals. MushScript's integers come in the following widths:
FloatA literal with a decimal point belongs to the floating-point types (IEEE 754). Floats come in three widths: f16 (half precision), f32 (single precision, the default), and f64 (double precision). They compute fast and are the workhorses of graphics, games, and scientific computing; for exact decimal arithmetic use Decimal.
DecimalThe decimal family computes in base ten (IEEE 754-2008 decimal): numbers that are writable exactly in decimal (0.1, 1.10, and the like) are exact here. Use it wherever exact arithmetic matters; graphics and physics use Float.
Boolbool has exactly two values, printed as True and False (leading capitals).
CharA char is one extended grapheme cluster, written in single quotes. One English letter is a char, one CJK character is a char, and an emoji or a character composed of a combining pair is a char too.
StringStrings are written in double quotes and are UTF-8 text. The full set of forms is four, shown in the table below:
InterpolationStrings beginning with $ support interpolation: the expression in a brace hole is evaluated, converted to text, and spliced into the string. Holes are not limited to variables; arithmetic and function calls work too.
DurationA number directly followed by a time unit is a time value. Five units: us, ms, s, min, hr — case-insensitive, and the number may carry a decimal point (2.0s is legal).
Vectors and ColorsVectors and colors are a built-in family of seven types: vec2 / vec3 / vec4 (float components), vec2i / vec3i / vec4i (int components), and color (four float components, rgba, by convention in the 0..1 range and not clamped at runtime).
Type ConversionsMushScript offers several ways to convert between types.
Last updated on October 11, 2026
