ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: What is a 'declarative' language [ was Re: [VOTE] vote on ge neral direction ...]
Date Tue, 27 Mar 2001 19:36:34 GMT

----- Original Message -----
From: "Tim Vernum" <Tim.Vernum@macquarie.com.au>

> That's part of what I'm getting at here.
> Who cares if lisp is procedural or not?
> Just because lisp isn't procedural, that doesn't mean that adding
> lisp-isms is a good idea.
> Similarly, is lisp where procedural, then that wouldn't make its
> features automatically bad.
>
> I'd like to see list/set based operations. But I like them because
> they're a fairly clean, simple, and powerful way of supporting
> iteration, not because they're declarative.


Good point.  declarative != good in all cases;

One thing which Jose Alberto reminded me of is how implicit in Prolog the
ordering of clauses is -the engine finds the first one it can bind to and
goes depth first from there -the outcome of the same rules in a breadth
first search would be very different. Also backtracking doesnt work so well
once you have side effects -such as the results of the build targets.

Make has inference rules which have prolog-esque concepts -you can specify
that .obj files can be derived from .c or .cpp source, that idl builds to
cpp and then make will work out how to compile an idl file to binary. I'd
write that in prolog something like


builds(to(Path, File,obj),from(Path,File,c)) :- cc(Path,file,c).
builds(to(Path, File,obj),from(Path,File,cpp)) :- cplusplus(Path,file,c).
builds(to(Path, File,cpp),from(Path,File,idl)) :- idlcompile(Path,file,idl).
% transitive build rule
builds(to(Path, File,X),from(Path,File,Y)) :- builds(to(Path,
File,X),from(Path,File,Z)), builds(to(Path, File,Z),from(Path,File,Y)).

I well remember how it was those 'semi smart' inferences which caused half
the confusion in a large makefile. And, when I think really far back, half
the confusion in my prolog code. The simplicity of the <javac> task is what
got me into start using ant, and its that kind of simplicity I'd like to
have retained.

-steve






Mime
View raw message