Hacker News new | past | comments | ask | show | jobs | submit
I never realized that languages have so many strict precedence levels because that’s easier to implement than not having them.

This here seems like a very good idea and I hope other languages in active development take note. And als JS’ Prettier, which actively removes parentheses like these.

Things become error prone once you realize that the precedence rules are different across languages!
No you can have no precedence at all see Lisp and APL for examples.

Lisp because everything is explicit and only the form just inside an opening parenthesis does anything. APL as all is scanned right to left.

If you use the shunting yard algorithm or similar for infix binary operators it's trivial to define a table with operator precedence values and use that. You can have a bunch of operators all at the same priority but it is the same complexity really, the algorithm is pretty trivial