Re: t/postconfigure/03-revision test 1 taking forever?

2008-02-02 Thread Andy_Bach

> >> svk is asking (unnecessarily, one might conclude)
> >> if you
> >> want to create the local Replica before it answers the question 'svk
> >> info'
> >> on a newly created test dir.

>> But shouldn't the test be non-interactive? :)

> The test could check for the existence of $HOME/.svk or $SVKROOT before
> running any svk commands to avoid this problem.

I think that runs into the wish to not get into the internals of
svn/svk/git in doing these tests. Not sure I agree, but that was a comment
I saw somewhere.  It does seem svk could have a "are you setup?" query or
not start setup up on a bare 'info' ... but there seems something wrong w/
the Parrot::Revision doing 3 consecutive svn/git/svk trys at info and just
living w/ the dieing/missing exes as a brute-force sort of test.  I mean,
if we know enough to ask 'svn -xml info' [1], then using $HOME/.svk or
$SVKROOT (though I think svk looks in at least 3 places, which may just be
their point ;-) doesn't seem to be peaking too far under the covers.

Could Configure do a more thorough job of finding svn/git/svk and/or
finding out which (if any) was used to get the build? Suppose that only
helps Parrot::Revision in the building situation.

a

[1]
The reason I got into this mess was adding "-xml" to the svn info test
broke on my box w/ an old version of svn.  It made smoke reports fail w/ an
'invalid format' and it took a while to trace that back to a bad rev number
(zero) and that to svn -xml info failing into /dev/null but being treated
as saying "yep, ver zero here!"

Andy Bach
Systems Mangler
Internet: [EMAIL PROTECTED]
Voice: (608) 261-5738 Fax: 264-5932

Windows defenstrated - sent from my MacBook Pro (using Notes)!!!



Re: More pruning

2008-02-02 Thread Bernhard Schmalhofer

Andy Lester schrieb:

I'm also suggesting that we prune old unused docs, starting with:

=head1 HISTORY

Initial version 2004.06.11 by Matt Fowles

Not to pick on Matt (since much of these are by Leo), but I see zero 
value in this used-once boilerplate.  Anyone mind if I get rid of it 
as I come across it?



+1




Re: A PAST Building Blocks document?

2008-02-02 Thread Klaas-Jan Stol
On Feb 1, 2008 9:49 PM, Will Coleda <[EMAIL PROTECTED]> wrote:

> On Feb 1, 2008 3:24 PM, Klaas-Jan Stol <[EMAIL PROTECTED]> wrote:
> > hi,
> >
> > for people starting to use PAST nodes, it might be difficult to get
> started,
> > or not very clear what you can do with it. For instance, suppose you
> have a
> > certain language construct to translate, you need to figure out which
> past
> > nodes you have to create, and what attributes.
> >
> > would it be an idea to create a document describing the PAST nodes by
> > example, showing what the attributes do (what effect) and how the
> generated
> > PIR is affected by the several options?
> >
> > an example is attached.
>
> +1
>
> > If this isn't considered worhtwhile,I won't work on it any longer (I
> > actually do have other stuff to do :-),
> > but if this idea is thought to be a good idea, i'll work on it a bit
> more.
> > Other people are invited to add stuff too :-)
>
> Improving the state of the documentation is always welcome; think if
> it as an investment to get even more people working on stuff.


Ok, I did some more writing and added the file to docs/, named
"past_building_blocks.pod".
The name can be changed later if necessary.

I also intend to add more "tips&tricks", common constructs that can be used
to write efficient and easy action methods.

I invite all PCT users (rakudo hackers :-) to add their tricks if they know
of "good practices".

I'm also thinking of something similar to compiler_faq.pod, which is an
index of "how do I implement X in PIR?". Similarly, there could be some kind
of index for "what PAST nodes do I need to implement a {"if", "while",
"assignment", "for"}-statement".

kjs


Re: t/postconfigure/03-revision test 1 taking forever?

2008-02-02 Thread Andy_Bach
> ok 3 - Able to make Parrot dir
> ok 4 - Able to copy Parrot::Revision
>
> After a C^c
>
> ok 5 - Got numeric value for reversion number


Let me guess - you've got svk installed, but never used it.  Try 'n'
instead of Ctrl-C. svk is asking (unnecessarily, one might conclude) if you
want to create the local Replica before it answers the question 'svk info'
on a newly created test dir.

An note for 'ok 5' - not really. The test checks for there being a digit in
the resulting rev but not if it's the correct digit. I believe it's not,
the failed tests return a zero and the tests seem as though they should
expect some other number.

a


