1

So one can say a language is Turing complete if it meets some criteria, and it can do anything another Turing complete language can do.

Does that mean I can theoretically implement Google using JavaScript or Brainf_ck?

Jay
  • 6,572
  • 3
  • 37
  • 65
maniac
  • 27
  • 5
  • I'm guessing this is about to be closed shortly (this: http://stackoverflow.com/questions/3689311/stackoverflow-help-needed-closed) has something to do with that – Oren A Sep 11 '10 at 01:16
  • 2
    You can only implement the Google search engine by working for Google and writing the code they actually use. Anything else is not the Google search engine. So a better question would be whether you could theoretically implement *a search engine* (similar to the one Google has) in those languages. – jalf Sep 11 '10 at 02:09

4 Answers4

4

You can implement Google from a stack machine made of matchboxes and rocks. Yabba-Dabba-Doo?

kagali-san
  • 2,964
  • 7
  • 48
  • 87
3

No, for given examples it would be impossible. Turing completness is about implementing algorightms and such things, it won't tell you if you cant implememnt any software in it. Google depends mostly on their databases which you can't operate directly through JavaScript, ergo no DB == no Google.

Tomasz Kowalczyk
  • 10,472
  • 6
  • 52
  • 68
  • 2
    Good answer. The key point is that Turing Completeness is about computing answers to problems. It says nothing about I/O, storage, interfaces with other software, etc. – Tyler McHenry Sep 11 '10 at 01:20
  • 2
    Can't I just put the DB in memory supposing I have infinite memory? – maniac Sep 11 '10 at 01:30
  • @maniac: yup. Of course, then one might ask if you have "implemented Google", if your software is different (and, for example, doesn't use a database) – jalf Sep 11 '10 at 02:08
1

Yes, anything they can compute, you can do in those languages. But this says nothing about the amount of memory or other storage required, how fast it will run, or the ease of writing or debugging it.

poolie
  • 9,289
  • 1
  • 47
  • 74
1

Beyond questions of I/O performance, there are also questions of execution time. The number of steps required for one Turing-complete machine to perform some task may be hundreds of orders of magnitude longer than the number of steps required for another Turing-complete machine to do the same thing. It is thus entirely possible that one machine might be able to complete in a fraction of a second a task which would keep another machine busy until the end of the universe; if the latter machine were somehow allowed to keep going even after the end of the universe, it might be able to produce an answer, but from a practical standpoint, the latter machine would be incapable of usefully solving the problem despite its Turing completeness.

supercat
  • 77,689
  • 9
  • 166
  • 211