ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rosenberg" <>
Subject Re: Problem using script task
Date Sun, 07 Jan 2001 05:40:06 GMT

----- Original Message ----- 
From: "Peter Donald" <>
To: <>
Cc: <>
Sent: Friday, December 29, 2000 8:19 AM
Subject: Re: Problem using script task

> At 07:44  28/12/00 -0500, Jason Rosenberg wrote:
> >Ant is a scripting language.  The idea of using a <script> task is a bit
> >nonsensical.  Just extend the Ant Scripting language to do the simple
> >things we need (there are not too many of these).
> ummmmmmmmm .....
> Ant is supposed to be a ***declarative*** scripting language. 

Not really, there are lots of built in procedural tasks, which are
part of the core (javac,mail,fail,etc.).  Actually, I think all the tasks
are procedural.  That is, they execute actions at the time they
are 'called'.  Even the <property> task behaves this way.  Nothing
'declarative' about tasks in Ant.

Perhaps, you could say that the <target> tag is a declarative programming
construct, but, of course, it is useless without procedural glue necessarily
added to it ("if","unless","depends").

Sounds like the old "Lisp is great, its declarative, but umm, could we
please have some loops and conditional execution added" reducto ad absurdum.
Lisp was worthless until looping and flow control was added, but then
the whole elegance of the declarative principal was lost.

There is no such thing as an adequate declarative programming

> I agree that
> the use of ant-call makes it procedural but that is only because we needed
> templating but couldn't rearrange the core dramatically to do it at the
> time ;) If ant-call was made to be more templatish then ant would return to
> being declarative.

Yes, agreed, templates are the crux of the problem, and antcall is a hack, indeed.
But, what is a template.  It's a reusable task.  One that can be recalled and reused
with different parameters.   Can you say "sub-routine"?

> What you seem to want is a ***procedural*** language which I am definetly
> -1 for a whole bunch of reasons that have been enumerated in the past.

Ant is procedural, and that is what I want.  It is close to being useful,
to date, but just needs to add a very small set of features to close the
case.  Simply admitting that it is procedural would really clear the way.
Let's stop beating around the bush.

> perhaps you also want negation, then implication, maybe xor ? ... Guess
> what you want perl/make - they already exist - lucky you ;)

Actually, implication is more a declarative logic programming construct,
which adds no value to my world view....

> personally I don't relish looking at
> <target name="foo" condition="a ^ ~(b == (c&d|e^f) ) &d" />
> and trying to work out what that means.

Yes, I think the beauty of Ant is that it has the power to keep
things simple and human readable.  I like the <execute-task>
idea mentioned by someone on another topic, or possibly a 
simple case:

<case property="caseProperty">
    <if value="1" execute="doMainCompile"/>
    <if value="2" execute="doPartialBuild"/>
    <default execute="showErrorAndFaile"/>

The execute attributes refer to other defined targets in the project.
Whatever....The point being is that it is a no-brainer to define the
language such that it is not at all difficult to read the embedded logic.

> >Some fundamental "task" issues are:
> >
> >    if-then-else
> >    switch
> >    loop
> not a chance of making core. If you want it then create your own tasks.
> Look to ant-dev archives for reasoning.

Not sure there is much reasoning to look for.  You seem to be saying
that the pristine declarative nature should be the primary consideration,
and yet, repeatedly, the core has been augmented by lots of absolutely
necessary procedural constructs, both in terms of the core builtin
tasks, and the "depends","if","unless", etc......

I think there are enough people now who see the shortcomings of your
historical reasoning that I would really doubt you are correct in saying
"not a chance of making core"....

View raw message