Re: Design by Contract for perl internals

2000-08-17 Thread Michael G Schwern

On Sun, Aug 13, 2000 at 07:16:41PM -0400, Chaim Frenkel wrote:
> What do you think of creating a mechanism for attaching pre-, post-,
> invariant conditions to the internals?

I'd like to point out that two modules already do this.
Class::Contract which was just unleashed by Damian Conway, and
invariant.pm which Abigail recently posted up to Fun With Perl.
Class::Contract is by far the more complete.

I wouldn't mind an optional OO contract system in the core of Perl,
but this may be a case of "why do it in core when a module will work?"
Since OO contracts are typically turned off in production code any
performance gains from adding it to the core wouldn't matter much.

What we might want to do is ask Damian and Abigail (who have been
CC'd) if they have any feature requests which would allow them to
make their modules better/faster/more complete.  We'd also want to
consider distributing Class::Contract with perl6 (or perl5 even).

-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
Maybe they hooked you up with one of those ass-making magazines.
    -- brian d. foy as misheard by Michael G Schwern



Re: Design by Contract for perl internals

2000-08-17 Thread Michael G Schwern

On Thu, Aug 17, 2000 at 01:28:29PM -0400, Chaim Frenkel wrote:
> I posted this to -qa and -internal, since I was suggesting this
> for the internal development of perl. Not for the user visible
> pieces.

My mistake.  For the internals, sounds like it couldn't hurt.  Though
I have no idea how put together a DBC system for... what language are
we writing this in again?

-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
Plus I remember being impressed with Ada because you could write an
infinite loop without a faked up condition.  The idea being that in Ada
the typical infinite loop would be normally be terminated by detonation.
-- Larry Wall in <[EMAIL PROTECTED]>



Re: RFC 155 - Remove geometric functions from core

2000-08-24 Thread Michael G Schwern

A friend pointed out, technically most are trigonometric functions,
not geometric.  atan2, cos, sin, acos, asin and tan are all trig.
exp, log, sqrt are... just math I guess.

So I suppose the proposed module would be Math::Trig or some such.  Or
maybe, as the source code suggests, Math::High:Falutin.


However, since those funtions take up about 200 lines in the core, are
very stable and relatively easy to document, what do we win by
removing them?


PS  The idea of adding acos, asin and tan is good.


-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
Our business in life is not to succeed but to continue to fail in high
spirits.
-- Robert Louis Stevenson



Re: RFC 155 - Remove geometric functions from core

2000-08-25 Thread Michael G Schwern

On Fri, Aug 25, 2000 at 09:12:32AM -0400, Stephen P. Potter wrote:
> Lightning flashed, thunder crashed and Michael G Schwern <[EMAIL PROTECTED]> wh
> ispered:
> | PS  The idea of adding acos, asin and tan is good.
> 
> You just answered your own question.  It is very difficult to add new
> functions to the core.  It is very easy to write new modules.  Doesn't it
> make sense that if you have to use Math::Trig to get to acos and friends,
> you might as well make the language definition clean and say all of acos
> friends should be in that module, not some in the core?

Actually I was suggesting that acos, asin and tan be added to the core.

Most likely, splitting this out into a module wouldn't make anything
much simpler.  To get anything like the performance math functions
need, Math::Trig could not be written in plain Perl.  It would have to
be written in C or XS (or whatever perl6 winds up being written in)
probably calling the system's math libraries and still dragging in all
the basic problems of a core patch and configuration.


> That's the basic goal behind my RFCs for moving things to modules.  In
> general, I hope to make the language cleaner, easier to learn and use, and
> easier to extend.  If at the same time the language became better
> performing because of a removal of some of the core, all the better.  As
> you say, 200 lines isn't much.  But combine that with the IPC, the
> environment, the system, etc it all adds up.

I think I basically agree with tchrist here.  This is nickel and dime
stuff.  Cutting out the math functions isn't going to do squat.  IPC
and the system... that might do something, but Dan pointed out that it
doesn't amount to much either.

I think we should back up and reconsider what the intent of this RFC
is.  

If the intent is to make perl more maintainable and easier to patch,
I've already commented on that.  You're just shuffling code around.
And only a small fraction at that.

If you wish to make perl smaller and faster, just tearing things out
isn't going to help.  Its hit-or-miss optimizing.  You could remove
half the core functions and find out you only gained 5%.

Like all other optimizing attempts, the first step is analysis.
People have to sit down and systematically go through and find out
what parts of perl (and Perl) are eating up space and speed.  The
results will be very surprising, I'm sure, but it will give us a
concrete idea of what we can do to really help out perl's performance.

There should probably be an RFC to this effect, and I'm just visiting
here in perl6-language so I dump it on somebody else.

exit('stage' << 1);


-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
When faced with desperate circumstances, we must adapt.
- Seven of Nine



Re: RFC 227 (v1) Extend the window to turn on taint mode

2000-09-15 Thread Michael G Schwern

On Fri, Sep 15, 2000 at 01:52:00AM -, Perl6 RFC Librarian wrote:
> =head1 TITLE
> 
> Extend the window to turn on taint mode

As long as we're talking about tainting (this is a good idea, BTW) how
does everyone feel about a few other tainting widgets...

- A way to know when taint mode is on. ($TAINT or something)

This can be useful for debugging and testing purposes.  It might also
be used as a flag to indicate paranoia.  If tainting is on, the
program may wish to do additional security checks which it might not
have done otherwise.

- A way to explicity taint a variable (taint(@this)).

Consider DBI.  It must explicitly taint the results coming from a
database and must to this inside XS.  It would be nice to be able to
easily do this in Perl without alot of messy hacks.  (I had to do this
for Ima::DBI before DBI started tainting its data.  Wasn't fun and
never really worked 100%.)

And no, there shouldn't be an untaint() function.  Orthoginality can
blow me, detainting without filtering should remain hard.

- A way to explicitly check if a variable is tainted (is_tainted(%this))

Useful for debugging and testing.  Also for choosing between a secure
yet slower, more complicated, less featureful method and an unsecure
yet faster, easier, more featureful method.  Also useful for throwing
insecure dependency exceptions of your own (used to have to do this
for Ima::DBI, too.)

is_tainted() would always return false if tainting is off.


Any other basic tainting utilities needed?  I think pretty much
anything else can be built from these.

-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
An 87 year old man had no sex at all before wearing my device.
 --Alex Chiu, Immortality Guy



Re: RFC 227 (v1) Extend the window to turn on taint mode

2000-09-15 Thread Michael G Schwern

On Fri, Sep 15, 2000 at 01:03:50PM -0400, Dan Sugalski wrote:
> Take a look at the Taint modules on CPAN. Mine does just these, and I think 
> Tom Phoenix's does a bunch more.

Tom's Taint.pm has never worked for me.  I just tried installing it
again and it failed a bunch of tests (in both 5.005 and 5.6.0, but
different tests) I never knew your Taint existed since they mask each
other in the CPAN shell.  Your tests fail with with an "Insecure
$ENV{PATH}" in IO::File.  (Yeah, I know.  patches welcome)

Anyhow, however these extra tainting functions are implemented is fine
(as long as they work).  The simplest thing would be to just merge and
patch up Taint.pm and distribute it with perl6.

PS  Your Taint.zip archive... something is very odd.  All the filenames came
out lowercase.


-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
Work like hell, tell everyone everything you know, close a deal with
a handshake, and have fun.
-- Harold "Doc" Edgerton



Re: RFC 227 (v1) Extend the window to turn on taint mode

2000-09-15 Thread Michael G Schwern

On Fri, Sep 15, 2000 at 02:00:04PM -0400, Adam Turoff wrote:
> I'm kinda surfing the edge here.  -T is definately an internals issue,
> but $TAINT?  taint()?  is_tainted()?
> 
> I'm not sure if they should be exposed into the language from the 
> internals, or if a superstudly taint.xs in stdlib is more appropriate.

perl6-internals is probably the wrong forum for this, it was just
convenient.  I think Dan's got the right idea, distribute a Taint
module with Perl.

Shall we drag this discussion on over to perl6-language?  (I've CC'd
it and added a Reply-To.  This is BCC'd to perl6-internals).

-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
When faced with desperate circumstances, we must adapt.
- Seven of Nine



Re: Accessing a variable's attributes (was Re: RFC 241 (v1) ...)

2000-09-18 Thread Michael G Schwern

On Mon, Sep 18, 2000 at 04:04:56PM +0100, Simon Cozens wrote:
> On Mon, Sep 18, 2000 at 10:51:52AM -0400, John Porter wrote:
> > I would think that if it could be done at all,
> > it would only be in extension (formerly XS) code.
> 
> Why? I don't want to go to C just to add a flag to a variable. That smacks of
> making easy things hard and hard things impossible. You'll note that that
> isn't the motto of Perl.

I'll have to go with John here.  Mucking about with variable attribute
flags (with the exceptions of the fixed set which have been proposed)
falls firmly into the "hard but possible" realm of things.  It should
be done in XS code.

Also, just being able to tack flags onto a variable means each
variable (that has a flag) would have to carry around a hash!

Anyhow, this doesn't mean someone couldn't write a module to do it and
then you use that.


-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
"You are wicked and wrong to have broken inside and peeked at the
 implementation and then relied upon it."
Tom Christiansen in <31832.969261130@chthon>



Re: Math functions? (Particularly transcendental ones)

2001-09-08 Thread Michael G Schwern

On Sat, Sep 08, 2001 at 12:00:24PM -0400, Dan Sugalski wrote:
> pow   : Raise x to the y power

You forgot biff, zap and womp!

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
stretch your colon out,
put some effort into it,
and shit through that paste.
-- japhy



Re: Math functions? (Particularly transcendental ones)

2001-09-08 Thread Michael G Schwern

On Sat, Sep 08, 2001 at 02:55:36PM -0400, Uri Guttman wrote:
> zap is an ibm 360/370/390 assembler op code and i bet they
> trademarked/patented/whatevered its name. :)
> 
> Zero and Add Packed.
> 
> gawd, i can't believe i remembered that. i don't recall exactly what it
> does but i think it was decimal math (packed decimal).

>From The Free On-line Dictionary of Computing (06 Jun 01) [foldoc]:

  Zero and Add Packed
  
  (ZAP) An {IBM 360}/370 {assembly language}
 instruction used when performing {packed arithmatic} to
 initialise an {accumulator}.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
Ooops, fatal mutation in the test script.



Re: Math functions? (Particularly transcendental ones)

2001-09-09 Thread Michael G Schwern

On Sun, Sep 09, 2001 at 02:33:17PM +1000, Jeremy Howard wrote:
> Uri Guttman wrote:
> > >>>>> "BS" == Benjamin Stuhl <[EMAIL PROTECTED]> writes:
> >
> >   >> Can anyone think of things I've forgotten? It's been a while since
> >   >> I've done numeric work.
> >
> >   BS> ln, asinh, acosh, atanh2?
> >
> > dan mentioned log (base anything) but i don't recall ln. and definitely
> > the arc hyberbolics are in after i pointed them out. dunno about atanh2.
> >
> We only really need ln(). Then [log(y) base x] is simply [ln(y)/ln(x)].
> There's no need to have separate functions for different bases.

If we try to get away with just implementing ln(), we'll probably
waste more time, space and effort answering FAQs about "How do I do
log base X in Perl?" than we ever would just implementing log(y,
base_x).

Do ln(y) and log(y, base_x) and you pretty much cover everything.

Besides, we have to have at least log(y) for backwards
compatibility--and I don't think "because it's mathematically
redundant" is a valid reason to bust compatibility for a tiny little
function like log().


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
The desired effect is what you get when you improve your interplanetary 
funksmanship.



Re: The core platforms list

2001-09-18 Thread Michael G Schwern

On Tue, Sep 18, 2001 at 02:43:07PM -0400, Dan Sugalski wrote:
> If a platform's not here it's not because we don't want to run on it, 
> rather it's because we can't guarantee the manpower to make it right. (If 
> we can, then new platforms can and will come on board)

I can handle Linux (PowerPC).  There shouldn't be much difference from
x86 except the byte ordering, I hope.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
Maybe they hooked you up with one of those ass-making magazines.
    -- brian d. foy as misheard by Michael G Schwern



Re: Example assembler code (primes.pasm)

2001-09-19 Thread Michael G Schwern

On Wed, Sep 19, 2001 at 02:49:58PM +0100, Leon Brocard wrote:
> Attached is a cute prime number printer.
> 
> It strikes me that we need a central place to put these things - it'd
> really help people get stuck into the lowlevel stuff.

It wouldn't hurt to throw it in as a test.  Probably the most
complicated test case we've got at the moment.



-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
If you see an animal with (-) 100 points and (+) 70 points, would you eat it? 
Hell no, and you should run for your life!
 --Alex Chiu, Immortality Guy



Re: Darwin - looking good

2001-09-20 Thread Michael G Schwern

On Thu, Sep 20, 2001 at 12:42:13AM +0100, Robin Houston wrote:
> I only had one real problem with Parrot on Darwin, which really has
> nothing to do with Darwin at all.  The first time I tried to "make test"
> I got a slew of errors about Test::More, so I diligently went to CPAN
> and downloaded the latest version.

The latest version of the Test-More tarball should have blown up in
your face with a big "Don't use this, download Test-Simple instead!" 
to prevent exactly this sort of thing from happening.  For some reason
that last version doesn't seem to have made it into
modules/by-module/Test/, it's just sitting in my author directory.

Sorry for the inconvenience, I'll go poke the CPAN folks.


> Are there any plans to remove the dependency of Parrot::Test on
> non-core modules? It's bound to be a stumbling block for quite
> a few people, surely? If not, I'll contribute a patch which
> makes the failure more graceful and informative.

These actually are core, but not until 5.7.2.  And we don't want to
take a Great Leap Backward to Test.pm.

For *exactly* such a contingency (I sound like an Acme saleman now) we
have Test-SDK (remember the SDKs?) which includes new-enough versions
of Test::More, Test::Simple, Test::Inline and Test::Harness in one
handy, easy to install tarball for those of you that don't use the
CPAN shell.

As a third alternative, you can simply distribute Test::Simple/More
(and even the new versions of Test::Harness) as part of parrot, same
as you do Parrot::Test.  That involves the least work for the test
runner.


I'd suggest creating a lib/ directory and moving Parrot/ into it now
before you get a proliferation of individual Perl module directories.
And change the Makefile to this:

PERL = perl
PERLRUN = $(PERL) -I"lib"

test:
$(PERLRUN) t/harness

and the other targets that use $(PERL) change to $(PERLRUN).


I could do this myself.  What's the best way to submit a bunch of
file/directory moves?


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
 Hey, Schwern!  THERE IS A HUGE GAZORGANSPLATTEDFARTMONGERING-
LIGHTENINGBEASTASAURSOPOD BEHIND YOU!  RUN, BEFORE IT GAFLUMMOXES YOUR
INNARDLYBITS!



Complete failure on Linux/PowerPC with 64bit ints.

2001-09-20 Thread Michael G Schwern

On Thu, Sep 20, 2001 at 09:00:20AM +0100, Simon Cozens wrote:
> So, if you're running on one of the core platforms, please check out
> a *clean* CVS copy, try and build and post the output of make test.

Hmmm, I hit an interesting snag.  I ran Configure.pl and then
habitually skipped 'make' and jumped straight to 'make test', which
dutifully ran.

Should we slap a dependency on 'all' into the test target?


Anyhow, here's the problems on Linux/PowerPC.  make warns with:

