Re: using weak refs and requiring 5.6

Dave Rolsky <[email protected]>
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
On Sun, 10 Oct 2004, Jonathan Swartz wrote:

> * Is Scalar::Util::weaken() stable and performant enough to use more
> extensively in Mason? The docs for Perl 5.6.0 say that weak references
> are still experimental, but I never found a corresponding doc to say
> that they are now stable. Does the stability vary depending on Perl
> version? And I saw this performance patch against 5.8 -
> http://aspn.activestate.com/ASPN/Mail/Message/perl5-porters/1506613
> which I didn't really understand but worried me.

I doubt they'll ever leave the core, since they're used by a number of
CPAN modules, and are the regularly recommended solution for circular
reference problems.  The patch in the message you pointed at must be in
core now, because with 5.8.4 the code that took 55 seconds for the poster
takes 0.349 seconds for me.

Stability-wise I've not seen many bug reports for them on p5p, but I
really have no idea how well they work for 5.6.1.  OTOH, we already use
them in Mason, and we've never had a bug report from someone using 5.6.1+
regarding a crash that seemed at all related to using it, so I suspect
it's a non-issue.

> * I remembered vaguely discussing that we're going to require 5.6
> starting with Mason 1.3, so Scalar::Util::weaken should be available
> everywhere, right? Should we require 5.6.0 or 5.6.1? I know that the
> former is problematic and unstable, but lots of default setups still use
> it. I don't want to leave them out in the cold unless we feel it'll be
> especially unstable in conjunction with Mason and weakrefs.

We should require 5.6.1.  5.6.0 is so busted.  I don't know of many modern
OS/distros that use 5.6.0 these days.  In fact, I'd expect Mason not to
work with 5.6.0 as it is, because Params::Validate, Devel::StackTrace, and
I think maybe other modules used by Mason all have problems under 5.6.0.

Scalar::Util went into the core with 5.8.0, but weaken works with 5.6.1.
The only problem we're likely to run into is that Scalar::Util will
install a pure Perl version of itself on systems without a compiler.  The
Perl version doesn't support weaken().  So we'll want to detect this at
install time _and_ run time.

Probably this'll only affect Win32 users, who are mostly using PPMs.
Randy Kobes' PPM archive already includes Mason and Scalar::Util.  We
should double check with him that this is the XS version, but I bet it is.

Since using this archive is by far the best way to install Mason on Win32,
I think Win32 users should be able to get Mason running without too much
trouble.


-dave

/*===========================
VegGuide.Org
Your guide to all that's veg.
===========================*/


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.