News for hackers. Stuff that matters.
Re:Most(ly dead) Influential Programming Languages by pjc50 on Thursday March 26, 2020 @04:46AM (#22691622)
There are a few things present in COBOL that I would like to see lifted into more modern languages. One is the use of the full stop as an expression terminator, as in English, instead of the semicolon. Another is the whole "picture" mechanism for number formats.

More languages should also steal Verilog's use of _ as an optional digit separator. It's just arrived in C# 7.

Re:Most(ly dead) Influential Programming Languages by macintux on Thursday March 26, 2020 @10:06AM (#22693663)
> One is the use of the full stop as an expression terminator, as in English, instead of the semicolon.

That’s something people complain about when looking at Erlang code. Thanks to its Prolog heritage, it uses commas, semi-colons, and full stops to terminate statements.

It’s actually very easy to remember which is which, despite the general angst, because they are directly analogous to those punctuation marks’ usage in English.

Commas indicate a continuation of statements, semi-colons separate clauses within a function, and full stops complete a function definition.

Re:Most(ly dead) Influential Programming Languages by abrolhos on Thursday March 26, 2020 @05:57AM (#22692019)
C++ has an optional digits separator too. Not '_' but single quotes, since c++14 [0]. Which is cool. Swift has it too [1].

Erlang has the full stop '.' as expresssion/statement terminator [2].

[0] https://en.cppreference.com/w/cpp/language/integer_literal [1] https://docs.swift.org/swift-book/ReferenceManual/LexicalStr... [2] https://erlang.org/doc/getting_started/seq_prog.html

I like those features too! I'm glad they are coming to contemporary languages.

Re:Most(ly dead) Influential Programming Languages by gerikson on Thursday March 26, 2020 @05:14AM (#22691760)
"_" has been an option to separate digits in Perl for ages. I use it all the time if the integer is >10,000
Re:Most(ly dead) Influential Programming Languages by pansa2 on Thursday March 26, 2020 @07:12AM (#22692385)
`_` digit separators are also supported by both Python and Go.
Re:Most(ly dead) Influential Programming Languages by mjcohen on Thursday March 26, 2020 @03:31PM (#22697029)
I also liked the "corresponding" modifier for verbs like "move" and "add". It caused the operation to only be done on those fields which existed in both the source and destination and ignored the others. Do any other languages have this?
Re:Most(ly dead) Influential Programming Languages by onychomys on Thursday March 26, 2020 @06:26AM (#22692153)
If we start using periods to end expressions, would we then have to use semicolons to chain things together? Or would you let the compiler know that foo.size(). was okay and that it shouldn't be waiting around for another function call there?
Re:Most(ly dead) Influential Programming Languages by marcosdumay on Thursday March 26, 2020 @08:53AM (#22693011)
Hum... Prolog uses periods to end declarations, and as you expect, uses semicolons as combinators.

It reads really well, because it also uses colons as combinators, with higher precedence than the semicolon. But it does not map well into other paradigms.

Re:Most(ly dead) Influential Programming Languages by lifthrasiir on Thursday March 26, 2020 @06:34AM (#22692190)
Juxtaposition (`foo size()`) is a serious contender I think. In fact, I consider it is one of the most undervalued syntactic choices.
Re:Most(ly dead) Influential Programming Languages by WorldMaker on Thursday March 26, 2020 @12:22PM (#22695162)
In HS I built a toy language where it was `foo's size()`, if you want to play even further down the English-like rabbit hole, even trying to stick to BNF-ish CFGs. `'s` is actually a surprisingly unambiguous token in a language without a "char type" and that sticks to double quotes only for strings.
Re:Most(ly dead) Influential Programming Languages by pjmlp on Thursday March 26, 2020 @07:04AM (#22692345)
Java has it since ages.
Re:Most(ly dead) Influential Programming Languages by DFHippie on Thursday March 26, 2020 @08:32AM (#22692857)
To extend this list a bit, Rust and Ruby also allow _ as a separator.
Re:Most(ly dead) Influential Programming Languages by guggle on Thursday March 26, 2020 @05:41AM (#22691919)
I think Nim also has digit separator.
Re:Most(ly dead) Influential Programming Languages by nimmer on Tuesday March 31, 2020 @08:38AM (#22736905)
It does.