News for hackers. Stuff that matters.
Re:Gödel's Incompleteness Theorem in Bash by void_one on Friday February 25, 2022 @06:23AM (#30466102)
There is a fallacy in constructing "paradox.sh" problem.

"behave_differently.sh" requires an argument, a program to be run and produce some output. If "behave_differently.sh" is run without any argument, then there is no specified correct behavior.

Thus, "paradox.sh" also requires "$1" to be non-empty, otherwise it's result is undefined. When invoking "./paradox.sh ./paradox.sh", the inner "paradox.sh" will be launched without any arguments, running "behave_differently.sh" also without arguments.

There is no logical impossibility, just constructed way to trigger unspecified behavior in "behave_differently.sh".

Re:Gödel's Incompleteness Theorem in Bash by OscarCunningham on Friday February 25, 2022 @09:53AM (#30467858)
The second paradox.sh in './paradox.sh ./paradox.sh' isn't run at all. It's soucre gets read in as input to behave_differently.sh.
Re:Gödel's Incompleteness Theorem in Bash by void_one on Friday February 25, 2022 @10:25AM (#30468231)
yes, and then behave_differently.sh runs it to capture and modify its output, but without any arguments
Re:Gödel's Incompleteness Theorem in Bash by OscarCunningham on Friday February 25, 2022 @10:42AM (#30468451)
Note that behave_differently.sh takes two inputs, both a program and the input for that program. Also note that paradox.sh gives both these inputs by using $1 twice.

And behave_differently.sh is supposed to be an arbitrary program. It can run the input program but it doesn't have to, it can analyse it in any way it wishes.

Re:Gödel's Incompleteness Theorem in Bash by void_one on Friday February 25, 2022 @11:52AM (#30469281)
It is a good point that behave_differently.sh does not necessary run its argument program, but can analyze it in another way. (The context of Bash scripts suggests execution but that is a misleading hint.)

In the broader formulation behave_differently.sh tells that its argument program terminates and produces finite input, which is a halting problem.

Re:Gödel's Incompleteness Theorem in Bash by void_one on Friday February 25, 2022 @10:44AM (#30468465)
Bot the very approach is fun:

  class RusselSet(set):
      def __contains__(self, other):
          return other not in other

  paradox = RusselSet()

  paradox in paradox  # ?