Any reason why I could not create a language that supports the infix, postfix and prefix functions, and much more?

I thought about creating a language that would be very well suited for creating DSL, letting you define functions that are infix, postfix, prefix, or even just a few words. For example, you can define the infix multiplication operator as follows (where the multiplies (X, Y) are already defined):

a * b => multiply(a,b)

Or the postfix "square":

a squared => a * a

Or a ternary operator such as C or Java, which includes two keywords alternating with variables:

a ? b : c => if a==true then b else c

Obviously, there are many possibilities for ambiguities in such a language, but if it is statically typed (with output type), then most of the ambiguities can be eliminated, and the remaining ones can be considered a syntax error (which should be corrected by adding brackets where necessary).

Is there some reason why I don’t see it would make it extremely difficult, impossible or just a bad idea?

Edit: many people have pointed me to languages ​​that can do this or something like that, but I'm really interested in pointers on how I can implement my own parser for it, or problems that I might run into if it will happen

+5
4

. (, ) . ; . , ; , , , , ,

x + y + z

. , , . ; . , , , . , .

, , -

prefix (e) postfix

prefix postfix . .

, , ML, . .. .

+15

?

a * b squared
+2

, Scala, .

+1
0

All Articles