r/ProgrammingLanguages • DQ • Sep 03 '26

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.

27 Upvotes

44 comments sorted by

View all comments

Show parent comment

1

u/Mean-Decision-3502 DQ Sep 18 '26

I've modified the specification adding associativity info and chaining to the spec (v1.3)

Actually I've implemented the 1 <= 2 < 3 chaining in DQ. They are really useful.

1

u/EggplantExtra4946 Sep 18 '26

Nice, the associativity is mandatory information about the operators.

They are really useful.

Right? It's a little ergonomic feature that is easy to implement. Languages that have it should also specify the rules of evaluations. Wether each operand is guaranteed to be evaluated only once and wether an evaluation order is guaranteed or not.