Monday, 3 August 2015

The water race and helpful chickens

I have a water race at the far end of my back paddock.  Somewhere uphill to the north, there's a river and some of the water is redirected down this water race.  The neighbours have animals grazing in their paddocks, and they just walk up and drink from it.   And through it, and back, and certainly defecate in it while they're there.

Unfortunately, as time passes it fills in with muck the animals send downstream, the clay at the sides eroding and water weeds growing on top, and it fills in. The end result is that the water is now at the level of the ground alongside the water race, and it floods areas of the paddock.  At this point it needs to be dug out.  If I had grazing animals in my paddock, I wouldn't have this problem. What I would have though, is grazing animals rubbing up against and breaking my orchard trees.

Here's a comparison shot which shows my dug out area on the left, and the overgrown area on the right.

The length I've cleared so far.  Really, in an ideal world I'd dig it all a meter wide all the way along, and I'd do it while it's all sodden from being flooded all the way along.  But in this world, the less hours I spend digging muck is better.

The area on the right-hand side between the olive tree and the water race, back to the fence was the where the worst of the flooding was.

What I really like though, is the brown area in the foreground.  It's where the chickens have scratched the grass clear and now there's hay on top of powdery dirt.  This is a huge advantage to me for the upcoming spring, as it means I don't need to clear grass to make new garden beds.  The area ahead will likely be used to plant bloody butcher corn or a range of broad bean varieties.  While they've scratched up that area all on their own, I might see if I can start sections in the foreground and get them to clear more of that area.

Here are the chickens at work scratching up another area of grass they've already cleared pretty well.  This area and all around where I am standing to take this photo will likely be where I plant a wide range of pumpkins, all of which are cucurbita maxima varieties.

Some time in the coming week, the chickens will be getting treated with diatomaceous earth.  This involves putting them up to their necks in a pillowcase, and shaking the pillowcase around them.  Classic internet advice.  Maybe it will work, or maybe it won't.

Tuesday, 28 July 2015

Imaginary Realities volume 7, issue 3 is out!

The latest issue of Imaginary Realities is now available for reading.  Volume 7, issue 3.

It features the following articles:

  • A text MUD with a working ecology system
  • Dispelling the gloom
  • How integral are letters and text to ASCII gaming?
  • Legend and the lore
  • The bonds of mudding
  • The mercurial temperament at the end of the world
  • Where do I begin?
With one article related to roguelikes, another to interactive fiction and the rest to mudding, it should provide our most diverse collection yet.

PDF and EPUB e-books are not currently available.  The new website generation creates these automatically, rather than manually as they were made before.  But unfortunately, getting them to look nice enough to be worth distributing requires a little more work.  They'll be added back to the website before (or with) the next issue hopefully.

Announcements have been made on:

Tuesday, 14 July 2015

IncursionScript and the Accent Compiler Compiler

When I got a few minutes, I spent a bit more time looking at replacing the Accent usage in Incursion.  For the most part, Accent works pretty much the same as yacc or bison, but does so in a much more user friendly way.  Yacc and bison use BNF grammars, where Accent uses an EBNF grammar.  This allows minor use of some of the regular expression syntax to avoid painful rule finagling completely.

This StackOverflow post quotes the type of work you have to do (from another web page), to convert from EBNF to BNF.  Looking at the one off case, it only seems mildly inconvenient, but when you have several variations, it becomes painful.  Especially, if you're considering converting ~100k of rules for parsing IncursionScript.

  MONSTER { theMon->Attr[0] = theMon->Attr[1] =
            theMon->Attr[2] = theMon->Attr[3] =
            theMon->Attr[4] = theMon->Attr[5] = 0;
            CurrAttk = 0; CurrFeat = 0; theRes = theMon; }
  LITERAL<name>  { theMon->Name = name; }
  ':' cexpr3<n>    { theMon->MType[0] = n; }
    ( ',' cexpr3<n2> { theMon->MType[1] = n2; }
    ( ',' cexpr3<n3> { theMon->MType[2] = n3; } )? )?
    '{' (mon_entry)* '}' { theMon++; };
That was the initial part of a monster type definition. Note that the Accent grammar syntax for the left hand side of rules, embeds the parameter name in < and >, whereas bison has a much more limited support and uses [ and ]. Also, the right hand side of a rule can use the previously mentioned aspects of regular expression syntax. In this case ( and )? are used to indicate 0 or 1 occurrences of a match, and additionally + and * can be used similarly to indicate one or more, and none or more matches.  Note also that the parsed parameter values are used directly in the code blocks, without syntactical sugar, where bison requires that n be $n.

Any use of these regular expression syntaxes would when rewritten for bison, require more and more complicated contrivances and would break up the whole rule making the grammar less readable.  In theory, it should be possible to construct a bison grammar that parses the Accent syntax, with a matching lexer, and convert an Accent grammar to a more convoluted bison grammar.  The bison grammar for the Accent syntax isn't hard to do, in fact, the Accent author provides one in their documentation.  The bulk of the work would be in writing some subset of C parsing, to transform the code blocks, and then there's the flexible Accent parameter lists which bison cannot support at all.

Old with dated pre-ANSI code and using a GPLv2 license, requiring a commercial license to be able to be used freely, Accent is a not just a compelling alternative to bison.  It's almost impossible justify downgrading from it, if one ignores the unfortunate license.  But to become something where any inspired player, can open up a script and start modding, it needs to downgrade from it.

Translating the grammar from EBNF to BNF?  Not enough.  Bison doesn't offer the additional support required.  This solution would still require hours of painstaking rewriting of the custom Accent grammar syntax.

The only remaining alternative, is to write an Accent replacement.  Or to enhance bison or byacc, to support EBNF, and the additional functionality.  But then how many hours would that require?  It might be worth downgrading that 90k Accent grammar to a bison grammar after all.  Something to think about it.

That reminds me, I've searched everywhere three times and I can't find my Dragon parsing book.  It's gone.  I imagine it's with all my compact flash usb adapter, my micro sd card, my issue of Dragontales, and the other things I haven't noticed going missing yet.