You might be interested in the Fortress language (RIP), whose input allowed, and was canonical rendered using, mathematical notation.
So, for example, xˆy could be written as x superscript y. SUM[i<-1:n, j<-1:p, prime j] a[i] xˆj was more elegant as a big sigma with the ranges at the bottom, etc.
http://www.ccs.neu.edu/home/samth/fortress-spec.pdf