Ok, running Configure.pl with 5.6.1 without 64bit ints, everything's fine.
All tests successful or skipped.


But if we run Configure.pl with bleadperl that *does* use 64bit ints
and has debugging flags on, there's trouble.

make warns with:

cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -I./include -g -o register.o -c register.c
register.c: In function `Parrot_push_i':
register.c:22: warning: cast from pointer to integer of different size
register.c:22: warning: cast to pointer from integer of different size
register.c: In function `Parrot_pop_i':
register.c:47: warning: cast from pointer to integer of different size
register.c:47: warning: cast to pointer from integer of different size
register.c: In function `Parrot_push_s':
register.c:88: warning: cast from pointer to integer of different size
register.c:88: warning: cast to pointer from integer of different size
register.c: In function `Parrot_pop_s':
register.c:116: warning: cast from pointer to integer of different size
register.c:116: warning: cast to pointer from integer of different size
register.c: In function `Parrot_push_n':
register.c:157: warning: cast from pointer to integer of different size
register.c:157: warning: cast to pointer from integer of different size
register.c: In function `Parrot_pop_n':
register.c:182: warning: cast from pointer to integer of different size
register.c:182: warning: cast to pointer from integer of different size
register.c: In function `Parrot_push_p':
register.c:223: warning: cast from pointer to integer of different size
register.c:223: warning: cast to pointer from integer of different size
register.c: In function `Parrot_pop_p':
register.c:250: warning: cast from pointer to integer of different size
register.c:250: warning: cast to pointer from integer of different size
perl5.6.1 process_opfunc.pl basic_opcodes.ops
cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -I./include -g -o basic_opcodes.o -c basic_opcodes.c
cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -I./include -g -o memory.o -c memory.c
memory.c: In function `mem_allocate_aligned':
memory.c:61: warning: cast from pointer to integer of different size
memory.c:61: warning: cast from pointer to integer of different size
memory.c:62: warning: cast from pointer to integer of different size
memory.c:62: warning: cast to pointer from integer of different size


cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -I./include -g -o strnative.o -c strnative.c
strnative.c: In function `string_native_concat':
strnative.c:47: warning: cast from pointer to integer of different size
strnative.c:47: warning: cast to pointer from integer of different size
strnative.c: In function `string_native_substr':
strnative.c:76: warning: cast from pointer to integer of different size
strnative.c:76: warning: cast to pointer from integer of different size


And all of the tests fail with "This isn't Parrot bytecode!"


My Parrot/Config.pm file is attached.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
You see, in this world there's two kinds of people.  Those with loaded
guns, and those who dig.  Dig.
-- Blonde, "The Good, The Bad And The Ugly"

 Config.pm


Re: Complete failure on Linux/PowerPC with 64bit ints.

2001-09-20 Thread Michael G Schwern

On Thu, Sep 20, 2001 at 09:03:45AM -0400, Andy Dougherty wrote:
> On Thu, 20 Sep 2001, Michael G Schwern wrote:
> > But if we run Configure.pl with bleadperl that *does* use 64bit ints
> > and has debugging flags on, there's trouble.
> 
> > And all of the tests fail with "This isn't Parrot bytecode!"
> 
> That's because assemble.pl hasn't been patched yet to use the right
> pack_type.  You can either apply my patch from yesterday or you can
> hand-patch the pack_type for 'i' to be 'q'.

This one?
http:[EMAIL PROTECTED]/msg04540.html


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
Death follows me like a wee followey thing.
-- Quakeman



Re: Complete failure on Linux/PowerPC with 64bit ints.

2001-09-20 Thread Michael G Schwern

On Thu, Sep 20, 2001 at 02:49:01PM +0100, Simon Cozens wrote:
> It's applied; just resync.

Same make warnings as before.  But the tests are now all:

$ perl5.6.1 -Ilib t/op/basic.t 
1..2
Invalid type in pack: 'q' at assemble.pl line 77.
not ok 1 - branch_ic
# Failed test (Parrot/Test.pm at line 73)
#  got: 'can't stat t/op/basic1.pbc, code 2
'
# expected: '42'
ok 2 # skip label constants unimplemented in assembler
# Looks like you failed 1 tests of 2.

and so on like that.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
You're the sickest teenager I've ever set my wallet on.



Re: instructions per second benchmark (in parrot ;)

2001-09-20 Thread Michael G Schwern

On Thu, Sep 20, 2001 at 04:54:21PM -0500, Brian Wheeler wrote:
> Since all benchmarks are crap anyway, I've written a test which tells
> the average number of instructions per second.  On my athlon 700 I get
> 3966053 instructions per second and on my PIII 866 I get 5081485
> instructions per second.  Do those sound like reasonable numbers?  Of
> course, since time_i is one of the opcodes looped, it probably brings
> the numbers down.

1.59 MIPS here.  1.77 if I shut off the mp3 player. :)

G3/266.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
 ScHWeRnsChweRNsChWErN   SchweRN  SCHWErNSChwERnsCHwERN
  sChWErn  ScHWeRn  schweRn   sCHWErN   schWeRnscHWeRN 
   SchWeRN  scHWErn SchwErn   scHWErn   ScHweRN   sChwern  
scHWerNscHWeRn   scHWerNScHwerN   SChWeRN scHWeRn  
SchwERNschwERnSCHwern  sCHWErN   SCHWErN   sChWeRn 



Re: instructions per second benchmark (in parrot ;)

2001-09-20 Thread Michael G Schwern

On Thu, Sep 20, 2001 at 11:52:50PM +0100, Tom Hughes wrote:
> I have test.pasm reporting 7.14M ops/sec on a 200MHz K6 running
> linux with the interpreter compiled -O3. That's about twice the
> speed that I get without any optimisation.

Oh, right.  Optimization.

I'm getting 2.67 MIPS with -O3.

Hmmm, why would a K6/200 come out so much faster than a G3/266?  If
anything it should be the other way around.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
Jesus hates me.
http://www.unamerican.com/



Re: t/op/number.t output confuses Test::Harnss

2001-09-21 Thread Michael G Schwern

On Fri, Sep 21, 2001 at 11:05:29AM +0200, Mattia Barbon wrote:
> not ok 15 - gt_nc_ic
> # Failed test (Parrot/Test.pm at line 74)
> #  got: undef
> # expected: 'ok 1
> ok 2
> ok 3
> '
> 
> So Test::Harenss keeps whining about test 2 answrd ( yes, the PC
> with the brokn keyboard again ) after test 9, and such.

Yes, that problem was exposed by Test::More 0.19 when it started
sending diagnostics to STDOUT instead of STDERR.  0.20 will fix.

I sent in a patch for this (the one that added Test::More into the
distribution) but it seems to have not been applied.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
And God was pleased.
And Dog was happy and wagged his tail.
And Adam was greatly improved.
And Cat did not care one way or the other.
-- http://www.catsarefrommars.com/creationist.htm



Re: What should and shouldn't get documented?

2001-09-23 Thread Michael G Schwern

On Sun, Sep 23, 2001 at 10:05:57PM -0400, Dan Sugalski wrote:
> I see there's a lot of embedded documentation going into the core, and 
> that's a good thing. That brings up a question, though--what exactly should 
> we document, and where should it be seen?
> 
> For an example, the opcode functions should *never* be used outside the 
> interpreter core itself, but documenting them's still a good thing.
> 
> Maybe we need a way to tag the type of documentation for each function--the 
> module it belongs to and how exposed it should be, or something.

Assuming we're using POD, the simplest thing to do is thus:

=begin _private

Private docs you don't want displayed by perldoc, but want someone reading
the source to see.

=end _private

POD has the advantage over plain comments of imposing an implied
structure on the docs.  It also means a future "--private" flag can be
added to perldoc to display them.

Works pretty well so far for CPAN modules.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
List context isn't dangerous.  Misquoting Gibson is dangerous.
-- Ziggy



Report on Linux/PowerPC w/64 bits

2001-10-01 Thread Michael G Schwern
1/10 tests, 90.00% okay (-1 skipped test: 8 okay, 80.00%)
t/op/time...ok
t/op/trans..ok
Failed TestStatus Wstat Total Fail  Failed  List of Failed
----------------
t/op/basic.t   2   512 52  40.00%  2, 4
t/op/bitwise.t 4  1024 44 100.00%  1-4
t/op/integer.t12  307226   12  46.15%  1-7, 21-24, 26
t/op/number.t  1   256251   4.00%  24
t/op/stacks.t  1   256 91  11.11%  1
t/op/string.t  1   256101  10.00%  2
5 subtests skipped.
Failed 6/8 test scripts, 25.00% okay. 21/99 subtests failed, 78.79% okay.
make: *** [test] Error 29



-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One



Linux/PowerPC w/o 64bits a-ok

2001-10-01 Thread Michael G Schwern

Debian Linux/PowerPC without 64 bit integers tests out 100% ok.

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
"Let's face it," said bearded Rusty Simmons, opening a can after the
race.  "This is a good excuse to drink some beer."  At 10:30 in the
morning?  "Well, it's past noon in Dublin," said teammate Mike
[Joseph] Schwern.  "It's our duty."
-- "Sure, and It's a Great Day for Irish Runners" 
   Newsday, Sunday, March 20, 1988



Re: SV: OpenVMS

2001-10-03 Thread Michael G Schwern

On Wed, Oct 03, 2001 at 07:09:06PM +0100, Simon Cozens wrote:
> On Wed, Oct 03, 2001 at 01:55:39PM -0400, Dan Sugalski wrote:
> > If you want to wait, that's fine. I don't think I'm going to get untangled 
> > for another day or three, though.
> 
> Waiting might also help to shake out whatever's wrong with Win2K. Maybe
> it's just Brent's system being funny. (And I'd try playing with Compaq
> Test Drive's OpenVMS system, but I can't find gzip, vmstar or, unfortunately,
> perl. And damn, it's been a long time since I used DCL.)

Unpleasent things happen with 5.005_03

$ perl Configure.pl
Subroutine ln redefined at /perl_root/lib/ExtUtils/Manifest.pm line 27.
Parrot Configure
Copyright (C) 2001 Yet Another Society

Since you're running this script, you obviously have
Perl 5--I'll be pulling some defaults from its configuration.

First, I'm gonna check the manifest, to make sure you got a 
complete Parrot kit.

Okay, we found everything.  Next you'll need to answer 
a few questions about your system.  Rules are the same 
as Perl 5's Configure--defaults are in square brackets, 
and you can hit enter to accept them.

What C compiler do you want to use? [CC/DECC] 
How about your linker? [Link] 
What flags would you like passed to your C compiler? 
[/float=ieee/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList -I./include] 
Which libraries would you like your C compiler to include? [] 
How big would you like integers to be? [long] 
And your floats? [double] 
What is your native opcode type? [long] 
Okay.  Now I'm gonna probe Perl 5's configuration to see
what headers you have around.  This could take a bit on slow 
machines...
Out of memory!
Out of memory!
%SYSTEM-F-ABORT, abort


bleadperl 12109 is slightly less unpleasent.

Okay.  Now I'm gonna probe Perl 5's configuration to see
what headers you have around.  This could take a bit on slow 
machines...

Alright, now I'm gonna check some stuff by compiling and running
a small C program.  This could take a bit...
Use of uninitialized value in concatenation (.) or string at configure.pl line 137.
%DCL-W-VALREQ, missing qualifier or keyword value - supply all required values 
\INCLUDE\
C compiler died! at configure.pl line 137.
%RMS-E-FNF, file not found



-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
36 haikus
would scare the shit out of me.
Thank goodness for paste!
-- Schwern



Re: Perl6 Tinderbox

2001-10-05 Thread Michael G Schwern

On Fri, Oct 05, 2001 at 05:18:07PM -0700, Zach Lipton wrote:
> Because the need for a tinderbox testing platform is fairly urgent right now
> for perl6, I am releasing my (place your favorite adjective in the blank
> here) tinderbox client for perl6 ahead of the near-rewrite that I am working
> on to use Devel::Tinderbox::Reporter (which was just written) and
> Test::Smoke (which wouldn't help perl6 all that much anyway.

There's an existing Parrot::Smoke module, I forget where it is off hand.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
That which stirs me, stirs everything.
-- Squonk Opera, "Spoon"



Re: use parrot;

2001-10-20 Thread Michael G Schwern

On Sat, Oct 20, 2001 at 08:11:27PM +0200, raptor wrote:
> will it be possible to do this inside Perl program :
> 
> use parrot;
> ...parrot code...
> no parrot;

Bad idea of the day --> Inline::Parrot!


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
HA HA HA  You're all so ridiculous!  But thanks for the money!



Re: Languages in the core source tree?

2001-10-22 Thread Michael G Schwern

On Sun, Oct 21, 2001 at 12:45:14PM -0400, Dan Sugalski wrote:
> Okay, we've now got minimal:
> 
>   *) Parrot assembly
>   *) Perl
>   *) Python
>   *) JVM
>   *) Scheme
>   *) Jako
>   *) Ruby? (Do we? I can't remember for sure)
> 
> support for Parrot. This is a cool thing, but it brings up the questions:
> 
> 1) Do we put them all in the parrot CVS tree

Yes, most definitely yes.

> 2) Do we require them to meet the same levels of quality as the core 
> interpreter?

Sort of.


Those little languages represent the closest thing to a practical
application we have for Parrot at the moment.  More importantly, you
don't have to be an assembly programmer to use them.

As each new feature of Parrot is added, the little languages quickly
make use of them.  If they're widely distributed (ie. with Parrot)
people can quickly make use of the little languages, seeing just how
much they can get away with in such a small space.  So Parrot and the
interpreters will grow in parallel.

This means more people beating on Parrot sooner and with more and
more varied sticks.

However, the author(s) of each individual interpreter should be
responsible for their own language.  Basically, a mini-pumpinking.
This means they *do* have to stand up to the same standards as Parrot
because, essentially, they're acting as very practical test cases.  If
the mini-Scheme interpreter works on Linux but not on VMS, then it's
likely exposed a bug inside Parrot.  Whether or not a release should
be held up because a given language is broken is up to Simon.


So yes, put them in the default Parrot tree.  Later on when they've
matured they can branch off into seperate projects and go their own
way.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
Nature is pissed.
http://www.unamerican.com/



Re: Request for new feature: attach a perl debugger to a running process

2001-10-29 Thread Michael G Schwern

On Mon, Oct 29, 2001 at 05:27:30PM +, David Trusty wrote:
> I would like to request a new feature for perl:  The ability to
> attach a perl debugger to a running process.

The DB module gives you the tools to do this sort of thing, though
there is some assembly required for certain very large values of
"some".


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
There is a disurbing lack of PASTE ENEMA on the internet.



Re: Solaris problems with trans.t

2001-09-28 Thread Michael G Schwern

On Sat, Sep 29, 2001 at 05:22:41AM +0200, Buggs wrote:
> if(sin(1) == sin(1.0))

The ubc cc has sin(1) as being 0.000.  You have to cast it to a
double.  SunPRO handles it fine.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One



Re: PMCs and how the opcode functions will work

2001-10-09 Thread Michael G Schwern

On Mon, Oct 08, 2001 at 06:36:32PM -0400, Dan Sugalski wrote:
> Questions, anyone? ;-)

Will there be a test on this?

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
It sure is fun masturbating.
http://www.unamerican.com/



Re: Parrot FAQ

2001-12-04 Thread Michael G Schwern

On Tue, Dec 04, 2001 at 04:27:22PM -0500, Adam Turoff wrote:
> Besides, Schwern is having no end of problems with the Perl QA
> wiki.  I'd much rather put the docs in CVS later this week.

Actually, I make a lot more noise than I'm actually having trouble.
With the exception of that one big glitch (caused by my webmaster
flipping on Apache SuEXEC without telling me) UseModWiki has just
chugged along without maintenance.  Once I found a Wiki implementation
that wasn't total crap, things were fine.  It even has pseudo-RCS
history.

Just don't look at the code.

For the truly lazy there's always http://www.swiki.net.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
If you got the wax out of your ears you could hear the twister picking up
the trailer park of your future!



Re: Parrot FAQ

2001-12-06 Thread Michael G Schwern

On Thu, Dec 06, 2001 at 12:54:54PM -0500, Dan Sugalski wrote:
> Not that I'm contemplating actually having parrot run z-code natively, 
> but... is there anything in the Z machine that we might want to 
> steal^Wreproduce?

I for one would like a PCKUP_FONEBOOTH_N_DIE op.

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
and that, children, is how to clean and load a .38 revolver.  Questions?



Re: Nmake is stupid.

2001-12-12 Thread Michael G Schwern

On Wed, Dec 12, 2001 at 01:58:49PM -0500, Dan Sugalski wrote:
> At 08:54 PM 12/12/2001 +0200, Jaen Saul wrote:
> >Well, another small post again :)
> >As you see, -C doesn't do anything useful on NMAKE. So Win32 is still
> >broken. The -C way doesn't work.
> 
> VMS is broken this way too, as is anything without GNU make. We'll get your 
> patches integrated in soon, and a longer-term solution (i.e. a perl make) 
> should be ready not too long after that.

Anyone insane enough to try this?
http://www.cpan.org/modules/by-module/Make/Make-1.00.tar.gz

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Stupid am I?  Stupid like a fox!



Re: JIT me some speed!

2001-12-20 Thread Michael G Schwern

Dan Sugalski <[EMAIL PROTECTED]> wrote:
> To run a program with the JIT, pass test_parrot the -j flag and watch it
> scream. Well, scream if you're on x86 Linux or BSD (I get a speedup on
> mops.pbc of 35x) but it's a darned good place to start.

$ ./test_parrot -j examples/assembly/mops.pbc 
Illegal instruction

That's not supposed to happen is it?  Its Linux/PowerPC, so maybe it
is supposed to happen.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
 ScHWeRnsChweRNsChWErN   SchweRN  SCHWErNSChwERnsCHwERN
  sChWErn  ScHWeRn  schweRn   sCHWErN   schWeRnscHWeRN 
   SchWeRN  scHWErn SchwErn   scHWErn   ScHweRN   sChwern  
scHWerNscHWeRn   scHWerNScHwerN   SChWeRN scHWeRn  
SchwERNschwERnSCHwern  sCHWErN   SCHWErN   sChWeRn 



Re: [PATCH] It's a trick, sir...

2002-01-04 Thread Michael G Schwern

On Mon, Dec 31, 2001 at 10:57:54PM -0500, Bryan C. Warnock wrote:
> ...there's *two* of them!

My very first ever attempt at obfuscated code circa 1997.

#!/usr/lib/perl -w

use strict;

eval unpack('u*', <<'JOKE');
M;7D@0'-I>F5S(#T@<72UO;F4@2US:7@*"2`@9FEV92UH=6YD2`Dhttp://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
and I pull out the Magnum from under the desk where I keep it in case
someone laughs at a joke that's so dry it's got a built in
water-fountain, and blow the lot of them away as a community Service.
-- BOFH



Re: [PATCH] Skip tests, don't comment them out

2002-01-10 Thread Michael G Schwern

On Thu, Jan 10, 2002 at 03:56:57PM +, Simon Glover wrote:
> 
>  As the subject line says.

Technically that should be a TODO.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
come sing my fun song
my bologna has a first name
p a s t e
-- Fmh



Big Bucket o' Warnings

2002-01-12 Thread Michael G Schwern

Attached is a build of a just rsync'd parrot on Linux/PowerPC machine.
Stock configure using Debian's perl (so nothing fancy like 64bit
integers).

There's a lot of warnings.

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Obscenity is the last resort of the illiterate, Mother Fucker
-- KAL



parrot.out.gz
Description: Binary data


[PATCH] Parrot::Test meets Test::Builder

2002-01-12 Thread Michael G Schwern
   : "'$val'";
+}
+
+$out .= "$vars[0] = $vals[0]\n";
+$out .= "$vars[1] = $vals[1]\n";
+
+$out =~ s/^//msg;
+return $out;
+}
+
+
 =item B
 
   eq_array(\@this, \@that);
@@ -748,13 +986,18 @@
 #'#
 sub eq_array  {
 my($a1, $a2) = @_;
-return 0 unless @$a1 == @$a2;
 return 1 if $a1 eq $a2;
 
 my $ok = 1;
-for (0..$#{$a1}) {
-my($e1,$e2) = ($a1->[$_], $a2->[$_]);
+my $max = $#$a1 > $#$a2 ? $#$a1 : $#$a2;
+for (0..$max) {
+my $e1 = $_ > $#$a1 ? $DNE : $a1->[$_];
+my $e2 = $_ > $#$a2 ? $DNE : $a2->[$_];
+
+push @Data_Stack, { type => 'ARRAY', idx => $_, vals => [$e1, $e2] };
 $ok = _deep_check($e1,$e2);
+pop @Data_Stack if $ok;
+
 last unless $ok;
 }
 return $ok;
@@ -766,7 +1009,7 @@
 
 my $eq;
 {
-# Quiet unintialized value warnings when comparing undefs.
+# Quiet uninitialized value warnings when comparing undefs.
 local $^W = 0; 
 
 if( $e1 eq $e2 ) {
@@ -783,7 +1026,21 @@
 {
 $ok = eq_hash($e1, $e2);
 }
+elsif( UNIVERSAL::isa($e1, 'REF') and
+   UNIVERSAL::isa($e2, 'REF') )
+{
+push @Data_Stack, { type => 'REF', vals => [$e1, $e2] };
+$ok = _deep_check($$e1, $$e2);
+pop @Data_Stack if $ok;
+}
+elsif( UNIVERSAL::isa($e1, 'SCALAR') and
+   UNIVERSAL::isa($e2, 'SCALAR') )
+{
+push @Data_Stack, { type => 'REF', vals => [$e1, $e2] };
+$ok = _deep_check($$e1, $$e2);
+}
 else {
+push @Data_Stack, { vals => [$e1, $e2] };
 $ok = 0;
 }
 }
@@ -804,13 +1061,18 @@
 
 sub eq_hash {
 my($a1, $a2) = @_;
-return 0 unless keys %$a1 == keys %$a2;
 return 1 if $a1 eq $a2;
 
 my $ok = 1;
-foreach my $k (keys %$a1) {
-my($e1, $e2) = ($a1->{$k}, $a2->{$k});
+my $bigger = keys %$a1 > keys %$a2 ? $a1 : $a2;
+foreach my $k (keys %$bigger) {
+my $e1 = exists $a1->{$k} ? $a1->{$k} : $DNE;
+my $e2 = exists $a2->{$k} ? $a2->{$k} : $DNE;
+
+push @Data_Stack, { type => 'HASH', idx => $k, vals => [$e1, $e2] };
 $ok = _deep_check($e1, $e2);
+pop @Data_Stack if $ok;
+
 last unless $ok;
 }
 
@@ -840,60 +1102,71 @@
 return eq_array( [sort _bogus_sort @$a1], [sort _bogus_sort @$a2] );
 }
 
-
 =back
 
-=head1 NOTES
 
-Test::More is B tested all the way back to perl 5.004.
+=head2 Extending and Embedding Test::More
 
-=head1 BUGS and CAVEATS
+Sometimes the Test::More interface isn't quite enough.  Fortunately,
+Test::More is built on top of Test::Builder which provides a single,
+unified backend for any test library to use.  This means two test
+libraries which both use Test::Builder B.
+
+If you simply want to do a little tweaking of how the tests behave,
+you can access the underlying Test::Builder object like so:
 
 =over 4
 
-=item Making your own ok()
+=item B
 
-This will not do what you mean:
+my $test_builder = Test::More->builder;
 
-sub my_ok {
-ok( @_ );
-}
+Returns the Test::Builder object underlying Test::More for you to play
+with.
 
-my_ok( 2 + 2 == 5, 'Basic addition' );
+=cut
 
-since ok() takes it's arguments as scalars, it will see the length of
-@_ (2) and always pass the test.  You want to do this instead:
+sub builder {
+return Test::Builder->new;
+}
 
-sub my_ok {
-ok( $_[0], $_[1] );
-}
+=back
+
+
+=head1 NOTES
+
+Test::More is B tested all the way back to perl 5.004.
+
+=head1 BUGS and CAVEATS
+
+=over 4
+
+=item Making your own ok()
 
-The other functions act similiarly.
+If you are trying to extend Test::More, don't.  Use Test::Builder
+instead.
 
-=item The eq_* family have some caveats.
+=item The eq_* family has some caveats.
 
 =item Test::Harness upgrades
 
 no_plan and todo depend on new Test::Harness features and fixes.  If
-you're going to distribute tests that use no_plan your end-users will
-have to upgrade Test::Harness to the latest one on CPAN.
+you're going to distribute tests that use no_plan or todo your
+end-users will have to upgrade Test::Harness to the latest one on
+CPAN.  If you avoid no_plan and TODO tests, the stock Test::Harness
+will work fine.
 
 If you simply depend on Test::More, it's own dependencies will cause a
 Test::Harness upgrade.
 
 =back
 
-=head1 AUTHOR
-
-Michael G Schwern E[EMAIL PROTECTED] with much inspiration from
-Joshua Pritikin's Test module and lots of discussion with Barrie
-Slaymaker and the perl-qa gang.
-
 
 =head1 HISTORY
 
 This is a case

When Licenses Attack

2002-01-13 Thread Michael G Schwern

Attached is the legal document that comes with Ruby.  In it you'll
find out what happens if you don't enforce a uniform license of your
project.  It contains one or more of the following...

LGPL
"Free Software" License
GPL
Artistic License
Public domain
Regents of USC
Sun
old-style BSD
Aladdin Enterprises
new-style BSD
beer-ware
"semi-public-domain"

Beware any software license that comes compressed.


I just post this as a cautionary tale.  The next time you think
Parrot's licensing policy is getting in your way, it could be worse.

It could be beer-ware.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
IMHO bugs in Perl 5 shouldn't carry over to Perl 6. (Unless, of course,
we *like* the bugs... ;)
-- Ken Fox in <[EMAIL PROTECTED]>


LEGAL NOTICE INFORMATION


All the files in this distribution are covered under either the Ruby's
license (see the file COPYING) or public-domain except some files
mentioned below.

regex.[ch]:

  These files are under LGPL.  Treat them as LGPL says. (See the file
  LGPL for details)

Extended regular expression matching and search library.
Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.

The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file LGPL.  If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */

Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto)
Last change: May 21, 1993 by t^2
removed gapped buffer support, multiple syntax support by matz <[EMAIL PROTECTED]>
Perl5 extension added by matz <[EMAIL PROTECTED]>
UTF-8 extension added Jan 16 1999 by Yoshida Masato  <[EMAIL PROTECTED]>

configure:

  This file is free software.

Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.

This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.

config.guess:
config.sub:
parse.c:

  As long as you distribute these files with the file configure, they
  are covered under the Ruby's license.

  Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
  Free Software Foundation, Inc.

This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

As a special exception to the GNU General Public License, if you
distribute this file as part of a program that contains a
configuration script generated by Autoconf, you may include it under
the same distribution terms that you use for the rest of that program.

util.c (partly):
win32/win32.[ch]:

  You can apply the Artistic License to these files. (or GPL,
  alternatively)

Copyright (c) 1993, Intergraph Corporation

You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the perl README file.

lib/getoptlong.rb:

  This file is under GPL.  Treat them as GPL says. (See the file GPL
  for details)

Copyright (C) 1998, 1999, 2000  Motoyuki Kasahara

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

st.[ch]:
x68/*

*poke* *poke* Parrot::Test -> Test::Builder patch

2002-01-27 Thread Michael G Schwern

This patch seems to have slipped by in the post New Year's haze.  It
updates Parrot's version of Test::More to 0.41 and makes Parrot::Test
use Test::Builder instead of doing Evil things to Test::More.

Less Evil is Good.

http:[EMAIL PROTECTED]/msg07760.html


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Stupid am I?  Stupid like a fox!



Re: *poke* *poke* Parrot::Test -> Test::Builder patch

2002-01-28 Thread Michael G Schwern

On Mon, Jan 28, 2002 at 04:07:06PM -0500, Dan Sugalski wrote:
> At 1:55 AM -0500 1/28/02, Michael G Schwern wrote:
> >This patch seems to have slipped by in the post New Year's haze.  It
> >updates Parrot's version of Test::More to 0.41 and makes Parrot::Test
> >use Test::Builder instead of doing Evil things to Test::More.
> 
> Where's Test/Builder.pm, though?

Hells bells.  Here it is.

--- /dev/null   Mon Jan 28 02:17:54 2002
+++ Test/Builder.pm Sat Jan 12 17:05:41 2002
@@ -0,0 +1,1189 @@
+package Test::Builder;
+
+use 5.004;
+
+# $^C was only introduced in 5.005-ish.  We do this to prevent
+# use of uninitialized value warnings in older perls.
+$^C ||= 0;
+
+use strict;
+use vars qw($VERSION $CLASS);
+$VERSION = '0.11';
+$CLASS = __PACKAGE__;
+
+my $IsVMS = $^O eq 'VMS';
+
+use vars qw($Level);
+my @Test_Results = ();
+my @Test_Details = ();
+my($Test_Died) = 0;
+my($Have_Plan) = 0;
+my $Curr_Test = 0;
+
+
+=head1 NAME
+
+Test::Builder - Backend for building test libraries
+
+=head1 SYNOPSIS
+
+  package My::Test::Module;
+  use Test::Builder;
+  require Exporter;
+  @ISA = qw(Exporter);
+  @EXPORT = qw(ok);
+
+  my $Test = Test::Builder->new;
+  $Test->output('my_logfile');
+
+  sub import {
+  my($self) = shift;
+  my $pack = caller;
+
+  $Test->exported_to($pack);
+  $Test->plan(@_);
+
+  $self->export_to_level(1, $self, 'ok');
+  }
+
+  sub ok {
+  my($test, $name) = @_;
+
+  $Test->ok($test, $name);
+  }
+
+
+=head1 DESCRIPTION
+
+I  Meaning the underlying code is well
+tested, yet the interface is subject to change.
+
+Test::Simple and Test::More have proven to be popular testing modules,
+but they're not always flexible enough.  Test::Builder provides the a
+building block upon which to write your own test libraries I.
+
+=head2 Construction
+
+=over 4
+
+=item B
+
+  my $Test = Test::Builder->new;
+
+Returns a Test::Builder object representing the current state of the
+test.
+
+Since you only run one test per program, there is B
+Test::Builder object.  No matter how many times you call new(), you're
+getting the same object.  (This is called a singleton).
+
+=cut
+
+my $Test;
+sub new {
+my($class) = shift;
+$Test ||= bless ['Move along, nothing to see here'], $class;
+return $Test;
+}
+
+=back
+
+=head2 Setting up tests
+
+These methods are for setting up tests and declaring how many there
+are.  You usually only want to call one of these methods.
+
+=over 4
+
+=item B
+
+  my $pack = $Test->exported_to;
+  $Test->exported_to($pack);
+
+Tells Test::Builder what package you exported your functions to.
+This is important for getting TODO tests right.
+
+=cut
+
+my $Exported_To;
+sub exported_to {
+my($self, $pack) = @_;
+
+if( defined $pack ) {
+$Exported_To = $pack;
+}
+return $Exported_To;
+}
+
+=item B
+
+  $Test->plan('no_plan');
+  $Test->plan( skip_all => $reason );
+  $Test->plan( tests => $num_tests );
+
+A convenient way to set up your tests.  Call this and Test::Builder
+will print the appropriate headers and take the appropriate actions.
+
+If you call plan(), don't call any of the other methods below.
+
+=cut
+
+sub plan {
+my($self, $cmd, $arg) = @_;
+
+return unless $cmd;
+
+if( $cmd eq 'no_plan' ) {
+$self->no_plan;
+}
+elsif( $cmd eq 'skip_all' ) {
+return $self->skip_all($arg);
+}
+elsif( $cmd eq 'tests' ) {
+if( $arg ) {
+return $self->expected_tests($arg);
+}
+elsif( !defined $arg ) {
+die "Got an undefined number of tests.  Looks like you tried to ".
+"say how many tests you plan to run but made a mistake.\n";
+}
+elsif( !$arg ) {
+die "You said to run 0 tests!  You've got to run something.\n";
+}
+}
+}
+
+=item B
+
+my $max = $Test->expected_tests;
+$Test->expected_tests($max);
+
+Gets/sets the # of tests we expect this test to run and prints out
+the appropriate headers.
+
+=cut
+
+my $Expected_Tests = 0;
+sub expected_tests {
+my($self, $max) = @_;
+
+if( defined $max ) {
+$Expected_Tests = $max;
+$Have_Plan  = 1;
+
+$self->_print("1..$max\n") unless $self->no_header;
+}
+return $Expected_Tests;
+}
+
+
+=item B
+
+  $Test->no_plan;
+
+Declares that this test will run an indeterminate # of tests.
+
+=cut
+
+my($No_Plan) = 0;
+sub no_plan {
+$No_Plan= 1;
+$Have_Plan  = 1;
+}
+
+=item B
+
+  $Test->skip_all;
+  $Test->skip_all($reason);
+
+Skips all the tests, using the given $reason.  Exits immediately with 0.
+
+=cut
+
+my $Skip_All = 0;
+sub skip_all {
+my($self, $reason) = @_;
+
+my $out = "1..0";
+$out .= &q

Re: *poke* *poke* Parrot::Test -> Test::Builder patch

2002-01-28 Thread Michael G Schwern

On Mon, Jan 28, 2002 at 09:36:19PM -0500, Dan Sugalski wrote:
> At 7:47 PM -0500 1/28/02, Michael G Schwern wrote:
> >On Mon, Jan 28, 2002 at 04:07:06PM -0500, Dan Sugalski wrote:
> >> At 1:55 AM -0500 1/28/02, Michael G Schwern wrote:
> >> >This patch seems to have slipped by in the post New Year's haze.  It
> >> >updates Parrot's version of Test::More to 0.41 and makes Parrot::Test
> >> >use Test::Builder instead of doing Evil things to Test::More.
> >>
> >> Where's Test/Builder.pm, though?
> >
> >Hells bells.  Here it is.
> 
> And the patch is in. Thanks.

Thanks.  Simon mentioned something about Parrot::Test not reporting
segfaults and weird exit codes well?


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Right Wing Enema:
Flush Immorality Now!
God gums gay gorgings.
-- boojum



Re: *poke* *poke* Parrot::Test -> Test::Builder patch

2002-01-28 Thread Michael G Schwern

On Mon, Jan 28, 2002 at 09:33:06PM -0800, Steve Fink wrote:
> On Mon, Jan 28, 2002 at 09:36:19PM -0500, Dan Sugalski wrote:
> > At 7:47 PM -0500 1/28/02, Michael G Schwern wrote:
> > >On Mon, Jan 28, 2002 at 04:07:06PM -0500, Dan Sugalski wrote:
> > >> At 1:55 AM -0500 1/28/02, Michael G Schwern wrote:
> > >> >This patch seems to have slipped by in the post New Year's haze.  It
> > >> >updates Parrot's version of Test::More to 0.41 and makes Parrot::Test
> > >> >use Test::Builder instead of doing Evil things to Test::More.
> > >>
> > >> Where's Test/Builder.pm, though?
> > >
> > >Hells bells.  Here it is.
> > 
> > And the patch is in. Thanks.
> 
> *kaboom*
> 
> >From the commit log:
> 
> Parrot::Test no longer exports Test::More's functions.  Instead they
> can simply be used together.  The few tests which used Test::More
> features (ie. skip) have 'use Test::More' added.

Is there something wrong with rsync cvs.perl.org::parrot-HEAD?  It
doesn't seem to keep up to date.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
It's Airplane Glue sniffing time!



Re: *poke* *poke* Parrot::Test -> Test::Builder patch

2002-01-28 Thread Michael G Schwern

On Tue, Jan 29, 2002 at 12:39:36AM -0500, Dan Sugalski wrote:
> Dammit, I had that working before I committed things. I'll fix.

Looks like things drifted a bit since I wrote the patch.  Want me to
do it over?

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
I need a SHOWER a BURGER and some ROBOTS, STAT!
-- http://www.angryflower.com/allrigh.gif



[PATCH t/op/rx.t] Can't use TODO, use SKIP instead

2002-01-29 Thread Michael G Schwern

While this is the right place for a TODO test, unfortunately the
Test::Harness that currently comes with Perl doesn't understand this
kind of TODO test.  Parrot users would have to either download the new
version from CPAN or wait for 5.8.

So instead of TODO, use SKIP.  TODO would be better, since you'd know
if the test started passing, but we'll live.

Alternatively, if you really, really, really want TODO tests you could
drop Test::Harness 2.01 into Test/ and make t/harness use that version
explicitly.  If you want to justify it, 2.01 works better on VMS than
the one which comes with perl. :)


--- t/op/rx.t   29 Jan 2002 02:32:17 -  1.4
+++ t/op/rx.t   29 Jan 2002 18:53:22 -
@@ -209,8 +209,8 @@
 >
 OUTPUT
 
-TODO: {
-   local $TODO="Pending some sort of lowercasing op";
+SKIP: {
+   skip("Pending some sort of lowercasing op", 1);
output_is(gentest('HeLlO', <<'CODE', 'i'), <<'OUTPUT', 'case-insensitive 
regexen (/i)');
        rx_literal P0, "hel", $advance
rx_oneof P0, "lmno", $advance


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
It's Crack Cocaine time!



[PATCH lib/Parrot/Test.pm] More info about failed compiles

2002-01-30 Thread Michael G Schwern

This little patch makes command failures in tests (ie. if Parrot pukes
on compile) report the command and exit code like so:

# 'perl assemble.pl t/op/basic2.pasm --output t/op/basic2.pbc' failed with exit code 1

I don't know if that's informative enough, but its a start anyway.


--- lib/Parrot/Test.pm  29 Jan 2002 02:32:15 -  1.12
+++ lib/Parrot/Test.pm  30 Jan 2002 11:38:11 -
@@ -37,6 +37,8 @@
   }
 
   system "$^X -e \"$redir_string;system q{$command};\"";
+  my $exit_code = $? / 256;
+  $Builder->diag("'$command' failed with exit code $exit_code") if $exit_code;
 }
 
 my $count;


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
sort God kill 9, @ARGV;



Re: Perl6/Parrot status

2002-02-07 Thread Michael G Schwern

On Thu, Feb 07, 2002 at 07:12:18PM +0100, Sebastian Bergmann wrote:
>   Is this for real? I can't really believe this...

Yes, I have it on good authority from the Easter Bunny.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
conway: unit of mind expansion.  One Conway == ~20 lines of Perl code
  found in $CPAN/authors/id/D/DC/DCONWAY, which gives the sensation
  of your brain being wrapped around a brick, with kiwi juice squeezed
  on top.
-- Ziggy



Re: Perl6/Parrot status

2002-02-07 Thread Michael G Schwern

On Thu, Feb 07, 2002 at 01:01:43PM -0800, Randal L. Schwartz wrote:
> >>>>> "Jason" == Jason Gloudon <[EMAIL PROTECTED]> writes:
> 
> Jason> In case everyone is not familiar with the easter bunny concept,
> Jason> this is a joke.
> 
> It's a joke that everyone is not familiar with the easter bunny
> concept?  I don't get it.  Can someone have Santa Claus explain it to
> me?

This, too, is a joke.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Fuck with me and I will saw off your legs.
http://www.unamerican.com/



Re: [PATCH] Stop win32 popping up dialogs on segfault

2002-02-08 Thread Michael G Schwern

On Fri, Feb 08, 2002 at 07:19:26PM +0100, Mattia Barbon wrote:
Content-Description: Mail message body
> The following patch adds a Parrot_nosegfault() function
> to win32.c; after it is called, a segmentation fault will print
> "This process received a segmentation violation exception"
> instead of popping up a dialog. I think it might be useful
> for tinderbox clients.

I don't suppose you could put something like this into Perl 5?


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Schwern Unit:  a positive but insignificant quantity



Re: +2 Axe of Refactoring: packfile.c

2002-03-10 Thread Michael G Schwern

(Apologies to Michael Brown)

Yesterday on perl6-intern-, packfile.c died.
And they got that brit Simon on a charge of homicide
Some folks say he didn't do it others say of course he did
But they all agree, Mr Simon C. was a problem kinda kid

'Cause you can't chop your Parrot up on Perl 6 Porters
Not even if it's planned as a surprise
No, you can't chop your Parrot up on Perl 6 Porters
You know how net'zins love to criticize

Now it wasn't done for pleasure and it wasn't done for spite
And it wasn't done because the fellow wasn't very bright
He'd always done the slightest thing that the list denzins bid
They said, "Simon, cut it out!" so that's exactly what he did!

But you can't chop your Parrot up on Perl 6 Porters
And then license your software as Free
No you can't chop your Parrot up on Perl 6 Porters
Perl 6 Porters isn't p5p

Shut down the server, we'll restart it after-
Here comes Simon and he wants to refactor!


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
The beatings will continue until your style improves.



Stock Debian Linux/PowerPC OK

2002-03-16 Thread Michael G Schwern
EBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I../include -o default.o 
-c default.c
default.pmc: In function `Parrot_default_get_integer_keyed':
default.pmc:50: warning: control reaches end of non-void function
default.pmc: In function `Parrot_default_get_number_keyed':
default.pmc:58: warning: control reaches end of non-void function
default.pmc: In function `Parrot_default_get_string_keyed':
default.pmc:67: warning: control reaches end of non-void function
default.pmc: In function `Parrot_default_get_pmc_keyed':
default.pmc:87: warning: control reaches end of non-void function

more to come

cc -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
encodings/singlebyte.o -c encodings/singlebyte.c
encodings/singlebyte.c: In function `singlebyte_skip_forward':
encodings/singlebyte.c:49: warning: cast discards qualifiers from pointer target type
encodings/singlebyte.c: In function `singlebyte_skip_backward':
encodings/singlebyte.c:57: warning: cast discards qualifiers from pointer target type
cc -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
encodings/utf8.o -c encodings/utf8.c
encodings/utf8.c: In function `utf8_skip_forward':
encodings/utf8.c:113: warning: cast discards qualifiers from pointer target type
encodings/utf8.c: In function `utf8_skip_backward':
encodings/utf8.c:125: warning: cast discards qualifiers from pointer target type
cc -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
encodings/utf16.o -c encodings/utf16.c
encodings/utf16.c: In function `utf16_skip_forward':
encodings/utf16.c:87: warning: cast discards qualifiers from pointer target type
encodings/utf16.c: In function `utf16_skip_backward':
encodings/utf16.c:112: warning: cast discards qualifiers from pointer target type
cc -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
encodings/utf32.o -c encodings/utf32.c
encodings/utf32.c: In function `utf32_skip_forward':
encodings/utf32.c:54: warning: cast discards qualifiers from pointer target type
encodings/utf32.c: In function `utf32_skip_backward':
encodings/utf32.c:62: warning: cast discards qualifiers from pointer target type





-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
you're a bleeding-heart
liberal.  LET ME PLUG MY
ASS WITH PASTE RIGHT NOW!
-- japhy



64 bit Debian Linux/PowerPC OK but very noisy

2002-03-16 Thread Michael G Schwern

This is parrot built using a 5.6.1 with 64 bit integers.  The tests
pass ok, but there's a heap of warnings in the build.  Here's the
complete make output.


perl5.6.1 vtable_h.pl
perl5.6.1 make_vtable_ops.pl > vtable.ops
perl5.6.1 ops2c.pl C core.ops io.ops rx.ops vtable.ops
include/parrot/oplib/core_ops.hperl5.6.1 ops2c.pl CPrederef core.ops io.ops rx.ops 
vtable.ops
include/parrot/oplib/core_ops_prederef.hcc -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align 
-Wwrite-strings -Wconversion -Waggregate-return -Winline -W -Wno-unused -Wsign-compare 
   -I./include  -o test_main.o -c test_main.c
cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
exceptions.o -c exceptions.c
cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
global_setup.o -c global_setup.c
global_setup.c: In function `init_world':
global_setup.c:23: warning: passing arg 1 of `Parrot_Array_class_init' with different 
width due to prototype
global_setup.c:24: warning: passing arg 1 of `Parrot_PerlUndef_class_init' with 
different width due to prototype
global_setup.c:25: warning: passing arg 1 of `Parrot_PerlInt_class_init' with 
different width due to prototype
global_setup.c:26: warning: passing arg 1 of `Parrot_PerlNum_class_init' with 
different width due to prototype
global_setup.c:27: warning: passing arg 1 of `Parrot_PerlString_class_init' with 
different width due to prototype
global_setup.c:28: warning: passing arg 1 of `Parrot_PerlArray_class_init' with 
different width due to prototype
global_setup.c:29: warning: passing arg 1 of `Parrot_PerlHash_class_init' with 
different width due to prototype
global_setup.c:30: warning: passing arg 1 of `Parrot_ParrotPointer_class_init' with 
different width due to prototype
global_setup.c:31: warning: passing arg 1 of `Parrot_IntQueue_class_init' with 
different width due to prototype
cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
interpreter.o -c interpreter.c
interpreter.c: In function `make_interpreter':
interpreter.c:481: warning: passing arg 1 of `mem_sys_allocate' with different width 
due to prototype
interpreter.c:501: warning: passing arg 2 of `pmc_new' with different width due to 
prototype
interpreter.c:577: warning: passing arg 3 of `Parrot_string_make' with different width 
due to prototype
interpreter.c:577: warning: passing arg 5 of `Parrot_string_make' with different width 
due to prototype
interpreter.c:579: warning: passing arg 3 of `Parrot_string_make' with different width 
due to prototype
interpreter.c:579: warning: passing arg 5 of `Parrot_string_make' with different width 
due to prototype
cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o parrot.o 
-c parrot.c
cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
register.o -c register.c
cc -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare-I./include  -o 
core_ops.o -c core_ops.c
core.ops: In function `Parrot_close_i':
core.ops:93: warning: cast to pointer from integer of different size
core.ops: In function `Parrot_err_s':
core.ops:117: warning: passing arg 3 of `Parrot_string_make' with different width due 
to prototype
core.ops:117: warning: passing arg 5 of `Parrot_string_make' with different width due 
to prototype
core.ops: In function `Parrot_open_i_s':
core.ops:137: warning: cast from pointer to integer of different size
core.ops: In function `Parrot_open_i_sc':
core.ops:137: warning: cast from 

