die(xsltproc) :)

Bruce Dubbs bdubbs at swbell.net
Wed Nov 30 09:23:52 PST 2005


Jeremy Huntwork wrote:
> Hey Guys,
> 
> As I mentioned in a reply to one of Richard's posts, I've been working
> on a way to get rid of the xsltproc dependency with jhalfs. This may or
> may not be useful - time will tell. One of the main reasons for my
> attempting this was to beef up my C skills. I've learned a lot in the
> past week or so. :)
> 
> Anyway, I'm working on a C parser designed specifically to parse the
> LFS book for it's commands. I'm not quite ready to share the code yet,
> but I'll share the results so far.
> 
> Right now it just prints out it's progress and what it has found:
> 
> $ time { ./parser ../lfs-trunk/index.xml > parser.log; }
> 
> real    0m0.782s
> user    0m0.010s
> sys     0m0.020s
> 
> And here's the parser.log:
> 
> http://linuxfromscratch.org/~jhuntwork/parser.log

Of course, its your project and your time, but I don't see the point.  I
did a quick check by stripping out everything except the xsltproc
command and got:

$ ./jhalfs.test
Extracting commands...
real    0m13.999s
user    0m13.612s
sys     0m0.353s


Writing a program in C to save 13 seconds out of approximately 4 hours
build time seems a bit out of place to me.

Besides that, the .xsl is about 200 lines.  That will be a lot easier to
maintain than a C program that will be considerably longer.  The xsl
also does not have to be built with a separate compile.

The purpose of xslt is to convert documents from one form to another;
in this case from xml to a Makefile.  Using a general purpose tool to do
what a specialized tool already does seems like a less than optimal use
of resources.
  -- Bruce




More information about the alfs-discuss mailing list