• humanspiral@lemmy.ca
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    edit-2
    17 hours ago

    Some programming languages do away with operator precedence for a big parsing speed boost. J/APL and stack languages are “best known”. in J, right to left parsing,

    16 = 4 * 2 + 2

    • Soggy@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      12 hours ago

      Assuming an equation with no context is anything but standard mathematics is peak “well, technically”

      • humanspiral@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        9 hours ago

        There’s big advantages to no precedence rules. You don’t have to remember them all. Haskell/SML family create nightmares from trying to have user defined operators with precedence “value” of 0-10. Operators are extremely powerful syntax simplification, but precedence rules makes them too hard to mentally parse.