Search code examples
programming-languagesantbuildbuild-automation

Apache Ant as programming language


Is Ant programming language? If yes, is it imperative or functional?


Solution

  • The question should rather be: If you wanted to do computation with Ant, could you do it? Let us restrict ourselves to something simple, like emulating a simplified command-line calculator. If you can do this, Ant certainly qualifies as a programming language, even if that was not the intention of the tool originally.

    The perhaps simplest language we could define is "Huttons Razor", which consists of

    • Constants, like 5, 37, and so on, all Natural numbers (counted from 0)
    • A + operator, so we can write (37 + 5) + 15 + (42 + 0)

    Not a useful language by any means, but a magnificent start, should you try to abuse Ant to do computation; if you can't even do the Razor, you probably can't do something more advanced. Do keep in mind though that other means of computation, like the lambda calculus, is vastly different from this though, so it may be that other paths are also viable. Note: I don't know if Ant can do this. I last looked at it in 2006 and decided to never look at it again.

    Note that a language does not have to be Turing Complete to be a programming language. We have several, highly useful, programming languages out there which are not.


    For non-Turing Complete useful languages:

    • Languages that only accept Total programs (i.e., programs that terminate). This is a necessity for many programming languages that are used as theorem provers: Coq, Agda, etc. Another example is the Simply Typed Lambda calculus (the simple typing makes it impossible to define the Y-combinator and get recursion).

    • Languages that are heavily domain specific. One example is Troll,

      http://www.diku.dk/hjemmesider/ansatte/torbenm/Troll/

      which is a language for describing dice rolls in tabletop and roleplaying games. The language does not seem to be TC, yet it is highly useful when designing new games as it can quickly calculate probability distributions of dice throw methods.