OpenVMS can't get past configure

2002-03-16 Thread Michael G Schwern

Using 5.005_03 on OpenVMS 7.3...


Determining if your C compiler is actually gcc (this could take a while):


Your C compiler is not gcc.


Probing Perl 5's configuration to determine which headers you have (this could
take a while on slow machines)...
Out of memory!
%SYSTEM-F-ABORT, abort


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
no paste enema
lycos is taught about it
my ass is sealed
-- Schwern



Re: 64 bit Debian Linux/PowerPC OK but very noisy

2002-03-16 Thread Michael G Schwern

On Sat, Mar 16, 2002 at 02:36:45PM -0800, Hong Zhang wrote:
> 
> Can you check what is the sizeof(INTVAL) and sizeof(void*)?
> Some warnings should not have happened.

(Note: Not a C programmer)

INTVAL?  I can't find where its defined.

int main (void) {
printf("int %d, long long %d, void %d\n", 
   sizeof(int), sizeof(long long), sizeof(void*));
}

int 4, long long 8, void 4.

>From perl -V:

intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, usemymalloc=n, prototype=define


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
The key, my friend, is hash browns.
http://www.goats.com/archive/980402.html



[PATCH Configure.pl] (still broken) Re: OpenVMS can't get past configure

2002-03-17 Thread Michael G Schwern

