Make, Rake like tool in pure perl. I need feedback.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm trying to rewrite rake, "build language" so it would fit within
perl. If you don't know what is rake here you find all the info:

Rake project main page: /

Rake syntax:

Rake tutorial:

In general it's a embedded domain specific language doing same things
as the unix make utill but it is using only ruby language.

I'm not a perl expert and I  would need some feedback from some more
experienced perl programmers.

The source code is available at
You will find there:
1) pake - main app, definition of method available in Pakefile
try running:
./pake -T
./pake test3
./pake program

2) Pakefile - the srcipt where you define dependencies
3) Pake - in this directory you will find all perl classes I'm using
in the pake.

First question goes to the language that should be exposed in Pakefile
(analogy to Makefile, Rakefile scripts)

In rake you would define task like this:

task :prereq1 do
  # ruby code here

task :name => [:prereq1] do
   # task name depends on prereq1 task, so if you run task name it
   # will execute prereq1 first after that body of this task

In perl, by prototyping I've achieved smth like this:

task {
     # task code here
} "test";

task {
     # test1 task depends on test task
     # test 1 task code here
} "test1" => ["test"];

Can I move the anonymous subroutine to the end of the task function
call, so that I would not be forced to write it like this:

task "test", sub {
# task code here

but like this:
task "test" {
# task code here

Another issue is more about perl idioms. I'm mainly programming java
so it's quite bizarre for me that if I bless hash variable to object I
have no option to block access to some variable (private modifier in
What is the preffered style:
Creating set/get subroutines
using Autoload?
direct access through blessed variable
some other option?

I'm also interested what elements of rake language should be in the
perl version I'm writing out of the box. Namespaces? Adding some
specific tasks? Integration with some existing perl frameworks? Maybe
you are doing some things repeatedly and you would find it useful. I
will appreciate any feedback and opinions.

Re: Make, Rake like tool in pure perl. I need feedback.

Krzysiek wrote:

Quoted text here. Click to load it

Interesting idea ;-)  It takes the Module::Build idea, and takes it three
steps further away from simple, back toward a generic make, but perlishly.

In my estimation, you'll get much more feedback by posting to than usenet groups.

Quoted text here. Click to load it

First feedback: not everyone has threads enabled in their perl... a better
error message would be appreciated ;-)

Quoted text here. Click to load it

Apparently not.  At least, not without some sort of source filter.

Quoted text here. Click to load it

Right.  See perltoot.

That said, you may want to use Class::InsideOut which kind of does this for
you.  Personally, I'm not a fan, but others with more experience than I are
fans, so it may be a good idea to check it out and decide for yourself.

Quoted text here. Click to load it

FYI: in perl, this is one subroutine, not two.

sub foo {
  my $self = shift;
  if (@_) {
    $self-> = shift;

Quoted text here. Click to load it

I only do this when I can't know at compile time what my attributes will be
(e.g., for base classes).

Quoted text here. Click to load it

No.  Just like in Java, this prevents us from doing any debugging based on
access to this variable.  With the above, you can go into the debugger and
put a breakpoint on the set-line, and get stack traces of any access.
Direct access makes this much more painful.

Quoted text here. Click to load it

I'm sure most perl gurus would just shrug and say, "eh, makefiles are
working for me just fine."  :-)

Again, I'll say that you should try posting your question to -
you'll likely get much more feedback there :-)

Site Timeline