Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Stata Turing-complete?

I have been doing some statistics work with Stata recently and not enjoying it very much.

It doesn't feel to me like it's a "proper" programming language: in particular I don't think there's a way to loop until a condition is met.

Am I right in my feeling, or is Stata truly Turing-complete?

like image 444
Tom Smith Avatar asked Dec 09 '10 06:12

Tom Smith


2 Answers

I've never heard of Stata before but the webpage brags that it has "if, while" and "looping and branching".

Wikibooks has this example:

local k = 1
file open myfile using toto.txt, read text
file read myfile line
while r(eof) == 0 {
    local k = `k' + 1
    di "`k' `line'"
    file read myfile line
    }
file close myfile

I don't know what "proper" programming language means but at first glance it definitely appears to be Turing-complete.

like image 97
Ken Avatar answered Nov 15 '22 22:11

Ken


A "proper" programming language in the sense that you could build a webpage or GUI with it? Of course not. But that's a bit extreme. You can certainly write loops with .ado and .do files; i would say it is turing complete.

like image 1
idclark Avatar answered Nov 16 '22 00:11

idclark