On Sun, Mar 17, 2002 at 10:13:58AM -0800, Brent Dax wrote:
> Lines in question:
> 
> 
> foreach(grep {/^i_/} keys %Config) {
> $c{$_}=$Config{$_};
> $c{headers}.=defineifdef((/^i_(.*)$/));
> }
> 
> I think VMS is too lame to handle the grep line.  Honestly, I'd rather
> not change it to bow to a retarded OS, but apparently we have to.  You
> can probably just say:
> 
> foreach(keys %Config) {
> next unless /^i_/;
> $c{$_}=$Config{$_};
> $c{headers}.=defineifdef((/^i_(.*)$/));
> }

If one wanted to do that in a memory efficient manner...

--- Configure.plSun Mar 17 15:53:06 2002
+++ Configure.pl  Sat Mar 16 15:00:00 2002
@@ -483,9 +481,10 @@
 # Set up HAS_HEADER_
 #
 
-foreach(grep {/^i_/} keys %Config) {
-$c{$_}=$Config{$_};
-$c{headers}.=defineifdef((/^i_(.*)$/));
+while(my($k, $v) = each %Config) {
+next unless $k =~ /^i_/;
+$c{$k} = $v;
+$c{headers} .= defineifdef(($k =~ /^i_(.*)$/));
 }
 
 print <<"END";


But even with this in place it still takes forever with 5.005_03.  So
I'll just chalk it up to a perl bug.  5.7.2 fares much better, but
still bombs later on...


Your C compiler is not gcc.


Probing Perl 5's configuration to determine which headers you have (this could
take a while on slow machines)...

