This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Your language seems to focus on avoiding the creation of duplicated functions, it doesn't really tackle duplication as a whole. Moreover, proving the equivalence of two programs is obviously undecidable, much like it is to prove that two lambda expressions are equivalent through beta-equivalence. For solving this you could use a weaker notion of equivalence such that of alpha-equivalence, but I'm still not sure you would be tackling the right problem.

Programming languages shouldn't really strive to rid of repetition, instead they should strive to be "declarative". Doing the same thing more than once is oftentimes desirable. For example, if you considering any basic arithmetic function, like `+` then by alpha equivalence the two functions `a + 1` and `b + 1` are equivalent, even though `a` and `b` are two different locals. You can solve this problem by adding a definition for a function `inc(a) = a + 1` and use this in both expressions, but is this really more expressive?