THE RANT /
THE SCHPLOG
Schmorp's POD Blog a.k.a. THE RANT
a.k.a. the blog that cannot decide on a name

This document was published 2015-06-06 03:09:59, and since then has not been materially modified.

A Stable Perl

Here it finally is, stableperl, an attempt to restore perl stability and compatibility to the level mentioned in the official perl policy.

I will write about the sadder sides of this at some future time, but now it's time to write about the good sides.

What it is

First of all, stableperl is a branch (or a fork, depending on how you want to view it) of standard perl, designed to be drop-in compatible with standard perl, and/or maintained beyond it's normal end-of-life date.

The fact that it is a drop-in replacement is very important - this way, you can install stableperl instead of perl, and still use all of CPAN in the same way as before, in addition to modules written for stableperl.

It is also an attempt to fix some of the more obvious bugs that affect many programs and which the perl 5 porters refuse to fix, foremost hash performance and data corruption during global destruction.

Lastly, and most theoretically, it is a safeguard against perl 5 porters breaking perl 5 to the point where it is no longer usable - when or if that happens, stableperl can be use to achieve independence.

What it isn't

It is also something that for a long time didn't want to do, but reality left me without an alternative, so that means activity will be fairly low, mostly limited to the most important fixes.

That means it will not have any exciting new features - the emphasis is purely on being compatible to standard perl, and some extra.

That also means that I will not apply any exciting patches that will make stableperl incompatible with standard perl.

Stableperl and my modules

I have written more about the relationship of my modules in the FAQ.

Releases

You can find all releases on http://stableperl.schmorp.de/dist/, including the README, which lists any minor changes not mentioned here.

stableperl-5.22.0-1.001

This is the first ever release of stableperl. It has only a few changes, but these already allowed me to get Coro and some other modules working, something that would have been doubtful with standard perl.

So what are the major differences to perl 5.22.0?

Some troubling patches have been reverted.

Two changes in Perl that prohibit modifying some public perl structures (EXT_MGVTBL and PadlistNAMES). Coro needs to access a lot of the more arcane details of perl, and is very difficult to get working without access to these structures.

These changes are trivial to undo in perl, and very hard to work around from within Coro.

The result should still be 100% compatible to existing (and future) XS code.

The hashing function has been replaced by FNV-1A.

This was an attempt to restore hash performance which was gradually lost mostly due to security patches that turned out to be snake oil without any

In preliminary benchmarking, this gave a 40% performance increase in hash-access-heavy code, which sounds enormous (and certainly is), but sadly is hardly better than perl 5.008 levels.

FNV-1A isn't the best hashing algorithm (and not suited well the way it is used in perl), but it beats the existing one and was very simple to implement.

But hey, PHP also uses FNV-1A somewhere, so expect further improvements in the future.

Unconditional addition of -fstack-protect flag(s) was undone.

Configure unconditionally added these flag to the compiler invocation, ignoring the flags specified by the user, with no way of overriding it. While this flag might be nice to have in theory, it does create probably problems on some less common platforms, where GCC might accept the switch but it might not work.

And that's it for 1.001.