Determining C data type sizes by compiling and running a small C program (this
could take a while):

  Building ./test.c   from test_c.in...

Figuring out the formats to pass to pack() for the various Parrot internal
types...
Figuring out what integer type we can mix with pointers...
We'll use 'unsigned int'.

Building a preliminary version of include/parrot/config.h, your Makefiles, and
other files:

  Building include/parrot/config.hfrom config_h.in...
  Building ./Makefile from Makefile.in...
Use of uninitialized value in substitution iterator at configure.pl line 803.
  Building ./classes/Makefile from classes/Makefile.in...
  Building ./docs/Makefilefrom docs/Makefile.in...
  Building ./languages/Makefile   from languages/Makefile.in...
  Building ./languages/jako/Makefile  from languages/jako/Makefile.in...
  Building ./languages/miniperl/Makefile  from languages/miniperl/Makefile.in...
  Building ./languages/scheme/Makefilefrom languages/scheme/Makefile.in...
  Building lib/Parrot/Types.pmfrom Types_pm.in...
  Building lib/Parrot/Config.pm   from Config_pm.in...


Checking some things by compiling and running another small C program (this
could take a while):

  Building ./testparrotsizes.cfrom testparrotsizes_c.in...


#include "parrot/parrot.h"
#include "parrot/parrot.h"
..^
..^
%CC-F-NOINCLFILEF, Cannot find file "parrot/parrot.h" specified in #include directive.
%CC-F-NOINCLFILEF, Cannot find file "parrot/parrot.h" specified in #include directive.
at line number 9 in file USER1:[SCHWERN.SRC.PARROT]TESTPARROTSIZES.C;1
at line number 9 in file USER1:[SCHWERN.SRC.PARROT]TESTPARROTSIZES.C;1
C compiler died! at (eval 1) line 13.
%RMS-E-FNF, file not found




PS You're not qualified to yell at VMS until you grok the mystery of:
$ rm foo
$ rm foo
$ rm foo 
$ rm foo
$ rm foo
$ rm foo
$ rm foo
$ rm foo
$ rm foo
$ rm foo
$ rm foo
rm.exe: foo: no such file or directory

:)


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
It wasn't false, just differently truthful.
-- Abhijit Menon-Sen in <[EMAIL PROTECTED]>



Re: 64 bit Debian Linux/PowerPC OK but very noisy

2002-03-17 Thread Michael G Schwern

On Sun, Mar 17, 2002 at 10:16:13AM -0800, Brent Dax wrote:
> Michael G Schwern:
> # On Sat, Mar 16, 2002 at 02:36:45PM -0800, Hong Zhang wrote:
> # >
> # > Can you check what is the sizeof(INTVAL) and sizeof(void*)?
> # > Some warnings should not have happened.
> #
> # (Note: Not a C programmer)
> #
> # INTVAL?  I can't find where its defined.
> 
> INTVAL is in config.h.  Make sure you #define PARROT_IN_CORE--or you can
> just test Parrot_Int, which should be the same thing and is publicly
> defined.

>From config.h

typedef long long INTVAL;
    typedef unsigned long long UINTVAL;


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Out of ammunition.  God save the King.



Re: 64 bit Debian Linux/PowerPC OK but very noisy

2002-03-17 Thread Michael G Schwern

On Sun, Mar 17, 2002 at 12:50:57PM -0800, Hong Zhang wrote:
> 
> It looks like you are running in 32-bit environment, but
> using 64-bit INTVAL. The INTVAL must be the same size as
> void* in order to cast between them without warning.
> Please try to reconfig using 32-bit INTVAL, or running
> process in 64-bit mode.

Huh?

Remember, I am not a C programmer.  I just took my perl 5.6.1 that's
compiled with 64 bit ints and ran Configure.pl with it.  


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Out of ammunition.  God save the King.



Re: [PATCH Configure.pl] (still broken) Re: OpenVMS can't get past configure

2002-03-17 Thread Michael G Schwern

On Sun, Mar 17, 2002 at 05:06:35PM -0800, Brent Dax wrote:
> # Checking some things by compiling and running another small C
> # program (this
> # could take a while):
> #
> #   Building ./testparrotsizes.cfrom testparrotsizes_c.in...
> #
> #
> # #include "parrot/parrot.h"
> # #include "parrot/parrot.h"
> # ..^
> # ..^
> # %CC-F-NOINCLFILEF, Cannot find file "parrot/parrot.h"
> # specified in #include directive.
> # %CC-F-NOINCLFILEF, Cannot find file "parrot/parrot.h"
> # specified in #include directive.
> # at line number 9 in file USER1:[SCHWERN.SRC.PARROT]TESTPARROTSIZES.C;1
> # at line number 9 in file USER1:[SCHWERN.SRC.PARROT]TESTPARROTSIZES.C;1
> # C compiler died! at (eval 1) line 13.
> # %RMS-E-FNF, file not found
> 
> Yikes.  Does the C compiler recognize that sort of path?  How about
> the -I switch (it may be set differently by VMS's hints file) that tells
> it to look in ./include?

main::(configure.pl:668):   compiletestc("testparrotsizes");
  DB<2> s
main::CODE(0x7a1c8c)((eval 4)[configure.pl:297]:10):
10: my $name;
  DB<2> n
main::CODE(0x7a1c8c)((eval 4)[configure.pl:297]:11):
11: $name = shift;
  DB<2> 
main::CODE(0x7a1c8c)((eval 4)[configure.pl:297]:12):
12: $name = "test" unless $name;
  DB<2> 
main::CODE(0x7a1c8c)((eval 4)[configure.pl:297]:13):
13: system("$c{cc} $c{ccflags} $name.c") and die "C compiler 
died!";
  DB<2> x "$c{cc} $c{ccflags} $name.c"
0  'CC/DECC 
/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList/NOANSI_ALIAS/include=([.include],"/here")
 testparrotsizes.c'
  DB<3> use Cwd
  DB<4> x cwd
0  'USER1:[SCHWERN.SRC.PARROT]'
  DB<5> n


#include "parrot/parrot.h"
#include "parrot/parrot.h"
..^
..^
%CC-F-NOINCLFILEF, Cannot find file "parrot/parrot.h" specified in #include directive.
%CC-F-NOINCLFILEF, Cannot find file "parrot/parrot.h" specified in #include directive.
at line number 9 in file USER1:[SCHWERN.SRC.PARROT]TESTPARROTSIZES.C;3
at line number 9 in file USER1:[SCHWERN.SRC.PARROT]TESTPARROTSIZES.C;3
C compiler died! at (eval 4)[configure.pl:297] line 13.
main::__ANON__[(eval 4)[configure.pl:297]:15]('testparrotsizes') called 
Debugged program terminated.  Use q to quit or R to restart,



Poking around in the DECC manual, there's two problems.
http://www.openvms.compaq.com/commercial/c/5492p004.htm#index_x_113

First, its INCLUDE_DIRECTORY, not INCLUDE (although INCLUDE works).

Second, there seems to be some confusing rules about mixing VMS and
Unix style paths.  It seems that the style used in INCLUDE_DIRECTORY
has to match the style used in the #include.  

   Search the places specified in the /INCLUDE_DIRECTORY qualifier, if
   any. A place that can be parsed successfuly as an OpenVMS file-spec
   and that does not contain an explicit file type or version
   specification is edited to append the default header file type
   specification (".h" or ".").  
   
   A place containing a "/" character is considered to be a UNIX-style
   name. If the name in the #include directive also contains a "/"
   character that is not the first character and is not preceded by a
   "!" character (it is not an absolute UNIX-style pathname), then the
   name in the #include directive is appended to the named place,
   separated by a "/" character, before applying the decc$to_vms
   pathname translation function. The result of the decc$to_vms
   translation is then used as the filespec to try to open.

so this works:

CC/DECC /INCLUDE=("./include") testparrotsizes.c

but you might want to get independent confirmation from the vmsperl
folks about that.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Not king yet



Re: 64 bit Debian Linux/PowerPC OK but very noisy

2002-03-17 Thread Michael G Schwern

On Sun, Mar 17, 2002 at 09:21:12PM -0800, Brent Dax wrote:
> # Remember, I am not a C programmer.  I just took my perl 5.6.1 that's
> # compiled with 64 bit ints and ran Configure.pl with it.
> 
> Okay.  When Configure asks:
> 
>   How big would you like integers to be? [long long]
> 
> just type 'long' (without quotes) and hit enter.  You won't get 64-bit
> support, but you will get a building Parrot, which is usually a good
> thing.  ;^)

Well, the point isn't that Parrot builds.  The point is that Configure
should DWIM when I throw it Interesting (in the Chinese sense) perl
configurations.  Currently it doesn't.

If Parrot is busted wrt 64 bit ints on 32 bit platforms, could
Configure just throw a warning?


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
In the old days (say, Amiga :-) we had only kilobytes
of stack.  And the road to school was surrounded by hungry wolves.
And it was steep uphill.  Both ways.
-- Jarkko Hietaniemi in <[EMAIL PROTECTED]>



Re: Misc portability cleanups

2002-03-30 Thread Michael G Schwern

On Sun, Mar 31, 2002 at 12:49:08AM -0500, Melvin Smith wrote:
> I did some browsing of the code for potential problems in compiling
> for embedded platforms and/or general porting and here are some of the
> things I found.

Do embedded C compilers often not conform to ANSI C 89?


> 1- assert.h and use of assert()
> assert is easy enough to implement we need to do this and not depend
> on its existence on the target because its not guaranteed.

assert is part of ANSI C 89, it should always be there.  The only
limitation is the expression must be an int.


> 2- errno.h same thing.

errno is also in ANSI C 89.

However, using errno to transmit error messages has bitten us in the
ass in Perl5.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Monkey tennis



Re: OpenVMS V7.2-1H1 configure.pl results using the defaults

2002-04-01 Thread Michael G Schwern

On Mon, Apr 01, 2002 at 07:00:57AM -0800, Charles Bunders wrote:
> Checking some things by compiling and running another small C program (this
> could take a while):
> 
>   Building ./testparrotsizes.cfrom testparrotsizes_c.in...
> 
> #include "parrot/parrot.h"
> ..^
> %CC-F-NOINCLFILEF, Cannot find file "parrot/parrot.h" specified in #include
> directive.
> at line number 9 in file TESTPARROTSIZES.C;1
> C compiler died! at (eval 1) line 13.
> %RMS-E-FNF, file not found

This problem came up a few weeks ago.
http:[EMAIL PROTECTED]/msg08963.html

If I'm reading it correctly, it seems one can't mix Unix and VMS path
styles between your INCLUDE_DIRECTORY and header files.

So this combination will work:

CC/DECC /INCLUDE=("./include") testparrotsizes.c

#include "parrot/parrot.h"

but this will not:

CC/DECC /INCLUDE=("[.include]") testparrotsizes.c

#include "parrot/parrot.h"

which just seems wrong.  It has to be wrong, because Perl5 builds with
things like:

CC/DECC/NOANSI_ALIAS 
/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList/float=ieee/ieee=denorm_results
 /Include=([],[.ext.dynaloader])/Object=[.EXT.DYNALOADER]DL_VMS.OBJ 
[.EXT.DYNALOADER]DL_VMS.C


Ahh, here's something I didn't notice before.  compiletestc() is
coming from hints/vms.pl.  It's different from the one in Configure.pl
most significantly in that it doesn't tell you what the command was.

Fixing that, we get:

C compiler died!  Command was 'CC/DECC 
/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList/NOANSI_ALIAS/include=([.include],"/here")
 testparrotsizes.c'

now what's that "/here" thing doing there?  Taking it out doesn't fix
things.

I'm stumped.  I'll go ask on VMSperl.



-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
I'm successful because I'm lucky.   The harder I work, the luckier I get.



[PATCH hints/vms.pl] VMS Configure fix

2002-04-01 Thread Michael G Schwern

My research was right.  You *can't* mix Unix and VMS style include
paths on VMS.  It will just dumbly concatinate them.

CC/DECC /include=[.include]

Result:  [.include]parrot/parrot.h  *wrong*

CC/DECC /include="./include"

Result: ./include/parrot/parrot.h   *right*

Perl5 simply avoids ever using '#include "foo/bar.h"' syntax except in
one instance (SDBM_File) where the include directory is the cwd, so it
works by luck.


So this patch gets VMS past Configure and it immediately vomits
because of a syntax error in the descrip.mms

