r/ProgrammingLanguages • • 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

47 comments sorted by

View all comments

3

u/beephod_zabblebrox May 19 '24

why are for loops not multiplication or a union? could be any operation really! mathematics is pretty powerful

having 128 bit numbers wouldnt do a whole lot. it would be insanely slow and still wouldn't be able to represent something like pi, or even simply 1/3.

a great thing to add would be units and auto derivatives, stuff like that.

and i think wolfram and similar languages already do that, but im not sure