3 ms·
These are great questions. All of the above, actually. Turing-completeness and the uncomputability thereof are widespread, easy to build, hard to keep away, a
by gavinhoward 4y ago
These are great questions.
All of the above, actually.
Turing-completeness and the uncomputability thereof are widespread, easy to build, hard to keep away, and affects everything that might happen at runtime.
A list of things that can happen is infinite, but that list absolutely includes:
* Whether a particular function pointer resolves to certain functions,
* Whether evaluating the comptime portion of a Zig program will take forever,
* Whether the compiler fails to exclude a particular function from being used as a function pointer at a particular place.
Turing-completeness is a wildly powerful property, but that power is not free; the inability to figure out what might happen in a program is only just the biggest and most apparent cost.
The problems this might cause can be summarized like this: you can never know what a program will do for a given set of inputs until you run the program on those inputs, and even then, you might never know if the program never halts.
Does that make sense?
- throwawaymaths 4y ago> Whether a particular function pointer resolves to certain functions This is only a turing completeness issue if the list of functions is infinite. It is not, in zig.
- gavinhoward 4y agoYou don't need an infinite list of functions to run into the problems with Turing-completeness. You only need effectively infinite behavior, which means all you need is effectively infinite possible inputs.
- throwawaymaths 4y agothis is simply untrue. I'm sorry. I recommend studying math a bit more rigorously before making claims in the future.