$ mmk
%MMK-F-PARSERR, error parsing description line mops: examples/assembly/mopsexe 
examples/mops/mopsexe
-MMK-I-ERRLOC, at line number 148 in file USER1:[SCHWERN.SRC.PARROT]MAKEFILE.;7
-LIB-F-SYNTAXERR, string syntax error detected by LIB$TPARSE



--- hints/vms.pl4 Jan 2002 17:39:29 -   1.5
+++ hints/vms.pl1 Apr 2002 18:48:40 -
@@ -1,8 +1,10 @@
 use Cwd;
-$c{ccflags} = 
"/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList/NOANSI_ALIAS/include=([.include],\"/here\")";
+$c{ccflags} = 
+qq{/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList/NOANSI_ALIAS/include="./include"};
+
 if (!defined $c{exe}) {
   $c{exe} = "exe";
 }
+
 {
local $^W;  #no warnings on redefinition
 
@@ -10,8 +12,11 @@
my $name;
$name = shift;
$name = "test" unless $name;
-   system("$c{cc} $c{ccflags} $name.c") and die "C compiler died!";
-   system("link/exe=test_siz $name") and die "Link failed!";
+my $cmd = "$c{cc} $c{ccflags} $name.c";
+   system($cmd) and die "C compiler died!  Command was '$cmd'";
+
+    $cmd = "link/exe=test_siz $name";
+   system($cmd) and die "Link failed!  Command was '$cmd'";
};
 
*runtestc=sub {

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
If you have to shoot, shoot!  Don't talk.
-- Tuco, "The Good, The Bad And The Ugly"



[PATCH Makefile.in] MMS syntax errors

2002-04-01 Thread Michael G Schwern
_H_FILES)
 
-rx$(O): $(GENERAL_H_FILES)
+rx$(O) : $(GENERAL_H_FILES)
 
-rxstacks$(O): $(GENERAL_H_FILES)
+rxstacks$(O) : $(GENERAL_H_FILES)
 
-stacks$(O): $(GENERAL_H_FILES)
+stacks$(O) : $(GENERAL_H_FILES)
 
-embed$(O): $(GENERAL_H_FILES)
+embed$(O) : $(GENERAL_H_FILES)
 
-core_ops$(O): $(GENERAL_H_FILES) core_ops.c
+core_ops$(O) : $(GENERAL_H_FILES) core_ops.c
 
-core_ops.c $(INC)/oplib/core_ops.h: $(OPS_FILES) ops2c.pl lib/Parrot/OpsFile.pm 
lib/Parrot/Op.pm
+core_ops.c $(INC)/oplib/core_ops.h : $(OPS_FILES) ops2c.pl lib/Parrot/OpsFile.pm 
+lib/Parrot/Op.pm
$(PERL) ops2c.pl C $(OPS_FILES)
 
-core_ops_prederef$(O): $(GENERAL_H_FILES) core_ops_prederef.c
+core_ops_prederef$(O) : $(GENERAL_H_FILES) core_ops_prederef.c
 
-core_ops_prederef.c $(INC)/oplib/core_ops_prederef.h: $(OPS_FILES) ops2c.pl 
lib/Parrot/OpsFile.pm lib/Parrot/Op.pm
+core_ops_prederef.c $(INC)/oplib/core_ops_prederef.h : $(OPS_FILES) ops2c.pl 
+lib/Parrot/OpsFile.pm lib/Parrot/Op.pm
$(PERL) ops2c.pl CPrederef $(OPS_FILES)
 
-warnings$(O): $(H_FILES)
+warnings$(O) : $(H_FILES)
 
-misc$(O): $(H_FILES)
+misc$(O) : $(H_FILES)
 
-vtable.ops: make_vtable_ops.pl
+vtable.ops : make_vtable_ops.pl
$(PERL) make_vtable_ops.pl > vtable.ops
 
-$(STICKY_FILES): Configure.pl config_h.in
+$(STICKY_FILES) : Configure.pl config_h.in
$(PERL) Configure.pl
 
-$(INC)/vtable.h: vtable.tbl vtable_h.pl
+$(INC)/vtable.h : vtable.tbl vtable_h.pl
$(PERL) vtable_h.pl
 
-$(INC)/jit_struct.h: jit2h.pl lib/Parrot/OpLib/core.pm lib/Parrot/Jit.pm 
jit/${jitcpuarch}/core.jit jit/${jitcpuarch}/string.jit
+$(INC)/jit_struct.h : jit2h.pl lib/Parrot/OpLib/core.pm lib/Parrot/Jit.pm 
+jit/${jitcpuarch}/core.jit jit/${jitcpuarch}/string.jit
$(PERL) jit2h.pl ${jitcpuarch} > $(INC)/jit_struct.h
 
-docs: docs/.dummy
+docs : docs/.dummy
 
-docs/.dummy:
+docs/.dummy :
cd docs && $(MAKE) && cd ..
 
-$(CLASS_O_FILES):
+$(CLASS_O_FILES) :
cd classes && $(MAKE) && cd ..
 
-languages: languages.dummy
+languages : languages.dummy
 
-languages.dummy:
+languages.dummy :
cd languages && $(MAKE) && cd ..
 
 
@@ -389,30 +389,30 @@
 #
 ###
 
-test: $(TEST_PROG) assemble.pl .test_dummy
+test : $(TEST_PROG) assemble.pl .test_dummy
 
-.test_dummy:
+.test_dummy :
$(PERL) t/harness
 
-testp: $(TEST_PROG) assemble.pl blib/lib/libcore_prederef$(SO) 
blib/lib/libparrot$(SO) $(TEST_PROG_SO) .test_dummy_p
+testp : $(TEST_PROG) assemble.pl blib/lib/libcore_prederef$(SO) 
+blib/lib/libparrot$(SO) $(TEST_PROG_SO) .test_dummy_p
 
-.test_dummy_p:
+.test_dummy_p :
$(PERL) t/harness -P
 
-testj: $(TEST_PROG) assemble.pl .test_dummy_j
+testj : $(TEST_PROG) assemble.pl .test_dummy_j
 
-.test_dummy_j:
+.test_dummy_j :
$(PERL) t/harness -j
 
-quicktest: $(TEST_PROG) assemble.pl .quicktest_dummy
+quicktest : $(TEST_PROG) assemble.pl .quicktest_dummy
 
-.quicktest_dummy:
+.quicktest_dummy :
$(PERL) t/harness quick
 
-mopstest: $(TEST_PROG) examples/assembly/mops.pbc
+mopstest : $(TEST_PROG) examples/assembly/mops.pbc
$(TEST_PROG) examples/assembly/mops.pbc
 
-lifetest: $(TEST_PROG) examples/assembly/life.pbc
+lifetest : $(TEST_PROG) examples/assembly/life.pbc
$(TEST_PROG) examples/assembly/life.pbc
 
 
@@ -422,7 +422,7 @@
 #
 ###
 
-clean: testclean
+clean : testclean
$(RM_F) $(O_FILES)
$(RM_F) *.s
$(RM_F) $(FLUID_FILES)
@@ -436,22 +436,22 @@
cd classes && $(MAKE) clean && cd ..
cd languages && $(MAKE) clean && cd ..
 
