On 2023-08-17,
[email protected] <
[email protected]> wrote:
Hi here,
Is bash a Turing-complete language, and if so, how to validate this by a minimal example?
The algorithmic subset of Bash: functions, variables, loops and all
that, isn't Turing complete because Turing completeness requires
unlimited storage. Bash is a C program bound in a bounded memory model.
However, files could be used as "tapes".
If a language A can interpret language B which is known to be Turing
complete, then A is Turing complete.
If you can write a Bash program which interprets Turing machine
tapes, using files, then you could argue that it's Turing complete,
limited only by the file size.
File size is limited only by the type of file system used.
Say that we hook up an actual tape machine to Linux, and write a driver
for it, and map it to a file-like device. We could have it so that the
Bash script uses this device, and is limited only by the amount of tape;
the operator can always splice on more tape if it looks like the tape is running out.
--
TXR Programming Language:
http://nongnu.org/txr
Cygnal: Cygwin Native Application Library:
http://kylheku.com/cygnal
Mastodon: @
[email protected]
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)