Re:Challenging LR Parsing
by dTal on Wednesday September 16, 2020 @01:00PM
(#24494607)
The APL approach, which is mostly just simple RL-associative + grouping parentheses, works surprisingly well in practice - although that probably owes something to the simplicity of the syntax and the way idiomatic APL uses mainly the built-in 1- and 2-argument functions.
[ Parent
| on HN ]
That was the thought: is there some non-BCPL like grammar that makes sense.
Like... (not fully formed thought here) JSON is easy but verbose - YAML is nightmare by cleaner. Maybe we're looking at it wrong....
As a nearby comment observes, this leads to s-expressions.
The connection between APL syntax and s-expressions is surprisingly close. Start with prefix notation and right-associativity, add grouping parens, and you have something that looks like lisp. The Nial language is an outright fusion of the two that's fun and enlightening to play with.
https://en.wikipedia.org/wiki/Nial https://github.com/danlm/QNial7