Live data from Hacker News

Choosing a language based on its syntax?

gingerbill.org

81–90 of 111 posts

Re: Choosing a language based on its syntax?

#81

Semantics are where the rubber meets the road, certainly; but syntax determines how readable the code is for someone meeting it the first time. Contrast an Algol-descendant like C, Pascal, Java, or even Python with a pure functional language like Haskell. In the former, control structure names are reserved words and control structures have a distinct syntax. In the latter, if you see `foo` in the body of a function d…

> In the latter, if you see `foo` in the body of a function definition you have no idea if it's a simple computation or some sophisticated and complex control structure just from what it looks like. All control structures are reserved as keywords in Haskell and they're not extensible from within the language. In C I can't tell that an if(condition) isn't a function call or a macro without searching for additional syn…

> its differentiation from Elixir is purely syntactic.

Well, there's also standard library, Erlang one is very messy while Elixir one is very consistent (and pipe operator - `|>` - enforces order of arguments even in low-quality 3rd party code as well, making whole language more pleasant to work with. Same goes for utf8-binary string everywhere and other idiomatic conventions

Re: Choosing a language based on its syntax?

#82
post #50
post #4

As Ken Iverson noted in "Notation as a Tool of Thought"[1], yeah the syntax absolutely matters. The same program might resonate and make sense in one language but be incomprehensible if translated 1:1 in another. Computer languages are for humans to understand and communicate. 1. https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.p...

Iverson's point is more regarding semantics than syntax, though. The only mention of syntax suggests its better for it to be simple (presumably so that the semantics are closer to the surface). Every programming language is a notation for describing computation; notation is a catch all for all three levels: orthography, syntax, and semantics. APL is interesting because it not only uses an unconventional syntax, but a…

> Iverson's point is that APL as a notation is valuable for making the structure of certain computations obvious,

Yes, very much so, where as usual, there are local maxima where each notation excels at representing some problems nicely and is awkward for others.

Re: Choosing a language based on its syntax?

#84

Semantics are where the rubber meets the road, certainly; but syntax determines how readable the code is for someone meeting it the first time. Contrast an Algol-descendant like C, Pascal, Java, or even Python with a pure functional language like Haskell. In the former, control structure names are reserved words and control structures have a distinct syntax. In the latter, if you see `foo` in the body of a function d…

> In the latter, if you see `foo` in the body of a function definition you have no idea if it's a simple computation or some sophisticated and complex control structure just from what it looks like. All control structures are reserved as keywords in Haskell and they're not extensible from within the language. In C I can't tell that an if(condition) isn't a function call or a macro without searching for additional syn…

> There is no real universal intuition you can build up for programming. There is no point at which you've mastered some degree of fundamentals that you would ever be able to cross language family boundaries trivially.

I don't really agree with you on this, even though I agree with everything else here. Then again, I am an outlier where I've used ~40 programming languages in my career. There are a couple of language families (array languages like APL, exotics like BF) where I cannot read it because I've had no real opportunity to learn them, and there's a significant difference in being able to read a language and use a language (I can read, but not really use Haskell -- although I have shipped a couple of patches to small libraries).

I despair at the number of developers in the profession who understand only one or two programming languages…and badly at that.

(It's worth noting that I wholly disagree with the original post. 24 years ago I chose Ruby over Python because of syntax. Ruby appealed to me, Python didn't — purely on syntax. I never pretended that Python was less capable, only that its syntactic choices drove me away from choosing it as a primary language. I'm comfortable programming in Python now, but still prefer using most other languages to Python … although these days that has more to do with package management.)

Re: Choosing a language based on its syntax?

#86
This is one of those things that I’m glad remains highly personal and stochastic. Programming languages thrive when people are able and willing to create value with them. People thrive when there are options and they can find a language that sings to them.

Re: Choosing a language based on its syntax?

#87

Earlier quoted context omitted.

The LLM doesn't need to read the whole file in example 2). Why would it?

Where would it inject the code?

Presumably, the same MCP tool allowing it to read specific definitions would also allow it to write out specific definitions (rather than, again, having to write out the whole file just to make one change). Otherwise it defeats the purpose.

This is the same way humans work on code. You never read an entire file top to bottom just to find out one thing, and you never type out the entire file just to make one change. This would, understandably, be very taxing on your working memory, and you'd probably make more mistakes.

Re: Choosing a language based on its syntax?

#88

Semantics are where the rubber meets the road, certainly; but syntax determines how readable the code is for someone meeting it the first time. Contrast an Algol-descendant like C, Pascal, Java, or even Python with a pure functional language like Haskell. In the former, control structure names are reserved words and control structures have a distinct syntax. In the latter, if you see `foo` in the body of a function d…

> In the latter, if you see `foo` in the body of a function definition you have no idea if it's a simple computation or some sophisticated and complex control structure just from what it looks like. All control structures are reserved as keywords in Haskell and they're not extensible from within the language. In C I can't tell that an if(condition) isn't a function call or a macro without searching for additional syn…

> All control structures are reserved as keywords in Haskell and they're not extensible from within the language. In C I can't tell that an if(condition) isn't a function call or a macro without searching for additional syntactic cues, or readily knowing that an if is never a function. I generally operate on syntax highlighting, followed by knowing that an if is always a control structure, and never scan around for the following statement terminator or block to disambiguate the two.

Any Haskell function can serve as a control structure in the Algol sense, not so? As for `if(test)` that could indeed be a macro if the programmer’s a durned fool; but absent macros I don’t believe it can be a function call.

Mind you, I take your point about language familiarity; obviously people manage it.

Re: Choosing a language based on its syntax?

#89

Earlier quoted context omitted.

Where would it inject the code?

Presumably, the same MCP tool allowing it to read specific definitions would also allow it to write out specific definitions (rather than, again, having to write out the whole file just to make one change). Otherwise it defeats the purpose. This is the same way humans work on code. You never read an entire file top to bottom just to find out one thing, and you never type out the entire file just to make one change. T…

Honestly claude doesn't typically do this the way you think. It's perfectly capable of working in files that are "way too big for its allowed download window".

But in general you want some amount of context (what functions are available in scope, etc.)

Re: Choosing a language based on its syntax?

#90

This is the old "syntax does not matter" claim. Syntax is not the most important thing in the world when it comes to programming languages, but it does matter too. I was using perl, then PHP then ruby. There is no comparison here; ruby beats the other two languages hands down. I get to be able to do more, with less syntax and it is easier to read too (provided you write good code; you can write horrible code in any l…

I literally had to write an extra article because of the number of people who thought I was saying syntax doesn't matter. It matters a hell of a lot:

https://www.gingerbill.org/article/2026/02/21/does-syntax-ma...

I was trying to be as clear as I possibly could within that article to state I was only focusing on those two specific topics, rather syntax as a whole. How people judge a language based purely on its declaration syntax and nothing else. Where the declaration syntax makes the least difference compared to the rest of the syntax in the language. And still people wrongly interpreted the article.

Post reply on HN