-testclean:
+testclean :
$(RM_F) t/op/*.pasm t/op/*.pbc t/op/*.out
 
-realclean: clean
+realclean : clean
$(RM_F) $(STICKY_FILES)
 
-distclean:
+distclean :
$(PERL) -MExtUtils::Manifest=filecheck -le ${PQ}sub 
ExtUtils::Manifest::_maniskip{sub{0}};$$ExtUtils::Manifest::Quiet=1;unlink $$_ for 
filecheck()${PQ}
 
-cvsclean:
+cvsclean :
$(PERL) -MExtUtils::Manifest=filecheck -le ${PQ}sub 
ExtUtils::Manifest::_maniskip{sub{0}};$$ExtUtils::Manifest::Quiet=1; do { unlink $$_ 
unless $$_ =~ m!(?:CVS/|\.cvs)! } for filecheck()${PQ}
 
-reconfig:
+reconfig :
$(MAKE) clean; $(PERL) Configure.pl --reconfig
 
-manitest:
+manitest :
$(PERL) -MExtUtils::Manifest=fullcheck -e fullcheck
 
 ###
@@ -460,13 +460,13 @@
 #
 ###
 
-update:
+update :
cvs -q update -dP
 
-status:
+status :
cvs -n -q upd -dP
 
-lint: ${test_prog}
+lint : ${test_prog}
    $(LINT) ${cc_inc} ${cc_hasjit} -Iclasses $(LINTFLAGS) `echo $(O_FILES) | sed 
's/\.o/\.c/g'`
$(LINT) ${cc_inc} $(LINTFLAGS) test_main.c
 

-- 

Michael G. Schwern  

[PATCH Makefile.in] assemble.pl target missing

2002-04-01 Thread Michael G Schwern

DECC's make utility, MMS, speaks a very, very strict and unforgiving
dialect of make.  It's very useful for finding things like macros
defined twice or missing targets:

$ mms
%MMS-W-MBREDEFILL, Illegal attempt to redefine macro 'LD'


test : $(TEST_PROG) assemble.pl .test_dummy
%MMS-W-DRVPARSERR, Parser error: "syntax error" in file USER1:[SCHWERN.SRC.PARRO
T]MAKEFILE.;10, line 392.
%MMS-F-DRVBADPARSE, Parser detected a fatal syntax error in the description file
..

which translates into:

LD is defined twice.
assemble.pl isn't defined at all!

the first one is easy enough to take care of.  As for assemble.pl...?

--- Makefile.in 29 Mar 2002 07:07:20 -  1.142
+++ Makefile.in 1 Apr 2002 19:11:18 -
@@ -109,7 +109,6 @@
 C_LIBS = ${libs}
 
 CC = ${cc}
-LD = ${ld}
 PERL = ${perl}
 
 


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Perl_croak(aTHX_ "Believe me, you don't want to use \"-u\" on a Macintosh");
-- perl.c



[PATCH] VMS fixups. Configure hints & Makefile syntax

2002-04-01 Thread Michael G Schwern
quot;;
-           system("link/exe=test_siz $name") and die "Link failed!";
+my $cmd = "$c{cc} $c{ccflags} $name.c";
+   system($cmd) and die "C compiler died!  Command was '$cmd'";
+
+$cmd = "link/exe=test_siz $name";
+   system($cmd) and die "Link failed!  Command was '$cmd'";
};
 
*runtestc=sub {


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
It wasn't false, just differently truthful.
-- Abhijit Menon-Sen in <[EMAIL PROTECTED]>



Re: Roadmap for Parrot

2002-04-17 Thread Michael G Schwern

On Wed, Apr 17, 2002 at 03:27:51PM -0400, Dan Sugalski wrote:
> Okay, here are the milestones. Each is worth a point release. If we 
> manage to take them in this order, great. :)
> 
> *) Working arrays
> 
> *) Working hashes
> 
> *) Regular expressions
> 
> *) Symbol tables
> 
> *) Method calls
> 
> *) Lexicals
> 
> *) Subroutines
> 
> *) Attributes
> 
> *) Per-object specials (variables & subs)
> 
> *) Continuations
> 
> *) Parser
> 
> *) Compiler
> 
> *) Simple optimizer

I don't see "World Domination" or "Nervous Breakdown" in there anywhere.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Fuck with me and I will saw off your legs.
http://www.unamerican.com/



Re: Irrational fear of macros

2002-06-19 Thread Michael G Schwern

On Tue, Jun 18, 2002 at 01:25:49PM -0400, Melvin Smith wrote:
> 1) Macros and debuggers don't play as well together.

I second that.  One of my biggest barriers to useful debugging of perl5 is
having, for example, an HV and having to unroll something like the
SvRMAGICAL() macro to figure out if it's a magical HV.

Now, there is a little trick I use in Perl with macros to get around this
problem and it might work with C.

$ cat ~/tmp/foo.plx 
#!/usr/bin/perl

BEGIN { eval 'use Filter::cpp' }

sub FOO {
my $bar = shift;
#define FOO($bar) \
"FOO has ".$bar
}

print FOO(42), "\n";

$ perl ~/tmp/foo.plx 
FOO has 42

$ perl -dw ~/tmp/foo.plx 
Default die handler restored.

Loading DB routines from perl5db.pl version 1.07
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(/home/schwern/tmp/foo.plx:12):
12: print "FOO has ". 42  , "\n";
  DB<1> x FOO(23)
0  23
  DB<2> 

FOO() is both a macro *and* a real subroutine with a minimum of code
duplication.  I originally used this technique to avoid depending on
Filter::cpp and a C preprocessor, but it also has the nice side effect of
creating debugger friendly macros.

I'm sure someone can figure out an equivalent techique for C.


-- 
This sig file temporarily out of order.



Re: [perl #16690] Disable t/src under testj

2002-08-22 Thread Michael G Schwern

On Wed, Aug 21, 2002 at 02:11:29PM +, Daniel Grunblatt wrote:
> Apart from that, does anyone know why test doesn't run on OpenBSD?
> I get:
> 
> ar: illegal option -- s

Gnu-ism?  What ar does OpenBSD use?

   A  number  of modifiers (mod) may immediately follow the p
   keyletter, to specify variations on an operation's  behav­
   ior:

   ...

   s   Write an object-file index into the archive, or update
   an existing one, even if no other change  is  made  to
   the  archive.   You  may use this modifier flag either
   with any operation, or alone.   Running  ar  s  on  an
   archive is equivalent to running ranlib on it.


> usage:  ar -d [-Tv] archive file ...
> ar -m [-Tv] archive file ...
> ar -m [-abiTv] position archive file ...
> ar -p [-Tv] archive [file ...]
> ar -q [-cTv] archive file ...
> ar -r [-cuTv] archive file ...
> ar -r [-abciuTv] position archive file ...
> ar -t [-Tv] archive [file ...]
> ar -x [-CouTv] archive [file ...]
> *** Error code 1


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
If I got something to say, I'll say it with lead.
-- Jon Wayne



Re: Perl 6 JAPH ...

2002-09-30 Thread Michael G Schwern

On Sat, Sep 21, 2002 at 12:33:05PM +0200, Thomas Klausner wrote:
> In accordance to Schwern's "How use strict got me a perl5porter", this
> seems like "How obfuscation got me on perl6-internals" ...

s/Schwern/Merijn/  

For reference:  http://husk.org/perl/yapc/DSCF0118.jpg
I'm in the middle.  Merijn is the fellow on the left who looks like he's
just seen his grandmother naked.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Any sufficiently encapsulated hack is no longer a hack.



Re: Self documenting comments for parrot

2002-10-02 Thread Michael G Schwern

On Thu, Oct 03, 2002 at 12:26:53AM -0400, Matt Fowles wrote:
> I don't like Java that much (for many reasons), but I have nothing but
> respect for the massive amount of documentation that is easily accessible as
> a direct result of JavaDoc.  I personnaly feel that it greatly helped java
> achieve the success it has.  If all of parrot's module were that well
> documented and that easily accessible, it would be a great boon in
> recruiting followers.
> 
> Also, localizing the code and the documentation allow programmer to keep
> updated documentation more easily.  Furthermore, since the docs will be in
> the same files as the code, we can simply refuse to accept patches that do
> not update the infile documentation.  Thus preventing the horribly
> problematic outdated documentation.

POD has all the above attributes.  Any documentation format for Parrot must
unquestionably allow inlining with the code.


> I say all of these things as someone who is new to this project and doesn't
> know POD.  If some of my statements here are in ignorant of the way things
> are, please correct me.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Do you have a map? Because I keep getting lost in your armpits.



Re: DOS filename collisions

2002-12-04 Thread Michael G Schwern
On Wed, Dec 04, 2002 at 10:32:41AM -0500, Dan Sugalski wrote:
> At 6:58 AM -0800 12/4/02, Mr. Nobody wrote:
> >There are some files in parrot that have names common in the first 8
> >characters. This will cause problems if someone tries to compile Parrot on
> >DOS. Is DOS an intended target, or should we not worry about this?
> 
> DOS isn't an intended compilation target, no.

Not even djgpp?


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
The eye opening delightful morning taste of expired cheese bits in sour milk!



Re: DOS filename collisions

2002-12-04 Thread Michael G Schwern
On Wed, Dec 04, 2002 at 02:03:06PM -0500, Dan Sugalski wrote:
> >> DOS isn't an intended compilation target, no.
> >
> >Not even djgpp?
> 
> Hadn't planned on it. What advantage does it give over windows?

It'll compile C programs on a 386/SX, 20M of disk, 4megs of RAM and some
form of DOS.

Dunno if hardware that old is inside Parrot's scope.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Only mindless violence can raise my spirits now!



Re: benchmarking - it's now all(-1,0,1,5,6)% faster

2003-01-12 Thread Michael G Schwern
On Sat, Jan 11, 2003 at 07:05:22PM +, Nicholas Clark wrote:
> I was getting about 5% speedups on penfold against vanilla development perl.
> Penfold is an x86 box (actually a Citrix chip, which may be important) running
> Debian unstable, with gcc 3.2.1 and 256M of RAM.
> 
> I tried the same tests on mirth, a ppc box, again Debian unstable, gcc 3.2.1,
> but 128M of RAM. This time I saw 1% slowdowns.

FWIW, in the past I've noticed that x86 and PPC do react differently to
optimizations.  I've had cases where things ran at the same speed on PPC
yet showed large differences on x86.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One



Re: About RT/Perl

2003-03-31 Thread Michael G Schwern
On Mon, Mar 31, 2003 at 12:54:38PM +0100, Alberto Simões/EPL wrote:
> Anybody can tell me the address for RT/perl software?
> Thanks a lot.

Go to google.com, type in RT, hit "I'm feeling lucky"


-- 
It wasn't false, just differently truthful.
-- Abhijit Menon-Sen in <[EMAIL PROTECTED]>


Re: I scare me.

2003-08-02 Thread Michael G Schwern
On Sat, Aug 02, 2003 at 10:35:56AM +0100, Nicholas Clark wrote:
> On Sat, Aug 02, 2003 at 01:49:05AM -0400, David H. Adler wrote:
> > I'm sure it needs a few tweaks, but I've managed to write a hq9+
> > interpreter in pasm.
> 
> > Any thoughts on this?
> 
> + isn't a portable file name character is it?
> So although Unix (and CVS) will be quite happy, it would not be a great
> idea naming a subdirectory hq9+ ?
> 
> What should we call it

hq9p, same as the .pasm file.

PS  I think READ needs s/S1/S5/ if I'm reading it correctly.  Otherwise
everything after the 1024th character will be ignored, and then you
couldn't write Enterprise Level hq9+ programs!


-- 
Quit looking, kids!  It'll EAT YOUR MIND!!
-- http://www.angryflower.com/fuck.gif


Re: XGameStation

2003-08-14 Thread Michael G Schwern
On Mon, Aug 11, 2003 at 01:45:35AM -0700, Ask Bjoern Hansen wrote:
> We totally need to have Parrot running on this thing when it comes
> out.  :-)
> 
>   http://www.xgamestation.com/

Great idea, shame the hardware is crap. :(

"Third-generation Motorola 68HCS12 16-bit processor @ 25 MHz.
 Graphics architecture similar to Commodore 64, Atari 800 and Apple II."

-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Cheating is often more efficient.
- Seven of Nine


Re: What the heck is: timely destruction

2003-08-18 Thread Michael G Schwern
On Mon, Aug 18, 2003 at 10:52:50AM -0700, K Stol wrote:
> After reading most of the messages on timely destruction, I still don't quite 
> understand what it is. If someone has a spare minute free, could you please explain? 

In perl5 you can write this.

my $Destroyed = 0;
sub DESTROY { $Destroyed = 1; }
{
my $object = bless {};
}
die unless $Destroyed;
print "That's timely destruction\n";

and expect it to work.  It doesn't die and you reach the final print
statement.  That's because object are destroyed *immediately* upon their
falling out of scope so you can trust that the DESTROY method is called
immediately following the block.

Other languages don't work this way.  Java, for example, cleans up unused
objects whenever it happens to get around to it.  This means your object
might be destroyed immediately, or after a few statements have run, or
stick around until the end of the program.

Timely destruction is simple in Perl5 because it has a simple garbage
collection scheme, reference counting.  Each bit of date keeps track of how
many variables and references point to it.  When it drops to 0, its cleaned
up.  This count is kept up-to-date all the time so timely destruction
is easy.

Reference counting has problems.  One is memory leaks due to circular
dependencies.

{ my $a;
  my $b;
  $a = \$b;
  $b = \$a;
}

$a refers to $b.  $b refers to $a.  Their ref counts remain 1 even after
the block ends and their variables fall out of scope.  The data is never
garbage collected.  Memory leak.

Another is that it turns out to be pretty slow (last I heard Dan talk about
it) compared to modern garbage collecting techniques.

So Parrot is going with something else.  Don't ask me what it is, I don't
know.  With this other garbage collecting technique its more involved than
ref counting to guarantee timely destruction as we desire in Perl.
Apparently someone's figured a way to do it and do it efficiently.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/


Re: What the heck is: timely destruction

2003-08-18 Thread Michael G Schwern
On Mon, Aug 18, 2003 at 11:38:22AM -0700, K Stol wrote:
> if I understood correctly, the problem is that some objects should be
> destroyed *immediately*, and should not wait for the GC. 

Yep.  In perl 5 *all* objects and variables are to be destroyed immediately.
This doesn't necessarily mean that their memory has to be freed but that
at least their destructor methods are called.


> In fact, the programmer may have never heard about a garbage collecting 
> system at all, and just *assume* that everything which is out of scope, 
> is destroyed. 

Yep.  That's how most languages with lexical variables work these days.


> In real life, these objects may live somewhere in memory, waiting for the GC,
> but in fact are still there, so checking them for being alive will not yield
> the correct result.

I don't understand what you're saying there.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
It's Absinthe time!


Re: What the heck is: timely destruction

2003-08-18 Thread Michael G Schwern
On Mon, Aug 18, 2003 at 11:56:53AM -0700, K Stol wrote:
> > This doesn't necessarily mean that their memory has to be freed but that
> > at least their destructor methods are called.
> 
> So the objects may be still in memory. I thought the fact that they are
> still in memory
> was troublesome, but it's not, if I interpret your statement well.

I don't think its troublesome, no.  From the PoV of the programmer, the
object has been destroyed.  You can leave the freeing of memory for
later, that's an internal issue.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Beer still cheaper than crack!


Re: mission haiku

2003-08-28 Thread Michael G Schwern
On Thu, Aug 28, 2003 at 12:11:12AM +0100, Nicholas Clark wrote:
> I'm not convinced this is very good. But I believe that it is an accurate
> mission statement, for at least one of our goals:
> 
>   Perl internals slow,
>   nigh on unmaintainable.
>   So we write parrot.

Sounds like PONIE.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Beef Coronary


Re: Notifications

2003-08-29 Thread Michael G Schwern
On Thu, Aug 28, 2003 at 07:26:25PM -0400, Dan Sugalski wrote:
> What is a notification system? Well, what it is is a simple system 
> that posts an event when a watched resource is changed. We're going 
> to watch modification, deletion, addition, and destruction.
> 
> How does it work? Simple. When a watched resource does what we're 
> watching for (it changes, an entry is deleted, an entry is added, a 
> thing is destroyed) we post an event to the event queue. When that 
> event is processed, whatever notification routines were registered 
> are run. Very simple.
> 
> Why?
> 
> Because there's all sorts of stuff we need to watch for performance 
> reasons.

My first thought on reading this was it would be rather useful for
debugger watch-expressions.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Hold on while I slip into something a little more naked.


Re: [PATCH] File Spec

2003-09-02 Thread Michael G Schwern
Though I haven't been following this thread, it seems you're coming up
with some File::Spec-like thing for Parrot?

I'd recommend looking at Ken Williams' excellent Path::Class module
which gives you actual file and directory objects.  EXTREMELY useful when
you're in an ultra-cross platform environment such as Parrot.  I wish I
had them for MakeMaker instead of fucking around with File::Spec.  Consider
using Path::Class for inspiration rather than File::Spec.


On Mon, Sep 01, 2003 at 02:38:36PM +0300, Vladimir Lipskiy wrote:
> Leo wrote:
> > Albeit File::Spec is using catfile and catdir, I don't like the function
> > names ("cat file" is on *nix what "type file" is on Win*). Maybe
> > concat_pathname and concat_filename is better.
> 
> Yes, indeed. I'm for having concat_pathname only since this patch or
> the File::Spec module makes no difference when concatenates paths and
> files (though I can be mistaken on account of VMS, Dan? (~:). So catdir
> and catfile give the same result. Morever, catfile is sort of a wrapper
> around
> catdir and does nothing smarter than just calling catdir on all platforms.

On VMS catfile and catdir do very different things because VMS filepath
syntax distinguishs between files and directories explicitly.

Unix:
/dir1/dir2/dir3
/dir1/dir2/file

Windows:
\dir1\dir2\dir3
\dir1\dir2\file

VMS:
[dir1.dir2.dir3]
[dir1.dir2]file

So yes, you must distinguish between concatenating directories and files.

You also must worry about volumes.

Unix:
No user visible concept of a volume

Windows:
VOLUME:\dir1\dir2\file

VMS:
VOLUME:[dir1.dir2]file


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Operation Thrusting Peach


Re: [RFT] File Spec

2003-09-11 Thread Michael G Schwern
On Thu, Sep 11, 2003 at 10:23:27AM +0300, Vladimir Lipskiy wrote:
> Unix et al
> ==
> append_filename(".", "") = ""

Shouldn't that be "."?

> append_filename("a", "") = ""

"a"

> append_filename("a", "b") = "a/b"

What about

append_filename("", "b")  ?

Would that be an error?

Don't forget absolute paths

concat_dirnames("/foo", "/bar") = error?
concat_dirnames("foo", "/bar") = error?
concat_dirnames("/foo", "bar") = "/foo/bar"


>  MS Win32
> ==
> append_filename(".", "") = ""

"."

> append_filename("a", "") = ""

"a"?


What about volumes?

concat_dirnames("C:\foo", "bar") = "C:\foo\bar"
concat_dirnames("C:\foo", "C:\bar") = error?
concat_dirnames("foo", "C:\bar") = error?


>  VMS
> =
> 
> append_filename("", "") = ""
> append_filename(null, "") = ""
> append_filename("", null) = ""
> append_filename(null, null) = ""
> append_filename("[]", "") = ""

Ditto.

> append_filename("[a]", "") = ""

"[a]"

Same caveats about volumes.


>  Mac
> =

Is Parrot really targetting MacOS Classic?

PS  I'd forward this bit to [EMAIL PROTECTED]


> concat_dirnames("", "") = ""
> concat_dirnames(null, "") = ""
> concat_dirnames("", null) = ""
> concat_dirnames(null, null) = ""
> concat_dirnames(":", "") = ":"
> concat_dirnames("", ":") = ":"
> concat_dirnames(":", ":") = ":"
> concat_dirnames("a", "") = ":a"
> concat_dirnames("", "b") = ":b"
> concat_dirnames("a", ":") = ":a"
> concat_dirnames(":", "b") = ":b"
> concat_dirnames("a", "b") = ":a:b"
> concat_dirnames(":a:b", ":c") = ":a:b:c"
> 
> append_filename("", "") = ""
> append_filename(null, "") = ""
> append_filename("", null) = ""
> append_filename(null, null) = ""
> append_filename(":", "") = ""
> append_filename(":a", "") = ""
> append_filename(":a", "b") = ":a:b"
> 



-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
I do have a cause though.  It is obscenity.  I'm for it.
-- Tom Lehrer "Smut"


Re: [RFT] File Spec

2003-09-11 Thread Michael G Schwern
On Thu, Sep 11, 2003 at 01:17:29PM +0300, Vladimir Lipskiy wrote:
> > Shouldn't that be "."?
> > 
> > > append_filename("a", "") = ""
> > 
> > "a"
> 
> Umm. Don't think so. At least it will be that
> way until you convince me that it must be
> another way

concat_dirnames("a", "") = "a"
concat_dirnames("",  "b")= "b"

ergo

append_filename("a", "") = "a"

Why wouldn't appending no filename onto a directory result in the directory
being returned?  Unless append_filename() guarantees that it will always
return a filepath ending in a filename?


> > What about
> > 
> > append_filename("", "b")  ?
> > 
> > Would that be an error?
> 
> No. It's okay. I just forgot to mention that case.
> 
> append_filename("", "b") will produce "b"

Now wait a second.  append_filename("a", "") produces nothing but
append_filename("", "b") produces a filename?  Isn't that a little
inconsistent?


> > concat_dirnames("/foo", "/bar") = error?
> > concat_dirnames("foo", "/bar") = error?
> > concat_dirnames("/foo", "bar") = "/foo/bar"
> 
> I just want to remind you the Leo's words:
> 
> "Please keep in mind, that the intended usage inside Parrot just should
> be to locate some standard include or extension files for Parrot
> internals. More abstraction and complexity can always be added above
> that or implemented by HLLs." -- Him.(~:)
> 
> I don't suppose Leo will be pass in spoiled data.

Famous last words: "Our data is perfect, we don't need to check our inputs."


> > What about volumes?
> 
> I plan a special functions for volumes, and nodes,
> and root dirs like prepend_volume, prepend_node,
> prepend_rootdir.
> 
> For example, prepend_rootdir could throw the
> "prepend_rootdir is unsupported on this platform"
> exception on windows. Of course, I will go implement
> those if Parrot needs those.

Ok, but what happens when I pass filepaths with volumes attached to 
concat_dirnames?  What if the volumes don't match?  What if I'm adding a 
path with a volume to one without?


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Death?  Its like being on holiday with a group of Germans.


Re: [RFT] File Spec

2003-09-11 Thread Michael G Schwern
On Thu, Sep 11, 2003 at 08:36:02PM +0300, Vladimir Lipskiy wrote:
> > Famous last words: "Our data is perfect, we don't need to check our
> inputs."
> 
> Yes. Our data is perfect and we don't need to check our inputs if we
> play by rules. And the rules are:
> 
> Always use concat_dirnames to concatenate directory names
> Always use append_filename to append a file name to a path
> Always keep in mind that this tool gives you a proper result
> when you give it proper input, which is simple directory
> names, simple file names, and paths produced by this tool only.
> If you observe the rules, you won't get into a mess.

People make mistakes.  Perhaps you should produce some errors if a user 
strays outside these rules.  Garbage in, garbage out: Bad.  Garbage in, 
error out: Good.

I'll admit to not knowing the general error philosophy of Parrot ops.


> > Ok, but what happens when I pass filepaths with volumes attached to
> > concat_dirnames?
> 
> You get what you do, nonsense. Even File::Spec, a tool of a lot more
> higher level, doesn't protect you from such things.
> 
> D:\>perl -MFile::Spec::Functions -e "print catdir('C:\hh','C:\dd'), qq(\n)"
> C:\hh\C:\dd

Justifying your own tool's bad behavior using another tool's bad behavior
is not a terribly compelling design argument.  Just because File::Spec's
handling of volumes is historicly lousy doesn't mean yours has to be.


> >What if the volumes don't match?
> 
> Don't match against what? concat_dirnames doesn't do matching arguments
> against anything but PARROT_FS_DIRNAME_START and PARROT_FS_DIRNAME_END,
> which, for example, are '[' and ']' on VMS.

What if I feed you:

concat_dirnames("VOL1:[dir.dir]", "VOL2:[dir.dir]")

Well, I suppose that's simple, its an error since you can't usefully
concatenate two absolute directories.  Anyhow, the point is is an *error*.


> > What if I'm adding a path with a volume to one without?
> 
> Still. You get what you do. On Mac:
> 
> concat_dirnames('my disk:a', ':b') = ':my disk:a:b'

Mac's a special case since, IIRC, :b can either mean "The volume called b"
or "The file/directory in the current directory called b".  On VMS or
Windows no such ambiguity exists.

But I was unclear.  I meant the other way around.

concat_dirnames("b", ":my disk:a");

Trying to concatenate an absolute directory onto a relative one should
produce an error.


> File::Spec has an individual function for such purposes, catpath().
> We can't process more than two in-arguments in PASM, so we would take
> advantage of prepend_volume and things of such sort.

Unless I'm missing something, since the volumes and root dirs are already 
attached to the filepath string, you don't need more than two arguments.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
It's Ecstacy time!


Re: [RFT] File Spec

2003-09-13 Thread Michael G Schwern
On Fri, Sep 12, 2003 at 10:29:04AM +0300, Vladimir Lipskiy wrote:
> > People make mistakes.  Perhaps you should produce some errors if a user
> > strays outside these rules.  Garbage in, garbage out: Bad.  Garbage in,
> > error out: Good.
> 
> It really does that. I mean that it returns a "" when it suspects its
> arguments to be wrong.
> 
> > I'll admit to not knowing the general error philosophy of Parrot ops.
> 
> It could throw an internal exception, but ... I am not convinced we should
> switch to that sort of indicating errors. Though what kind of errors it
> ought to provide is a subject to be arguing about.

This does sound like something that should be covered by some sort of
"How should ops handle bad input" design document.  If there is such a
beast, do what it recommends.  If there isn't, there should be one.


> > What if I feed you:
> >
> > concat_dirnames("VOL1:[dir.dir]", "VOL2:[dir.dir]")
> >
> > Well, I suppose that's simple, its an error since you can't usefully
> > concatenate two absolute directories.  Anyhow, the point is is an *error*.
> 
> Yes, and since concat_dirnames() isn't supposed to concatenate anything
> but dirnames.

Are you saying:

concat_dirnames("C:\foo", "bar") == error?


> > But I was unclear.  I meant the other way around.
> >
> > concat_dirnames("b", ":my disk:a");
> >
> > Trying to concatenate an absolute directory onto a relative one should
> > produce an error.
> 
> What do you mean by "absolute directory"?

/foo
C:\foo
[foo]
VOL:[foo]
\foo

etc...

Which isn't clear from the example I gave above since ":mydisk:a" is
ambiguous on MacOS.

To be clearer:  concat_dirnames("b", "/foo") == error.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Here's hoping you don't harbor a death wish!


Re: [RFT] File Spec

2003-09-14 Thread Michael G Schwern
On Sat, Sep 13, 2003 at 09:55:48PM +0300, Vladimir Lipskiy wrote:
> > To be clearer:  concat_dirnames("b", "/foo") == error.
> 
> As long as concat_dirnames() will be taught to divine whether its arguments
> are absolute paths or relative paths, it could easily rotate its arguments
> so the above-mentioned call would become concat_dirnames("/foo", "b").

That would be really silly.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Quit looking, kids!  It'll EAT YOUR MIND!!
-- http://www.angryflower.com/fuck.gif


Re: How?

2003-10-27 Thread Michael G Schwern
On Mon, Oct 27, 2003 at 03:33:47AM +0200, Dmitry Nikolayev wrote:
> Hello
> How can I be involved in the project? Maybe, some help is needed?
> If you're interesting about me: http://buildbn.net/resume.html

http://www.parrotcode.org/ should have the basic information you need
to jump in.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/


Re: Darwin issues

2003-11-15 Thread Michael G Schwern
On Sat, Nov 15, 2003 at 10:29:41AM +0900, [EMAIL PROTECTED] wrote:
> btw:
> gcc (GCC) 3.1 20020420 (prerelease)
> Mac OS version 10.2.8 (iBook 800Mhz G3, 512MB RAM)

FWIW there's a newer gcc at connect.apple.com.  Look for the "August gcc
update" in Developer Tools.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
They had applied the blinders of steam-grilled hamburgers to my eyes.


Re: [perl #24655] Re:

2003-12-14 Thread Michael G Schwern
On Fri, Dec 12, 2003 at 11:22:33PM -0800, Monica Kemp wrote:
> # New Ticket Created by  "Monica Kemp" 
> # Please include the string:  [perl #24655]
> # in the subject line of all future correspondence about this issue. 
> # http://rt.perl.org:80/rt3/Ticket/Display.html?id=24655 >
> 
> 
> depict orchestrate singsong arthritis weller freest marty 
> restraint bookplate knowledge day panda wreckage beatific kleenex finesse indigenous 
> idiot venetian agglutinate lobster snuffer walsh barkeep autobiography 

The dolphins are in the jacuzzi.  The chair is against the wall.  The
owls are listening.  Wounds my heart with a monotonous languor.
SCUD missile militia South Africa Marxist Ft. Meade assassination
Croatian New World Order BATF ECHELON Kennedy FSF Lon Horiuchi Kenneth
Starr security


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
I sit on the floor and pick my nose
  and think of dirty things
Of deviant dwarfs who suck their toes
  and elves who drub their dings.
-- Frito Bugger, "Bored Of The Rings"


Re: Testing signal handlers

2004-01-28 Thread Michael G Schwern
On Tue, Jan 27, 2004 at 12:49:25PM -0500, Uri Guttman wrote:
> Test::* can't handle output from forked children

Yes, the problem is the child process can't inform the parent of how many
tests it ran.  The simplest way around this problem is to have the 
parent account for any tests run in the child by incrementing the test
counter manually.

use Test::More tests => 4;
my $builder = Test::More->builder;

pass 'some test in the parent';
if( fork ) {
# account for the one test run in the child.
$builder->current_test($builder->current_test + 1);
pass 'another test in the parent';
}
else {
pass 'a test in the child';
exit;
}

pass 'one last test in the parent';

It can also sometimes make things less complicated if you shut off test 
numbers ($builder->use_numbers(0)).


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
If it's stupid, but it works, it isn't stupid.


Re: OO inheritance in a hacker style

2004-02-04 Thread Michael G Schwern
On Wed, Feb 04, 2004 at 01:30:44AM -0500, Joseph Ryan wrote:
> >Whether it should actually be in the language is up for debate.  I'd say
> >that if you need to do this with any frequency whatsoever, you're not
> >thinking about roles right.  A good example might be in order... :-)
> 
> Well, what if the two classes you want to inherit from weren't
> designed with roles in mind?  For instance, there might be two
> CPAN modules that each have a dozen methods that you want to
> inherit, but they each have 1 that overlap whose conflict you
> want to easily resolve.

Same way you do it now.

package Foo;
use base qw(This That);

sub conflicting_inherited_method {
goto &{That->can("conflicting_inherited_method")};
}


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Cheating is often more efficient.
- Seven of Nine


Re: More perl5.005 problems

2004-06-14 Thread Michael G Schwern
On Mon, Jun 14, 2004 at 12:00:42PM -0400, Andy Dougherty wrote:
> For some reason I haven't been able to figure out, perl5.00503 can't seem
> to handle the TODO test in t/pmc/object-meths.t.  Here's the result of

5.5.3's Test::Harness doesn't know how to handle that style of TODO.
You'll have to make a dependency on T::H 2.x if you want to use TODO.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Funny thing about weekends when you're unemployed--they don't mean quite
so much.  'Cept you get to hang out with your workin' friends.
- Primus "Spaghetti Western"


Re: More perl5.005 problems

2004-07-08 Thread Michael G Schwern
On Mon, Jun 14, 2004 at 05:26:14PM -0400, Dan Sugalski wrote:
> At 4:39 PM -0400 6/14/04, Michael G Schwern wrote:
> >On Mon, Jun 14, 2004 at 12:00:42PM -0400, Andy Dougherty wrote:
> >> For some reason I haven't been able to figure out, perl5.00503 can't seem
> >> to handle the TODO test in t/pmc/object-meths.t.  Here's the result of
> >
> >5.5.3's Test::Harness doesn't know how to handle that style of TODO.
> >You'll have to make a dependency on T::H 2.x if you want to use TODO.
> 
> Is there another style of TODO that could be used here that would be 
> compatible with 5.005_03?

Yes, but its more trouble than its worth.

You have to do it by test number as part of the plan.  If your numbering 
changes (for example, you add a new test before the TODO test in the script) 
you have to renumber all the todo tests.

Test.pm can output this style, Test::More doesn't bother.

perldoc -m Test::Harness and look for "_deprecated" to see a full
explaination.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
11. Every old idea will be proposed again with a different name and
a different presentation, regardless of whether it works.
 -- RFC 1925


Re: More perl5.005 problems

2004-07-08 Thread Michael G Schwern
On Mon, Jun 14, 2004 at 02:49:35PM -0700, chromatic wrote:
> In fact, I'm surprised he managed to install an acceptably recent
> version of Test::Simple on 5.5.3 without upgrading Test::Harness; the
> bundle's required Test::Harness 2.03 for a couple of years now.

Parrot ships with Test::Simple/More/Builder along with Text::Balanced to
avoid users having to resolve module dependencies.

Simplest thing to do would be to just throw a recent Test::Harness in there.
t/harness has a 'use lib qw(lib)' in it so it should automatically pick it
up.

Patch attached.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Never underestimate the bandwidth of a mag tape on a bicycle.
-- Carl Friedberg in 
<[EMAIL PROTECTED]>


harness.patch.gz
Description: harness.patch.gz


Re: C89

2004-10-21 Thread Michael G Schwern
On Thu, Oct 21, 2004 at 02:51:15PM -0400, Dan Sugalski wrote:
> At 11:25 AM -0700 10/21/04, Bill Coffman wrote:
> >I read somewhere that the requirement for parrot code is that it
> >should be compliant with the ANSI C'89 standard.  Can someone point me
> >to a description of the C89 spec, so I can make sure my reg_alloc.c
> >patch is C89 compliant?
> 
> I don't think the ANSI C89 spec is freely available, though I may be 
> wrong. (Google didn't find it easily, but I don't always get along 
> well with Google) If the patch builds without warning with parrot's 
> standard switches then you should be OK. (ANSI C89 was the first big 
> rev of C after the original K&R C. If you've got the second edition 
> or later of the K&R C book, it uses the C89 spec)

Its available for the low, low price of $18.  Makes a great stocking stuffer.
Or frightening accessory this Halloween!
http://webstore.ansi.org/ansidocstore/product.asp?sku=INCITS%2FISO%2FIEC+9899%2D1999

(That's the C99 spec but it should be clear from it what was C89 and what's
been introduced with C99).


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Beef Coronary


Re: [perl #32245] [BUG] Makefile $(TOUCH), doesn't

2004-10-31 Thread Michael G Schwern
On Sun, Oct 31, 2004 at 12:33:53PM -0800, Jeff Clites wrote:
> The Makefile uses this in place of the 'touch' command:
> 
>   perl -e 'open(A,qq{>>$_}) or die foreach @ARGV'
> 
> On Mac OS X at least, this doesn't result in updating the timestamp of 
> the passed-in files. (Also, by my reading of the POSIX/SUSv3 spec, this 
> is correct behavior--open() isn't supposed to update the timestamp of 
> an existing file.)
> 
> I wonder if this works on any platform--maybe Win32?
> 
> I suggest that the value of TOUCH be configurable, defaulting to the 
> 'touch' command on Unix-like systems--not sure what to use for other 
> systems. Or we could try this, which might work for all systems:

ExtUtils::Command provides tested cross-platform versions of the most 
common shell functions.  These should be used.

For example:

perl -"MExtUtils::Command" -e touch


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
IIRC someone observed that they couldn't name identifiers in Ethiopian, 
because there was an Ethiopian character similar in function to _ which 
wasn't in \w
-- Nicholas Clark demonstrates that the Internet works
   in <[EMAIL PROTECTED]>


Re: Inconsistent opcode names

2004-11-21 Thread Michael G Schwern
On Sat, Nov 20, 2004 at 08:06:33PM -0500, William Coleda wrote:
> Is there a reason why we have "find_type", but "loadlib"; "eq_str" but 
> "isnull" ?

I was just reading something blasting PHP for not being consistent about
core naming conventions particularly about "this_that" vs "thisthat".
FWIW.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
You're more radiant than a memory of breathtaking ecstasy.


Re: [off topic] an amusing side note

2004-11-24 Thread Michael G Schwern
On Wed, Nov 24, 2004 at 06:30:29PM -0500, Felix Gallo wrote:
> 2.  "perl 6 is a lot cleaner than perl 5".  It's also much, much
> larger than an already very large language.  I've been programming
> and evangelizing Perl in organizations small and gigantic since
> 4.03x, and my eyes just glaze over at all the unnecessarily
> surfaced complexity bound to make reading other people's programs
> finally, at last, literally impossible:
> 
> http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html
> 
> I'm not going to use perl 6.

Now, think about what a similar table would look like for Perl 5.  How
different would it be?  For extra credit, make one.

As an exercise, go through those operators and remove all that are already in
Perl 5 (such as cmp), or have an equivalent in Perl 5 (such as ?&), or are a 
simple expansion of an operator (such as ?&=).

Another exercise, eliminate operators for operations you don't already do
much of in Perl 5 (such as bitwise operations).

For extra credit, note which operators are just altered versions of Perl 5
operators (such as +&).

For extra credit, make another list from that of those new operators which 
replace existing common idioms in Perl 5 (such as hyperoperators) and make
them easier.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
The method employed I would gladly explain,
  While I have it so clear in my head,
If I had but the time and you had but the brain--
  But much yet remains to be said.
-- "Hunting of the Snark", Lewis Carroll


Re: svn

2004-12-08 Thread Michael G Schwern
On Wed, Dec 08, 2004 at 10:16:21PM -0500, Matt Fowles wrote:
> While I personally like the idea, I think it is unlikely given how
> much slower svn is on sizable repositories.  Of course I have not
> tried it recently, so maybe that has changed...

If you wish to try out a recent Subversion on some sizable source
there's a mirror of the maint and bleadperl Perforce repositories here.
http://svn.clkao.org/svnweb/perl

You can pull them out using
svn://svn.clkao.org/perl

Subversion has improved a lot.  I'm using it now.  If you do try it I
recommend going straight to 1.1.1 and using fsfs based repositories.

Keep in mind that SVN is slower on checkouts than CVS.  However diff is
a purely local operation.  And if you're using something like SVK network
traffic isn't much of an issue after all after the initial mirror.


-- 
Michael G Schwern[EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Now we come to that part of the email you've all been waiting for--the end.


  1   2   >