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
Show parent comment
1
u/JeffB1517 Jan 25 '26
No they don't. They treat them as objects with properties
ls d/eis effectively a polymorphic function of d which is then polymorphic on e which is treated as an object i.e.d->e.lsin OO syntax. Note that e is a file ls polymorphism will handle this. Similarlycat d/enow treats e as a file andd->e.cat. It has elegant failure if e is a directory. Etc... that is way more than strings.More importantly though, than all that power is the fact that they are a default argument type, a primitive, for countless operations that want a file name, not merely a string.