While still being unproductive this afternoon, I happened across this.
Which got me looking at Go again, as maybe a programming language suitable for one thing or another.
And, looking at the syntax, I see this:
When the input is broken into tokens, a semicolon is automatically inserted into the token stream immediately after a line's final token if that token is
- an identifier
- an integer, floating-point, imaginary, rune, or string literal
- one of the keywords break, continue, fallthrough, or return
- one of the operators and punctuation ++, --, ), ], or }
Hm. Now, here's a thing (which annoys some other C programmers no end). When I'm writing a long expression with a lot of terms in C or Verilog, I like to write it thusly (simplified contrived example):
foo = 0
|| !(inputs & INP_INTLK_OK)
|| (readings.vin < VIN_MIN)
|| (readings.hs_temp > 77)
The handy thing about this is: I can linewise comment out any term that seems to be not doing the right thing, or that needs to be removed while I'm debugging something else, and it doesn't break the syntax nor affect any of the other terms. Or
#if out one or more lines, likewise (in some cases, this is appropriate for production code that needs to apply partially different tests on different models of gadget).
With Go's handy, user-friendly, automatic-implied-semicolon rule, this doesn't work; there has to be a dangling operator at the end of the line. (And it sounds like just wrapping the whole expression in parentheses would result in a syntax error instead of suppressing semicolon-implication).
Oh, well. Ruby doesn't really allow my preferred form either.
Um. Looks like no preprocessor / conditional compilation. Not good for code that's basically shared among sub-projects (or sub-architectures) but needs to be a little different for each. The C preprocessor has its flaws, but it's very useful in a lot of situations. (No, you can't just use regular conditional expressions and optimization; the not-used code might reference undefined variables and such, causing compilation errors.)
But at least Go kept C's nice selection of assignment operators. Saves, sometimes, a mess of typing and opportunity for error.