News for hackers. Stuff that matters.
Re:Vala Programming Language by Syzygies on Friday July 15, 2022 @10:26PM (#32114757)
Rob Pike famously explained that C needed its space-insensitive braces and semicolons in case code was transmitted through a channel that mangled whitespace.

Those days predate most people reading this, yet many new language syntaxes opt for "familiarity". I wish that all language design went through a filter where every character mattered like the designer was in an episode of Squid Game.

Bill Joy famously explained that syntax matters, a dense syntax puts more on screen. This is true even now. I struggle with this; my favorite syntax is a preprocessor that eliminates the need for most Lisp parentheses. The result is code poetry. Nevertheless, Haskell is more expressive.

(Here's an easy test: Anyone who proposes a way to minimize Lisp parentheses, who hasn't introduced a symbol for missing outline levels, is just pulling out chunks and hasn't used their system to write thousands of lines of code.)

I've written most of my lifetime of code in C, established my career in C, and C syntax is ground glass in my eyes.

Re:Vala Programming Language by ebingdom on Friday July 15, 2022 @11:16PM (#32114935)
> I wish that all language design went through a filter where every character mattered like the designer was in an episode of Squid Game.

Yes, I totally support this! Coming from languages like Haskell, most languages look so unnecessarily noisy to me. Cut the fat!

> Anyone who proposes a way to minimize Lisp parentheses, who hasn't introduced a symbol for missing outline levels, is just pulling out chunks and hasn't used their system to write thousands of lines of code.

What are outline levels? I tried Googling it but didn't find anything.

> C syntax is ground glass in my eyes.

Is that a good thing? I'm not sure what you mean by it.

Re:Vala Programming Language by pxc on Saturday July 16, 2022 @12:34AM (#32115258)
I think they mean that looking at it is like getting lots of tiny, ground-up pieces of glass in their eyeballs.
Re:Vala Programming Language by 2143 on Friday July 15, 2022 @10:31PM (#32114778)
> Rob Pike famously explained that C needed its space-insensitive braces and semicolons in case code was transmitted through a channel that mangled whitespace.

Interesting.

And later when he (along with his collaborators) created Go, he moved with the times and avoided the need for semicolons.

Alongside they also shipped a tool that handles formatting so people can stop talking about that.

Re:Vala Programming Language by darthrupert on Saturday July 16, 2022 @01:53AM (#32115579)
Not only that, afaik they pioneered/popularized a style of coding where the formatter is always correct, not the coder. This made coding on every language much more enjoyable and more efficient.

This is not something to write papers about, but a very significant thing anyway.

Re:Vala Programming Language by MaxLeiter on Saturday July 16, 2022 @04:33PM (#32121697)
Anecdotal of course, but a teacher of mine worked on the original Ada compiler and said each dev had their own formatting rules. The SVN had an unformatted version and everyone could format it locally. Not the exact same, but pretty similar.
Re:Vala Programming Language by frfl on Friday July 15, 2022 @10:32PM (#32114784)
> my favorite syntax is a preprocessor that eliminates the need for most Lisp parentheses.

What's the preprocessor you're talking about?

Re:Vala Programming Language by gilch on Wednesday July 20, 2022 @09:31PM (#32174721)
There are a number of those. See https://www.reddit.com/r/whitespaceLisp for a more complete list.
Re:Vala Programming Language by NoThisIsMe on Saturday July 16, 2022 @02:17AM (#32115674)
Wisp, possibly
Re:Vala Programming Language by xigoi on Saturday July 16, 2022 @05:08AM (#32116358)
>Rob Pike famously explained that C needed its space-insensitive braces and semicolons in case code was transmitted through a channel that mangled whitespace.

But did he explain why it used semicolons, rather than periods, which would make more sense because a statement is basically a sentence?

Re:Vala Programming Language by int_19h on Saturday July 16, 2022 @05:27AM (#32116436)
Semicolons as statement terminator (or separator) are at least as old as Algol-60; C merely inherited that.
Re:Vala Programming Language by adhesive_wombat on Saturday July 16, 2022 @08:44AM (#32117475)
Periods are in struct.member identifiers and also in floating points. Using them again for end of statement would be complicated[1].

Imagine that your statements are "x = y.x = z." The compiler needs to figure out if that middle dot is saying "x member of y" or if it's a statement terminator.

[1]: It's already complicated by that reuse, which is, I assume, why identifiers can't start with digits so your parser can be simpler.

Re:Vala Programming Language by xigoi on Saturday July 16, 2022 @09:14AM (#32117693)
I assume that the statement terminator was chosen first, so they could've used something else for member access, such as `\`. Though I don't know about floats.
Re:Vala Programming Language by yissp on Saturday July 16, 2022 @09:51AM (#32118077)
They could have used a comma for floats, as is common in many non-English-speaking countries. Although I guess that might become ambiguous with its use as a parameter separator.
Re:Vala Programming Language by lfnoise on Saturday July 16, 2022 @12:18PM (#32119465)
Smalltalk uses periods. One thing I like about C is that I can write .1 or 1. , but most languages these days force me to add the zero: 0.1 or 1.0 .
Re:Vala Programming Language by dukoid on Saturday July 16, 2022 @09:30AM (#32117863)
Probably because periods are used in numbers already...

print 42.0

Re:Vala Programming Language by dotopotoro on Saturday July 16, 2022 @01:36AM (#32115500)
Other reasons for the a bit of noise: speed, simplicity and unambiguity of parsing. (Impacts compilation speed, ease of additional tool development, and ability to continue parsing partially incorrect code)
Re:Vala Programming Language by prirun on Saturday July 16, 2022 @08:43AM (#32117461)
Nim, last I used it a couple of years ago, stopped at the first compilation error. It's not such a bad idea considering errors are usually fixed one-at-a-time.

I'd gladly trade a little compilation speed and ability to continue parsing incorrect code for a syntax without semicolons, braces, and other unnecessary characters. It's one of the things I really like about Python, though even that is starting to add lots of syntaxy glyphs.

Re:Vala Programming Language by ilrwbwrkhv on Friday July 15, 2022 @10:56PM (#32114863)
yup that is why imba is superior to any other js based languages.