in reply to
RFC - OOP and Turing machines
Although I think Perl might not be the most ideal language for discussing OOP, I would be *very* interested in seeing the ideas in this chapter expressed as Perl scripts (preferably objects). That way some of your assertions can be demonstrated so that those of us who struggle with the abstract concepts here can see a concrete example, rather than trying to form our mental image only from words and diagrams.
To that end, you should build as concise a Machine::Turing class as you can, maybe with some very simple methods:
- initialize: accepts a reference to a list to be used as a tape
- cycle: performs one cycle in the machine
- state: so that we can find the tape position, and maybe the result of the last write
With just these three methods I think you would clearly capture everything we want to be able to do with a Turing machine, and you'd have an opportunity to introduce some idiomatic OOP scripting right away. Also, then when you state that we can do anything with multiple Turing machines that we can do with one, you might be able to demonstrate that. You would also be able to show how the Machine::RandomAccess class would look in comparison.
And in this way your conclusion, that all objects are simply Turing or random access machines, is even easier to bear out-- as you can then point to the characteristics that all objects have in common with your example implementations of these two machines (and therefore with the abstract ideas that those Machine::* classes represent).