This Week on p5p 2001/07/30

Notes

This Week on P5P

Hash "clamping"

P5P Meeting

Asynchronous Callbacks

h2ph

iThreads

Please send corrections and additions to perl-thisweek-YYYYMM@simon-cozens.org where YYYYMM is the current year and month. Changes and additions to the perl5-porters biographies are particularly welcome.

Again this is a somewhat abridged summary this week, since I’m still on the road, but also because last week was the Perl conference and so there was very little activity.

Hash “clamping”

The discussion of Jeffrey Friedl’s idea of hash “clamping” - that is, disallowing new hash key creation - rolled on. Nick encouraged Jeffrey to make use of the HV’s existing readonly bit to signal “clampedness” instead of using up another flag bit, but Jeffrey disagreed that this makes semantic sense: readonlyness would refer to the values as well as the keys. Abigail took a more holistic view:

I think this is yet another example of “there’s something wrong/missing in Perl, let’s fix it with a kludge”.

The real underlaying problems here are 1) Perl doesn’t have structs, but more importantly, 2) Perl only gives you one instance variable per object. Pseudo-hashes tried to fix the symptoms, not the cause and they didn’t succeed. “clamp” tries to fix the symptoms too - and not the cause.

The problem isn’t really that you can make typos with hashkeys, the problem is that you’re almost forced to use hashes in cases you really wanted something else, but the best alternative Perl gives you are hashes.

While I agree such a “clamp” function feels better than pseudo-hashes, I feel less than thrilled by the idea explaining the reasoning about “clamp” to my students - or collegeas for that matter.

He also disagreed (as did I) with the idea that something like this, which can be done with a simple tie, should require a change in the language. I proposed Tie::SecureHash which does what was requested but without the speed of a core hack.

P5P Meeting

At TPC, a motley crew of developers got together to discuss the state of Perl development and raise issues of interest. Jarkko started the ball rolling by talking about development. He outlined some of the new things and also some of the deprecations in 5.7.x, which you should all probably know if you’ve been following these summaries; he also outlined things that had been put off for the future so that he wouldn’t have to care too much about them: Artur’s ithreads work, bignum, Unicode, and Inline. He mentioned that a hopeful timetable for 5.8.0 would be around three months. After that, Hugo would take the helm for 5.9.0, which would include a cleanup of the regexp engine plus a phased shift towards 6.0 features.

(Jarkko’s slides can be found at http://www.iki.fi/jhi/osc2001/)

At this point, Damian mentioned that we might be producing versions too fast for companies to adequately support - many companies will skip 5.6.0 and go to 5.8 if it’s stable. Randy Ray explained how RedHat’s product adoption works.

Sarathy came up and talk about 5.6, saying that he wouldn’t do much maintainance other than integrating minor patches from 5.8. He also once again appealed for a new pumpking.

Nat and Dan talked about Perl 6, and again outlined a lot of things that should be familiar; I’ll try and make sure these are covered in the Perl 6 digest.

Hugo explained the regex changes that were needed, including rewriting the regex engine to use an optree much like (but separate to) Perl’s own optree, rather than the current bytecode “oplist”. This would allow for more aggressive but at the same time conceptually simpler optimization. Dan suggested that this should be done as a module to give it a trial run, then moved to core if it works. Hugo also said that he and MJD have been trying to remove the recursion in the regular expression engine.

Jeff Pinyan then talked about some work he’d been doing with Jeff Friedl, particularly new syntax for character class arithmetic (“alphabetic characters minus vowels” and so on) and syntax for named captures. Larry had, of course, been through this: he announced the character class arithmetic syntax in Perl 6, and said that the deeper problem with named captures is that people really wanted regular expressions to return complex data structures. MJD also pointed out that overloading qr could do a lot of what the Jeffs wanted, including reversable regular expressions.

I spoke briefly about Unicode and the compiler, but pre-empted myself since both topics were covered in my TPC tutorials. Jeff Okamoto enthused about IPv6; the discussion continued throughout the week and is too verbose to explain here.

Finally, there was a long discussion about the standard module set and SDKs. Most people agreed that an SDK was required, but opinions differed on how to make one “official” and how to ensure that the user installs what they need. Larry’s proposal for Perl 6 was that the standard library was so small as to be almost useless on its own, forcing people to go get what they need from CPAN.

Huge thanks to Ziggy for taking notes.

Asynchronous Callbacks

Remember the discussion about asynchronous callbacks way back when? Well, David Lloyd has come back with a solution Async::Callback. Nice one, David.

He notes that it’s not re-entrant unless you link Perl with -lpthread, but it’s pretty fast.

h2ph

Kurt Starsinic rocks! He wrote a fantastic little test for h2ph which compares the constants provided by the Socket and POSIX extensions with their values from the .h files as generated by h2ph. This uncovered a load of bugs in h2ph, as well as one in Scalar::Utils::dualvar. Kurt also fixed these bugs. Oh, and made hex constants appear as numbers when used in a numeric context and strings of bytes when used as strings. What more could you ask for?

iThreads

Artur Bergman announced the release of some of his new threading modules, threads, threads::shared and threads::queue to CPAN. Great work, Artur!

Various

Phillip Newton continued his clean-up work of typoes and POD errors in the documentation, and Ilya dropped in a bunch of patches mainly to help tidy up the build process. One of the patches which was particularly handy allowed

    make OPTIMIZE=-g perl

to simply rebuild perl with debugging.

If you ever thought pseudohashes were useful, Autrijus Tang demonstrated that they were even slower than tying and overloading.

Will Sanchez produced another clutch of Darwin patches - thanks, Will! I tried a patch to turn off optimization and constant folding but was quickly convinced these are two separate areas. Look for a new one coming next week…

There was another report about how $a and $b aren’t picked up by the strict pragma. I have despatched the hellhounds.

Until next week I remain, your humble and obedient servant,


Simon Cozens

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub