18 July 2006

Build scripts and linguistics

In different types of languages, meaning can be represented to varying degrees through morphology or syntax. Meaning is expressed with morphology by, for example, adding "s" for plurals of nouns or "ed" for past participles of regular verbs. In this domain, morphemes are combined through declension and conjugation to generate word-forms with different meanings. Meaning is expressed with syntax by word order and subcategorization. For example: the determiners "the" or "a," when present, must be the first word in a noun phrase; the verb "sympathize" must subcategorize for a "with" clause. The lexical alterations of morphology are replaced with structural alterations of syntax.

At work, we've recently moved from Ant to Maven to manage our build process. Ant uses XML files to define build scripts that contain similar functionality to those of make files, declaring commands that define dependencies, create directories, or that compile and copy files. Although Ant build files are in XML format, they act basically as a procedural script. Maven also contains XML files, but they contain considerably less information and instead rely on a directory structure to define tasks. The presence or absence of a specific folder decides whether or not a standard build action will be executed on the contents of that folder.

The Ant language's imperative emphasis depends largely on morphology; Maven's structural emphasis depends largely on syntax. This is somewhat of an over-generalization but it is useful in understanding the different approaches, which can be jarring. Ant's tasks have structure that serve the same purpose as Maven's directories, yet the Ant tasks read more like word-forms and the Maven directories read more like subcategorization.

[ posted by sstrader on 18 July 2006 at 12:59:11 PM in Programming ]