TodePond / DreamBerd

perfect programming language
https://dreamberd.computer
Other
10.62k stars 299 forks source link

RFC: Fully generalised inversion operator #621

Open anko opened 1 month ago

anko commented 1 month ago

Many archaic programming languages have redundant operators. For example < and >, and + and - are clearly just opposites of each other. This suggests the possibility of generalising the concept, into an operator-inversion operator.

But we can go even further. I propose that the prefix negation operator ; should be fully generalised, to invert any language construct, not just values. This is to negation approximately as the proposed ~ operator (https://github.com/TodePond/DreamBerd/issues/129) is to approximation.

For example:

This could also fix existing issues for missing operators that are the inverse of other operators (!= https://github.com/TodePond/DreamBerd/issues/573, create/restore https://github.com/TodePond/DreamBerd/issues/181 https://github.com/TodePond/DreamBerd/issues/185, comefrom https://github.com/TodePond/DreamBerd/issues/99#issuecomment-1579314768, nowait https://github.com/TodePond/DreamBerd/issues/141, ;" https://github.com/TodePond/DreamBerd/issues/330#issuecomment-1686627568).

This also has exciting implications for operator overloading (https://github.com/TodePond/DreamBerd/pull/133).

TodePond commented 1 month ago

holy shit this is amazing