Hacker News new | ask | show | jobs
by sirsuki 1102 days 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.
4 comments

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

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!

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
There are Lisp macros that allow writing infix arithmetics. Even fe is said to support macros.
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 .

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.
Well, yeah, I hear you.

But consider that I didn't make lisp-like languages because I didn't find anything suitable.

There were (and still are) lots of nice Lisp implementations when I made my variations over the years.

It's the same with any language created by a single person: we aren't doing it so that we can use it in production (that's a bonus, if possible).

Fair enough!
I thought part of the reason people use forth is because they don't need or want the dependencies and complexity of a big ecosystem or lots of tooling.
I worked with Joy for some time and came to the conclusion that syntax is a MacGuffin.
You’d be hailed as a genius if you replaced s-expressions with yaml.