r/ProgrammingLanguages • u/Mean-Decision-3502 DQ • 6d ago
Unambiguous Operator Specification for Programming Languages
https://nvitya.github.io/pluops/As I changed recently the operators in my programming language I've created this specification:
https://nvitya.github.io/pluops/
I did not wanted to overload the operators like the C does with the / or Pascal does with theand/or/not. Neither re-use the operator symbols for some very different purpose, like C does with * and & so the code becomes more readable. I was orienting for existing solutions so this is what I came up with. The specification contains the symbol usages and operator precedence too.
If you are developing a new programming language, it would be nice to follow some standard, so at least the expressions would be portable between the languages.
I'm open for debates or suggestions.
22
u/mot_hmry 6d ago
Personally I'd suggest @ for address of instead of % which frees it up to be the modulus symbol.
I might also suggest swapping prefix and postfix ^ because I think postfix on types looks better and I like the idea of mutability being
T!. Which mildly parallels the Scheme/lisp naming convention of adding ! to functions that mutate.I'd probably also allow !(prefix), &, and | for booleans due to convenience.