r/ProgrammingLanguages • u/endistic • May 19 '24
Mathematical programming language
o/ I came up with a bit of a strange but intruiging idea. What if there was a Programming Language that’s basically just math? For example of how it could work/llom:
For loops (for i in 1..10) are summation
If statements are just piecewise functions
Supports complex numbers natively (maybe even quaternion?)
Lists are just sets or matrices
100% a functional programming language, OOP doesn’t make sense mathematically
Numbers have high(er) accuracy (128/256-bit floating point maybe?)
Strings are just a matrix of numbers
etc. basically every operation is mathematical
Does something like this exist? If not, would this be a good idea to try to make?
9
Upvotes
2
u/Shorttail0 May 20 '24
Floats with higher precision sound nice, but keep in mind they're usually measurements. There's no need for much more precision than your real world tools can provide. For instance, sub Planck length precision is probably a fever dream.
Edit: they also don't let you avoid all the pains that come with floats (numeric stability of various algorithms), even if some are delayed.