Hacker News new | ask | show | jobs
by tmtvl 983 days ago
As someone who loves Lisp syntax I have to say that for a programming language syntax is actually very important: it's how your mind interfaces with the fabric of the program you're working on. A syntax that doesn't fit your mind well will make it more awkward to translate your thoughts into code.
2 comments

I never really realized how much syntax matters until I spent a lot time writing Racket.

I’ve learned Haskell, JavaScript (actually learned rather than the passing familiarity I had before), Smalltalk, and APL since then. The hardest part of all of them has been keeping syntax straight.

Things with very regular syntax like Lisps and Smalltalk were a breeze to get comfortable, but a significant portion of my time learning Haskell and APL were spent learning how to parse expressions and precedences in my mind’s eye. There’s definitely a bit of a “reading the Matrix” moment for both of them that you tend to forget after you get it though.

I’m not saying we should stop trying to develop novel syntax either though. Anyone that has ever tried to use the object system in Racket knows just how painful it can be to not have syntactic sugar for something important.

`(send object a-message anyone?)`

Fitting the syntax to your mind? That sounds... limiting. Seems better to do it the other way around.
It's like getting in the driver seat of a car and making sure that it's set to the correct distance from the wheel and pedals and adjusting the mirrors so you have good visibility. You could try and adapt to the car instead but it's gonna be uncomfortable and more likely to result in problems (though the problems you can have with a car are a bit more... immediate than the problems you can have with a programming language).
Syntax really is so utterly trivial. In my personal project I went for C# instead of Scala. C#'s syntax is more familiar to most people, but the functional programming facilities (essentially copied from Scala) are absolutely bloody awful compared to Scala. Anything a little bit complicated – just forget it.

Edit: The point I didn't make very clearly above was at the syntax is actually pretty much the same, the semantics due to type differences and limitations really screw things up.

How is it a limit when you can choose the syntax?