type declaration syntax

7 points by abnercoimbre


Loup-Vaillant

I have to recommend Ginger Bill's take on the subject. I feel the differences it captures are more meaningful, though this article does have a couple things that stood out to me.

The mention of juxtaposition comes to mind: that complete absence of syntax, where one or more elements are just written one after another, with nothing but whitespace between them. Many languages fail to use it, or use it only anecdotally. But as the lightest syntax of them all, I feel it should on the contrary be front and centre.

This whitespace business taught me a valuable lesson: to the extent it doesn't hurt something else you care about, the lightest constructs should go to the most used features, and the heaviest to the rarest. Helps pack more code in fewer characters, even fewer lines (it matters), without cluttering your screen full of line noise.

It's also a big reason why I wan on board with Jonathan Blow's idea of not committing to a given syntax from the get go: you gotta get a feel for how you are using (or want to use) your language first. Once you've measured things a bit you can start making adjustment. Beware syntax induced biases though, where you end up using something more or less just because of your initial syntactic quirks.