Live data from Hacker News

Choosing a language based on its syntax?

gingerbill.org

91–100 of 111 posts

Re: Choosing a language based on its syntax?

#91

I don't want to be overly negative, but it seems to me that author considers just different flavours of C. There is a massive difference between Clojure, Prolog, and Forth. The whole: type name = value—type-focused name: type = value—name-focused var name type = value—qualifier-focused Is so much deep into details of how syntax might look like. If you are choosing between Kotlin and Go, it is for the platform, not th…

Those syntax examples are literally just general examples, not the only way you have to write them. But to categorize the ones you wrote:

* Clojure is qualifier-focused * Prolog is name-focused * Forth is qualifier-focused (`:` is the qualifier in this case)

Re: Choosing a language based on its syntax?

#92

An article about diversity of language syntax that somehow only deals with C-adjacent curly-brace languages (and,tbf, Odin). This is a blinkered viewpoint. If you want to talk about syntax, at least mention the Haskell family (Elm, Idris, F*, etc), Smalltalk, and the king of syntax (less) languages, LISP (and Scheme), which teach us that syntax is a data structure.

The article does no such thing and just focused on declaration syntaxes and semicolons. I can class literally any language into the three categories for declaring variables.

* Haskells are name-focused languages. * Smalltalk is a name-focused language. * LISPs are qualifier-focused languages.

I think you might have a blinkered viewpoint in how you have interpreted the article.

Re: Choosing a language based on its syntax?

#93

> Lua is an example of such a language, and when a semicolon is necessary is when you have something that could be misconstrued as being a call: (function() print("Test1") end)(); -- That semicolon is required (function() print("Test2") end)() Tangential, but I sidestepped this ambiguity in a language I've been designing on the side, via the simple rule that the function being called and the opening parenthesis can't…

That sidestepping only introduces significant whitespace, which may not be what people want in the first place. It can be quite common to align call expressions by the parentheses if they span multiple lines for clarity, and you preventing might not be desireable.

Re: Choosing a language based on its syntax?

#94
post #3

A lot of programming is taste, and syntax gives you a very quick judgement about how good the language designer's taste is. How familiar they are with what we know about which syntax works well, and so on. For example if you're designing a language in 2026 that uses `type name` instead of `name: type`... that is highly suspicious. Also syntax is the interface through which you interact with the language, so bad synta…

Did you even read the article, even the heading of that section? You know there is a huge majority that do not want semicolons whatsoever, so saying people should just suck it up is actually a determent to the adoption of the language because of people's general tastes.

Re: Choosing a language based on its syntax?

#96
post #35

I never got why compilers don't have pluggable syntaxes. I mean, once you decide the "flavor" (e.g.: typed, imperative, with a dash of functional and some oop for good measure), you could have more than one syntax and easily switch to whatever the reader wants. We had an integration language in a product I worked on that had three flavors (you can check it here: https://docs.oracle.com/cd/E13154_01/bpm/docs65/pdf/Ora…

> I never got why compilers don't have pluggable syntaxes.

Because then you've created dialects and produced the Curse of Common Lisp all over again.

Syntax matters a heck of a lot, and you want consistency and coherency across codebases of the same language, otherwise you don't have a language at all. So wanting it "pluggable" is in fact the worse possible choice you want.

It's also a naïve view to think that concrete syntax can be trivially swapped out with the abstract syntax remaining. For certain things it can usually work (like declaration syntax in the article) but for most things it cannot.

Re: Choosing a language based on its syntax?

#97
post #36

> I am still perplexed by how people judge a language purely by its declaration syntax, and will decide whether to use the language purely based on whether they like that aspect or not. Throughout the article, OP seems baffled that people have aesthetic preferences. Well, yes, of course we do; dealing with ugly things is the computer's job. It also comes across like OP hasn't seen a lot of examples of really interest…

> Throughout the article, OP seems baffled that people have aesthetic preferences. Well, yes, of course we do I think Bill is astonished not really that people have aesthetic preference but that anybody's real preferences could be different from his. He supposes that, at most, these are false beliefs they should reject to reveal that their sincere preference is identical to his, the only correct preference.

Hello again. That's not my position in the slightest. The point of the article is to express how people will shallowly and naïvely judge something. It might be naïve conception of "aesthetics" but it's not even a good one.

It has nothing to do with people disagreeing with me, I have seen people dismiss numerous languages (not just my own) based on that declaration syntax. Things like "why does Rust not use `type name = value`? why did they have to change things so much from C++?".

Do you think these people are actually serious programmers or just having shallow and dumb opinions on things they know little to nothing about?

Re: Choosing a language based on its syntax?

#98

> Lua is an example of such a language, and when a semicolon is necessary is when you have something that could be misconstrued as being a call: (function() print("Test1") end)(); -- That semicolon is required (function() print("Test2") end)() Tangential, but I sidestepped this ambiguity in a language I've been designing on the side, via the simple rule that the function being called and the opening parenthesis can't…

I wouldn't like that, because I always put a single space in front of the parenthesis. Mostly for aesthetic reasons, and to distinguish it from function-like macros. Not intended as a criticism, just a data point.

Re: Choosing a language based on its syntax?

#99

> Lua is an example of such a language, and when a semicolon is necessary is when you have something that could be misconstrued as being a call: (function() print("Test1") end)(); -- That semicolon is required (function() print("Test2") end)() Tangential, but I sidestepped this ambiguity in a language I've been designing on the side, via the simple rule that the function being called and the opening parenthesis can't…

I definitely think needless whitespace flexibility often causes problems. For eg I'm pretty sure Bjarne chose :: instead of : for the namespace operator in C++ due to ambiguity. A little bit of required whitespace around jump labels and ternary expressions and we could have saved an extra character in an operator that often occurs multiple times per line. Everybody runs linters that enforce that anyways. Likewise the…

> nobody uses squashed subtraction expressions

I do.

Re: Choosing a language based on its syntax?

#100
post #36

> I am still perplexed by how people judge a language purely by its declaration syntax, and will decide whether to use the language purely based on whether they like that aspect or not. Throughout the article, OP seems baffled that people have aesthetic preferences. Well, yes, of course we do; dealing with ugly things is the computer's job. It also comes across like OP hasn't seen a lot of examples of really interest…

I tried my best to be very clear within this article that I am talking about two specific things: DECLARATION SYNTAX and SEMICOLONS. This does not extend to anything else. In fact I got so frustrated with people like yourself who are wrongly interpreting the article that way and extrapolating too much that I had to write a new article: https://www.gingerbill.org/article/2026/02/21/does-syntax-ma...

"Does Syntax Matter?" And the first one is "Yes."

And all languages can have their declaration syntaxes categorized into one of the three I mention. This is not limited to ALGOLs. And I have come across "really interesting language syntax". I am not talking about that in this article.

----

Ergonomics does matter and it's not just about optimizing for typing either. It's actually all about coherency and consistency, something I go into depth into the following article on syntax.

----

I am not "conflating" a semicolon with statement terminators, I am using that as shorthand as most languages that most people encounter (not all languages, obviously) will use semicolons. Python's approach to parsing is a form of automatic semicolon insertion, even if most people don't think of it that way.

----

And I do not like Python's approach requiring significant whitespace of "blocks" through indentation. I much prefer using something like braces, or an `end` keyword, etc, literally because it prevents the problems that significant whitespace introduces. I am not getting into that argument here; please don't start it.

Post reply on HN