Search code examples
programming-languagescomputer-sciencehalting-problem

What would programming languages look like if every computable thing could be done in 1 second?


Inspired by this question

Suppose we had a magical Turing Machine with infinite memory, and unlimited CPU power.

Use your imagination as to how this might be possible, e.g. it uses some sort of hyperspace continuum to automatically parallelize anything as much as is desired, so that it could calculate the answer to any computable question, no matter what it's time complexity is and number of actual "logical steps", in one second.

However, it can only answer computable questions in one second... so I'm not positing an "impossible" machine (at least I don't think so)... For example, this machine still wouldn't be able to solve the halting problem.

What would the programming language for such a machine look like? All programming languages I know about currently have to make some concessions to "algorithmic complexity"... with that constraint removed though, I would expect that all we would care about would be the "expressiveness" of the programming language. i.e. its ability to concisely express "computable questions"...

Anyway, in the interests of a hopefully interesting discussion, opening it up as community wiki...


Solution

  • Note that even if the halting problem is not computable, "does this halt within N steps on all possible inputs of size smaller than M" is!

    As such any programming language would become purely specification. All you need to do is accurately specify the pre and post conditions of a function and the compiler could implement the fastest possible code which implements your spec.

    Also, this would trigger a singularity very quickly. Constructing an AI would be a lot easier if you could do near infinite computation -- and once you had one, of any efficiency, it could ask the computable question "How would I improve my program if I spent a billion years thinking about it?"...