Top
Best
New

Posted by mighty-fine 1 day ago

Inverse Parentheses(kellett.im)
71 points | 63 commentspage 3
calmbonsai 1 day ago|
The singular for parenthesis is paren.
ChanderG 1 day ago||
Opened this excitedly, thinking I was going to get something related to S-expressions/Lisp, was disappointed...
Juliate 1 day ago||
Ha! I was expecting/wondering something about the semantics of )( parenthesis (which I have no idea what it could be, but... why not?)
randyrand 1 day ago||
The core idea: normally, parentheses strengthen grouping:

1 + (2 * 3) forces 2 * 3 to happen first.

Without them, operator precedence decides. The post asks a deliberately strange question:

What if parentheses did the opposite — instead of grouping things tighter, they made them bind less tightly?

HansP958 1 day ago|
The concept of "inverse parentheses" that unbundle operators is brilliant! The tokenizer hack (friendliness score by parenthesis depth, inspired by Python INDENT/DEDENT) + precedence climbing for infinite levels is elegant – parsing solved without convoluted recursive grammar. kellett

I love the twist: reversing the friendly levels gives you a classic parser, and it opens up crazy experiments like whitespace weakening. Have you tested it on non-arithmetic ops (logical/bitwise) or more complex expressions like ((()))?

istjohn 1 day ago||
It's not just brilliant, it's earth-shattering.
codegladiator 1 day ago||
llm generated comment
NetMageSCW 1 day ago||
I am sure your comment is almost always wrong whenever you use it.