The First Program
Posted by vincevincevince on September 1, 2009
Just a bit of fun! No, it doesn’t ‘actually run’. As I wrote it I was thinking about the power of God’s Word, in particular how his very command can cause things to be created, to come to life or to perform any action that he requires. In a way, it is similar to a programmer – one voice of absolute power with the ability to see, create, destroy and command all things. The parallel text can be found at the very beginning of your Bible.
[word@god ~]# cat creation.word
#!/bin/word // 1:1-5
begin creation
public earth = new domain();
earth.content = 1/0 * void();
earth.startCreation('spirit');
var light = new creation();
try {
earth.addChild(light); }
catch {
throw(E_BAD,'LIGHT FAILURE'); }
earth.light.status = E_GOOD; // all ok
list day('Day','Night') =
earth.light.filter(dark==false,dark==true);
earth.templates.day = day; // save for future days
earth.today = 1;
earth.days[earth.today++] = byVal earth.templates.day;
//firmament routine // 1:6-8
var f = new creation();
for (var a in earth.waters)
if (a.index>f.index)
{
f.waters.addChild(a);
earth.waters.removeChild(a);
}
private heaven = f;
earth.days[earth.today++] = byVal earth.templates.day;
earth.waters.defragment(); // 1:9-13
var dryland = earth.waters.getFreespace();
var seas = earth.waters.getUtilisation();
try { dryland.generate(E_GRASS,E_HERB,E_FRUIT) }
catch { throw(E_BAD,'LIFE ON EARTH NOT GOOD'); }
dryland.status = E_GOOD;
earth.days[earth.today++] = byVal earth.templates.day;
//lights in heavens, use for signs/seasons/days/years // 1:14-19
var lights = Array();
lights[0] = new light
(size = 10,
attach = earth.templates.day[Day]);
lights[1] = new light
(size = 2,
attach = earth.templates.day[Night]);
foreach (lights as l) heaven.addChild(l);
var stars = Array();
for (var a = 0; a < inf; a++) stars[a] = new star();
foreach (stars as s) heaven.addChild(s);
if (earth.checkStatus()) earth.status = E_OK;
else throw(E_BAD,'LIGHTING ERROR');
earth.days[earth.today++] = byVal earth.templates.day;
earth.generate(E_WATERCREATURE, E_FOWL); // 1:20-23
earth.setGenerationSpeed(1000);
foreach (earth.creation as x)
if (x.typeOf == E_FOWL) x.setDomain(earth,heaven);
earth.generate(E_WHALES);
foreach (earth.creation as x)
x.limitChild.typeOf=x.typeOf; //after their kind
if (earth.creation.checkStatus()) earth.status = E_OK;
else throw(E_BAD,'CREATION ERROR');
foreach (earth.creation as x) x.nice--; //more CPU
earth.days[earth.today++] = byVal earth.templates.day;
var livingcreatures = // 1:24-31
Array(E_CATTLE, E_BEAST, E_CREEPING);
earth.generate(livingcreatures);
foreach (earth.creation as x)
x.limitChild.typeOf=x.typeOf; //after their kind
if (earth.creation.checkStatus()) earth.status = E_OK;
else throw(E_BAD,'CREATION ERROR / LIVING THINGS');
//man project
var man = new creation();
man.style = byVal earth.parentNode.style; //cp God
foreach (earth.creation as x)
if (x.hasLife) x.addController(man.groupId);
man.addVariant(E_FEMALE);
man.addVariant(E_MALE);
man.addFood(livingcreatures,E_GRASS,E_HERB,E_FRUIT);
man.nice--;
earth.creation.addChild(man);
foreach (earth.creation as x)
if (x.hasLife && (x.typeOf == E_BEAST || x.typeOf == E_CREEP ||
x.typeOf = E_FOWL)) x.addFood(E_HERB);
if (earth.getStatus() && heaven.getStatus()) return (E_VERYGOOD);
else throw(E_BAD,'FAILURE ON DAY 6');
earth.days[earth.today++] = byVal earth.templates.day;
daemonize();
//TODO: rest
//TODO: expose parent API to creation
//TODO: invoke interactive-mode man object (sometime later)
end program
[word@god ~]# date
Mon Jan 01 00:00:00 GMT 0000
[word@god ~]# ./creation.word
Creation started as pid 143. To stop type: kill -9 143
Got status: E_VERYGOOD
Appending output to creation.log
[word@god ~]# _
Hope you found it worth the read! Drop me a comment if you liked it; but please no technical questions on syntax or language!
Comments
6 Responses to “The First Program”Leave a comment, and if you'd like your own picture to show up next to your comments, go get a gravatar!



That is freaky. Just this morning I was saying to my husband that we have the world at our fingertips now via the computer, and too bad I didn’t when I grew up. I’d be much smarter. Then I added, back then it would have been unfathomable for our puny minds to believe that such a thing as what we now know as “Internet” could ever exist.
Then I said, “and people wonder why their minds can’t fathom God’s existence or fathom creation”.
I don’t even know you but see you are following me on Twitter so looked you up. In any regard, it is mind blowing to see your writing on the same kind of theme the same day I was thinking the above! Thank you.
I loved this!
This is awesome. I might put it on my site – I’ll of course credit you and link back to your site.
Verrrry cool
Unless I missed it, you need a catch error for earth.content = 1/0 * void(); <– Throws up Division by zero error
Thanks Bosco Peters & Bruce!
1/0 is undefined (without form):
Gen 1:1 “The earth was without form and void”
–> earth.content = 1/0 * void();
Hi, this is a masterpiece! Shows that humans are truly created in the image of God, with mad skillz