r/ProgrammingLanguages • u/Luroqa • Jan 24 '26
Discussion Why don't any programming languages have vec3, mat4 or quaternions built in?
Shader languages always do, and they are just heaven to work with. And tasty tasty swizzles, vector.xz = color.rb it's just lovely. Not needing any libraries or operator overloading you know? Are there any big reasons?
110
Upvotes
View all comments
31
u/JeffB1517 Jan 24 '26
MATLAB, Julia, HLSL (Cg, Asymptote. VEX all have 3D vectors built in. Programming languages choose a limited set of primitives for what they consider common use cases. More niche languages have more niche primitives. Same reason most programming languages don't have filenames as a primitive, but shell scripting languages do. Or some 4GL languages like MUMPS have key-value hierarchical database interactions as a primitive.