Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

(ichimunki) Re: RFC - OOP and Turing machines

by ichimunki (Priest)
on Jan 03, 2002 at 21:46 UTC ( #136015=note: print w/replies, xml ) Need Help??

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).
  • Comment on (ichimunki) Re: RFC - OOP and Turing machines

Replies are listed 'Best First'.
Re: (ichimunki) Re: RFC - OOP and Turing machines
by mstone (Deacon) on Jan 03, 2002 at 22:46 UTC

    > To that end, you should build as concise a Machine::Turing class as you can ...

    Hrm.. interesting suggestion. The code itself would be easy. I'll hammer out something and post it in the next day or two.

    I don't want to hit people with raw TM code right off the bat, because it tends to look like line noise. The logic of the program is distributed across the whole machine, and the connections aren't obvious until you know where to look. The whole point of the chapter is to teach people where to look, though, so I can introduce the class's interface one piece at a time as we walk through the heirarchy of simple machines.

    I think I'm going to upgrade that to "a most interesting and excellent suggestion." Thank you very much.

Re: (ichimunki) Re: RFC - OOP and Turing machines
by TheHobbit (Pilgrim) on Apr 18, 2002 at 20:48 UTC

    did someone implemented the idea of ichimunki? It looks interesting... If no one already did it, I'll be interested in trying.

    Leo TheHobbit
    GED/CS d? s-:++ a+ C++ UL+++ P+++>+++++ E+ W++ N+ o K? !w O? M V PS+++
    PE-- Y+ PPG+ t++ 5? X-- R+ tv+ b+++ DI? D G++ e*(++++) h r++ y+++(*)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://136015]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2018-02-22 07:44 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (288 votes). Check out past polls.