Andy Bach
Systems Mangler
Internet: [EMAIL PROTECTED]
VOICE: (608) 261-5738  FAX 264-5932

Windows defenstrated - sent from my MacBook Pro!!!



[perl #50472] [RFE][PAST] register/result node referencing (or something)

2008-02-02 Thread via RT
# New Ticket Created by  Klaas-Jan Stol 
# Please include the string:  [perl #50472]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=50472 >


hi,

consider the next scenario (using lua as HLL)

-- create a new table object (just a hash/array combination), and initialize
with some values.
foo = { a = 1, b = 2, c = 3}

This can be roughly translated to this PIR:

$P0 = new "LuaTable"
$P0["a"] = 1
$P0["b"] = 2
$P0["c"] = 3

(using PCT, these integer values will be created as "Integer" PMCs, but
that's not important for now)

to generate such a thing using PAST nodes, we'd do something like (I think
there are other solutions, but this is straightforward):

method table_constructor($/) {
   my $past := PAST::Stmts.new( :node($/) );

   my $table := PAST::Op.new( :inline('%r = new "LuaTable"') );
   $past.push($table); # push the table construction onto list of statements

   # now for each init. field, we'd like to generate a "$P0[] =
" statement
   for $ {
 my $field := $( $_ );
  $past.push( PAST::Var.new( $table, $field, :scope('keyed') ) );
   }

   make $past;
}


However, when doing this, every time $table is specified as an argument in
the for loop, it will generate an instruction

$P0 = new "LuaTable"

which is not what we want, obviously.
Somehow, there's the need to refer only to the result register in which the
new LuaTable is stored, the register that is generated from the %r symbol
above.

There are more scenarios that need to reference only the result of a certain
expression.
PAST does not support this currently, and I think it would be helpful.

possibly through a method $table.result() or whatever, but that's only what
comes to my mind initially.

kjs


How to Remove PARROT_API from PMC Vtable Entries

2008-02-02 Thread chromatic
libparrot exports over 16,000 symbols.  Half of those are the vtable functions 
in our PMCs.

For now, they get exported because of the way we build the vtables when we 
initialize PMCs.  Look in src/pmc/class.c in a built Parrot source tree for 
now.  Parrot_Class_class_init() creates the Class PMC's vtable as an array of 
mostly function pointers.  Because Class inherits some behavior from the 
Default PMC, its vtable array contains pointers to functions declared in 
Default.

That doesn't imply anything about the visibility of those symbols... until you 
consider that dynpmcs have the same strategy.  That is, every dynpmc either 
reimplements its own functions, or its initialization code has to refer to 
symbols explicitly exported from libparrot to get at the function pointers 
directly from the Default PMC, or whichever core PMC is its parent.

Instead, we should *clone* the parent's vtable, then override only the 
function pointers that the current PMC provides directly.  This requires two 
pieces of information.

First, we need a way to map the appropriate slot in the vtable array for each 
overridden entry.  That's easy.

Second, we need a way to know the proper initialization order of PMC vtables 
such that we handle all parents before all children.  Making this work for 
core PMCs is fairly easy.  Making it work for dynpmcs is a little more 
difficult, but still doable.

I've attached a small program which should get generalized into a module 
somewhere and somehow, and integrated into our build system.  It reads 
the .dump files produced when we parse the .pmc files.  Then it builds up a 
tree of dependencies, starting with the default PMC, and produces a list of 
PMCs in root-most dependency order.

We'll need to move the generation of src/core_pmcs.c from configuration time 
to compilation time, but that's simple.  The important function in that file 
is Parrot_initialize_core_pmcs().  Look at the branch where pass = 0.  All we 
need to do is reorder that list of initializations.

The same technique will likely work with dynpmcs.  However, generating the PMC 
group files is a bit more complex.

I hope to work on this over the next week or so, but if anyone wants to look 
at the dynpmc group configuration process and see how to make it easier to 
generate the initialization code there, please feel free.  I recommend 
looking in languages/tcl/ for starters, as its src/pmc/ directory is clean 
and clear and the example is sufficiently complex that if we can handle it 
correctly, we can handle everything correctly.

-- c



vtable_order.pl
Description: Perl program


recent svn issues

2008-02-02 Thread Robert

Dear parroteers- 

A small number of people have reported periodic issues committing to
the parrot subversion repository.

As of yet, we've been unable to create a repeatable test, find
anything obviously wrong that might be causing this issue, or even
logs that show a horrible error on our side.  (But there have been
enough reports that we do believe that *something* is wrong.)

It is on our radar, and we are working on trying to figure it out and
resolve it.

-R