Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

Matts
  (email not shown publicly)

I work for MessageLabs [messagelabs.com] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Tuesday May 29, 2007
07:18 PM

Wither Cons

[ #33369 ]

Today I had to compile a C project with over 200 .c files. If I'd used a Makefile I would have had to list every .c file (yes, I could auto-generate).

Instead I downloaded and used "Cons" - a little known perl utility for software construction. The "Construct" file became:

$cons = cons->new(
    CFLAGS => '-O2',
    LIBS => '-levent',
);
$cons->Program("dnsserver", <*.c>);
Default(qw(dnsserver));

So I went digging to see why the project hadn't been updated in a long time. Turns out the author didn't like perl OO so just stopped.

There's now an SCons project in Python that's getting a lot of attention, and owes its history (and some of its syntax) to Cons.

Perhaps it's time for a back-port to perl. I used Cons instead of makefiles to get away from indentation being significant!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I’d rather write something more akin to Ruby’s Rake in Perl. There’s TinyMake [cpan.org] on CPAN, but it’s too limited and I didn’t like the code. I’ve already sketched it out a little but didn’t start yet.

    • Rake frankly looks awful. No automatic dependency generation (as far as I can tell) and you basically have to write the compile commands yourself, rather than having the library do it for you. You might as well just write a Makefile!

      Perhaps I've missed something though - I only went through the tutorial.
      • And that’s awful? Sure, it doesn’t do automatic dependencies, but Rake is Ruby and Rakefiles equally are Ruby – so unlike with Make, implementing arbitrarily complex functionality either in the build script or as a subclass of or some form of plugin for the engine is straightforward.

        Cons’ architecture so fixated on one optimising for the compilation of C code that you can’t reasonably use it for anything else. If you want to repurpose it in any way, you have to hack on Cons

        • Sounds like it's the implementation/internals you don't like (which I agree with) rather than the concept. I think that's spot on.
          • More or less, yeah. I have no beef with the featureset of Cons, just with the things absent from its featureset.

            F.ex., I’ve wanted to write a build script for my website; it’s currently powered by make and libxslt’s xsltproc tool. But I’d like to be able to use XML::LibXSLT instead, register a few XSLT extension fuctions right inside the build script, along with one or two functions to drive transforms, and then use those in my task recipes.

            If I were using Ruby and Rake, that wou