On 08/02/2011, at 3:26 PM, john skaller wrote:
[]
BTW: look at how "dependencies" are specified here:
> types = call('fbuild.builders.c.std.config_types',
> phase.ctx, phase.c.shared)
>
> macros = ['BUILD_JUDY']
> if types['void*']['size'] == 8:
> macros.append('JU_64BIT')
> else:
> macros.append('JU_32BIT')
>
This is functional, with a variable for the temporary "types". To choose
JU_64BIT or JU32_BIT
we need to know the size of "void*".
To find that size, we call the function "config_types".
We can't get this wrong: you need the "types" variable to lookup the size,
the way to get it is to call "config_types".
The dependency is expressed functionally by execution, not by a declaration
that you have to make target "config_type" before you can make target "Judy".
fbuild will only actually call "config_types" if it is out of date or not yet
calculated,
otherwise it uses the cached result of a prior computation.
In other words the dependency is "discovered" **dynamically** by executing
the Python script.
Yes, there's a problem: Python is dynamic so there's no static checking.
But the point is again that the rules contain the dependencies: you don't have
to state them explicitly separately from the build rule.
Basically we just say "make with the targets removed and the build rules
written as function calls", then ordinary dependencies of functions:
calculate the arguments before calling the function -- expresses the
dependencies.
The reason why this is "better" than "make" should be obvious: you just
write code to build your system, using ordinary function calls.
Python is NOT the best language for doing this, but it has all the stuff needed
for database storage, serialisation, remote procedure calls, networking,
and a lot of other libraries built in. It's not just Turing complete, its a
HEAVILY
tried and tested general purpose programming language with good documentation
so it has to be better than a micky mouse programming language like Make.
[Importantly any language based on substitution is suspect: macros don't work
well. Programmatic operation is the only way, you want to say "replace this
with that"
explicitly, not write a rule with holes in it that are automatically filled in.]
Make can't handle configuration: people use autoconf for that. And other tools
for all sorts of other things.
Python can do all of this, either natively, or by callouts. So the whole build
process can be expressed in ONE language.
--
john skaller
[email protected]
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel