Some thoughts re: ‘67 Considered Harmful’: *Superp...
# thinking-together
q
Some thoughts re: ‘67 Considered Harmful’: Superparentheses: Love the discussion about this topic 😛. Haskell has
$
which means ‘opening parenthesis that is closed by the end of the line’ which gets a bit close to the idea of a ‘super opening parenthesis’. C and GOTO: C came out after this paper, and its
goto
statement was neutered: It only allows local jumps (remaining in the same function) and only to hard-coded labels (though a common GCC compiler extension extends this to allow dynamic labels). The closest C gets to unrestricted GOTO is `setjmp`/`longjmp`; but here the callee decides where you jump to (just like with exceptions) so you can really only jump up on the stack, making them slightly less painful to reason about. Neither gets used a lot: I mainly know the
goto sosueme
idiom from a few of the talks of Alexei Alexandrescu in which he uses it in a hot code path because the resulting machine code is better optimized. And `setjmp`/`longjmp` is used in some places to emulate exceptions or coroutines in plain C, but whenever the OS provides higher-level abstractions to use here they are preferred (just like how OS support for threading is better than rolling your own spin-locks). EDIT: Also, love your relentless efforts to add the Dijkstra sting every time 😂. Editing this episode must have taken painfully long 🙇.
m
I love that
$
in haskell, if it was gone I would cry! (And implement my own)
q
Same here. For people coming from other languages: you might know
|>
and maybe
<|
. (F#, Scala, Elixir, Elm, PureScript, … have them).
$
is
<|
. The Haskell version of
|>
is known as
&
which is mainly useful if you want to split a long expression over multiple lines (and read it top-to-bottom).
j
goto
turns up in many, many places where performance matters. Here are ~5 pages of hits for
goto
in the Linux kernel, for example: https://github.com/search?q=repo%3Atorvalds%2Flinux+goto&amp;type=code&amp;p=1 Dijkstra could make his argument only because he didn’t do much of this kind of work.
c
I quit this episode due to the audio hijinks
j
@Chris G Me too!
m
My first ever program was in BBC BASIC:
Copy code
10 PRINT "MATT IS ACE"
20 GOTO 10
Where is the harm in that 🙂
Seriously though @Jack Rusher you make a great point. It's easy to write a "chainsaws considered harmful" paper, but there are contexts where chainsaws are extremely useful (and relatively safe).
k
Back in the day I wrote up a little story about a lesson that might be relevant here: https://akkartik.name/post/swamp