top | item 36239944

(no title)

sirsuki | 2 years ago

I once wrote a tiny DSL language. I used LISP (S-Expressions with parenthesis) because it semantically fit and made the parser much easier to write. I was laughed at and ridiculed by my peers. Everyone hated it that I had to attempt two other language styles just to compensate. I had a chuckle seeing fe syntax is LISP like and I was like “See? I’m not the only one.” Many just can’t give LISP and S-Expressions their due regard. Same for Reverse Polish Notation. I was born on the wrong planet.

discuss

order

cpeterso|2 years ago

John McCarthy had the opposite experience: he originally planned to replace Lisp's S-expressions with a more ALGOL-like syntax called M-expressions, but other people liked S-expressions and he never got around to implementing M-expressions.

https://en.wikipedia.org/wiki/M-expression

drpixie|2 years ago

I love RPN for calculating - I still regularly use a HP11C (Swiss Micros replica).

But I hate coding or reading prefix (list) or postfix (rpn, forth, etc) languages. Once wrote a substantial project is Postscript - works fine but note easy on the brain.

Guess it comes from just too much familiarity with infix notation!

packetlost|2 years ago

I personally find prefix and RP notations to be pretty easy to read, but writing is harder for me. I've introduced bugs into FORTH programs because I did a + b instead of a b + out of habit. I think both notations have their place and not everyone will be able to make the switch

nine_k|2 years ago

There are Lisp macros that allow writing infix arithmetics. Even fe is said to support macros.

lelanthran|2 years ago

No you weren't, many of us, like myself, have designed small languages over the years.

After a few of these, you stop designing syntax: you just skip the syntax and directly read ASTs instead of whatever syntax you wasted your time on.

My next language is going to be a FORTH of some type .

packetlost|2 years ago

I don't think it's worth making a FORTH unless you plan to build an optimizing compiler better than what iForth, gForth, or VFX have done, open source and maintain it, or exclusively target microcontrollers. FORTH is a great "language" but the ecosystem is tiny and the tooling is pretty minimal.

carapace|2 years ago

I worked with Joy for some time and came to the conclusion that syntax is a MacGuffin.

baq|2 years ago

You’d be hailed as a genius if you replaced s-expressions with yaml.