Friday, December 9, 2011

more thoughts about programming

I've come across the programming lanauge for text based adventure games at 
http://inform7.com/learn/man/doc61.html


Basically they wanted a language which was english like and able to handle cool amounts of inferanceing. I described it to a college as vernacular programming. Look the kinds of constructs they give. 


A dead end is either secret or ordinary.


This creates just one new property, not two. The names are taken as the two states of a single either/or property: secret means not ordinary, ordinary means not secret


A dead end is usually secret. A room is usually indoors.


A property can be used by several kinds at once. For example, the built-in either/or property "open" is used by both doors and containers, even though door isn't a kind of container and container isn't a kind of door.


Wow imagine if you had this in a typical programming languages or 



The lightest and easiest way to change behavior is with an Instead rule:


Instead of eating the apple: 
    say "It turns out to be made of beeswax, so that's a non-starter."
Instead of tasting an edible thing: 
    say "It's delicious!" 
    rule succeeds.

So basically this is like intercepting a message and redefining it ( but outside the comfort of a class). 

I'm not sure how much good software engineering there is here but that doesn't matter. What matters is how provocative this is in programming terms and I'm very provoked. 


No comments: