AaronCGoidel / SlothLang

The World's Greatest Sloth Based Programming Language
MIT License
11 stars 5 forks source link

SlothLang not Turing Complete? #20

Open carewdavid opened 5 years ago

carewdavid commented 5 years ago

It seems like SlothLang programs are pushdown automata, not turing machines, which limits the possible programs that can be written.

The only memory available to programs is the stack, and the targets of all gotos must be specified absolutely in the code, meaning that programs can only have a finite number of states, which fits the description in the linked article.

AaronCGoidel commented 5 years ago

Yes, this is true. At some point, I want to make the language turing complete. The two problems I have are 1) I am a student so I need to find time to figure all this out and 2) I need to figure out the syntax for all of these new operations which I want to implement. At this point, I am up to typing 'sloth' on a line 11 times which is getting a bit arduous.

carewdavid commented 5 years ago

Yeah, I wasn't sure how you wanted to do it. I don't think it has to be too bad, though.

The big thing is that the vm needs to have a buffer for programs to use as well as the stack. And then I was thinking that the input and output instruction could be extended to work with that. For example, a type code of three would read or write memory at the address on top of the stack.

I know what you mean about being a student, though. I'm in school too, I've just been having a suspiciously quiet week.