Hacker News new | ask | show | jobs
by reikonomusha 2579 days ago
Why not? Do you prefer to manage multiple languages in your stack, or cobble together half-baked “DSL”s with method dot-notation, decorators, etc.?

New syntax doesn’t have to mean new lexemes or characters. New syntax can be making something that wasn’t semantically meaningful before now meaningful.

In Lisp notation, if I just have a bare (F 5), I’ll get an error: F is undefined. If I define F, in some sense, I’m adding new syntax. I can now write something down that is meaningful.

Now, it’s not strictly true that it’s new syntax. But if you agree to that, then maybe you’ll agree that

    (match X (P1 R1) (P2 R2) ...)
isn’t new syntax either. (Lisp programmers, however, call it “new syntax”.) That chunk of code could represent pattern matching X against the patterns Pi, and a successful match will return Ri.

Visually, lexically, and structurally, this isn’t actually “new” in a lot of ways. Still has parentheses. Looks like CASE. Doesn’t introduce any foreign evaluation semantics.

So why wouldn’t you want to be able to write things like this? What makes functions/classes/methods/variables—which we define day in and day out—more privileged than syntax like this?