When I never would have heard about FRACTRAN designed by Conway I would not write this.
The way generally nowadays information processing is imagined - maybe not by all - is there are commands in memory, there is data in the memory and that all is stationary and not moving, while the programm counter moves and processes command after command, the exception being jumps and moves. No claim that this is complete or so.
Now, imagine a moving data stream, I from now on call the input worm or Iworm. It passes through three kinds of folks (seems right now no better word comes to my head) which can modify the Iworm or send it home. Well, I forgot to tell, the Iworm starts initially from its home , passes through the folks , yeah and some folks send it back home.
The Iworm moves around , well, until it feels bored. It feels bored when there is nothing left to do. Program finished for today.
The Folks are of three kind. The Robber or Taker folks, the Giver folks and finally the Dealer or Trader folks.
The Robber folks is just taking away some stuff from the Iworm and when they snatched some , they send the poor Iworm home crying. When they can not get what they want however they do nothing.
The Giver folks are very rare and are not found in every program. They always give some kind of stuff and thus may cause the program continuing forever. The Givers always send the Iworm back home.
The Dealer folks give the Iworm stuff when they can get what they want. They take always what they want and give the Iworm what they think is good for him. After they got what they wanted they always send the Iworm back home.
I could have called the Stuff primes, and actually that is what they are in FRACTRAN. In a turing-complete world/environment/or whatever there are unlimited kinds of stuff. The stuff is the input and what the Iworm consists of is the stuff. What if there was no input , or all the stuff has been taken away from the Iworm ? Could there be such a thing as an empty Iworm ? Well, we do not want it if we want the whole thing to work.
Input must be of Stuff used in the world/programm. For it being used it must be part of what the folks is giving, taking or exchanging.
There is more about the Stuff in the implementation part of this page.
Yeah, we can have 2d , we can have 3d , but in the basic model we just have one dimension and one direction to go forward and the other being straight home and when the Iworm reaches the end, it continues from the very beginning again.
The syntax , well , hated in school , well it is used every day, so for this all going to be a language there's gotta be some syntax in it.
What is required for the basic model are symbols. The classic top to bottom is most supported by common real world text processors. For this thing to work in the imagined way , a worm and a world where the folks lives is required.
Also the worm must have a home and only one home in the world file or it is not going to work the way it is wanted.
Well, why I mention this , you would not put your sausage or your mustard in the ... well , where it is not supposed to be.
Which symbols are allowed and which are not must be defined in the implementation. When it is not mention, suppose the O (looks like a hole) is the Iworm's home. Then comes a carriage return and a definition of the folks the Iworm is going to meet first. Well, a separator or "path" is required. On the left side is written what the Iworm should get , while on the other side of the separator or "path" should be written what should be taken from the Iworm. Let us define the "path" or separator as II, for reasons explained further.
Actually there are two special symbols defined the worm can not consist of , because they are special symbols, which can not be Stuff and the worm must contain of Stuff. So O or II can not be the worm or even part of it.
The Iworm is defined in a worm file. The world is defined in a world file. Thus following would make a working world file.
According to definition until now. Well, why sould one be forced to write @@@ when @3 can be written which is shorter? Okay, we make @@@ and $$ a syntax error. Thus the previous example is no working world file any more.
That would be a working world file.
To write @0 or @1 should also not be allowed, because they better be replaced with nothing and @. Zero pears look like zero apples ,but @0 does not look like $0. So why making things unnecessary difficult. Also there is no need to write @1 and so on because just @ would be shorter.
Thus let us say we define stuff like this. Thus would @4$ make a working worm file while @@@@$1 , @@$@@ and so on would not.
Thus would also be a valid world file.
@3II$2 O II$
Oh for some reason we want something to mark the end of the file. How about adding II because a folk who does not give nor take nor anything would not make sense here. Hmmm... well it would send the worm always back to its home because it does not depend on the worm's content/stuff.
Further II can not be confused with I2 nor I nor nothing and so I can be used for Stuff and thus be part of an Iworm.
Yeah, we want it , Startrek , Wormholes ... let us define them and forget about them in the basic implementation. There can be more then one home or whole in the world file. Valid holes are O or O followed by a number consisting of the numbers 0-9 except O0 and O1, which I do not like for the aforementioned reasons.
However if you feel pleased make an implementation where a world file who contains something like OHappyDay , OMyGod and so on would be valid.
Thus it should be required to add where the folks sends the worm. It could/should look like @3II$2O2 or maybe in your implementation $1000IIU2OMyGod.
The Working Sample
O @3II$2 II Hey, there's room for comments
So far only symbols can be of one ASCII or Unicode character depending on implementation. Maybe more is wanted and yet another definition. We define ' as an indicator for larger symbols. A larger symbol consists of more than one character and starts with ' and has to end with either ' or a valid number. Valid numbers consist of the numbers 0-9 and may not start with zero. Also only 1 as a number is not allowed and has to be replaced with '.
Thus 'hello' , 'hello2 and so on are valid larger symbols, but 'hello1 or 'hello0 is not. For the symbol ' , there has to be written . For compatibility reason this should be included in all implementations.
The Cool Implementation
allows graphical output. Stuff will be presented as graphical objects, like birds and bees, flowers and trees and so on. There will be sound effects, blinking and what is really cool. Maybe also some cool error messages, animations and maybe also stereoscopic effects in the magic eye addition. Also larger symbols will be implemented.
The Full Fantasy Implementation
is what you probably will get or can at most expect from me. It will only implement the very basic stuff, maybe make some really hard commitments to the syntax, like omitting most when not all of the syntax checks - maybe some comments like "its up to u" will do - and maybe some comments like , "you can add it ,if you really want". Well, the code will not be too long and will not contain most of the unnecessary and unexplaining and even irritating comments which are sometimes found in source code.
Details will be contained in the source code file of the F.F.I. like how will be dealed with the output, which was not even discussed anywhere on this page.