develooper Front page | perl.perl5.porters | Postings from January 2010

Re: warding against bytes.pm

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
January 17, 2010 08:08
Subject:
Re: warding against bytes.pm
Message ID:
20100117160237.GA21536@klangraum.plasmasturm.org
* Marc Lehmann <schmorp@schmorp.de> [2010-01-17 15:05]:
> If perl would be fixed to use pre-5.6 semantics for "char *",
> all those "buggy XS modules" would magically *just work*.
>
> XS subs needing to take advantage of higher codepoints already
> need to use "SV *" and SvPVutf8*.
>
> This change to the "char *" semantics in 5.6 basiclaly broke
> all of cpan that involved xs and char * stuff, basically
> requirign all those modules to add many additional lines of
> code to achieve the same as under 5.005 and earlier.
>
> I think calling that xs code buggy is not goal-oriented. perl
> should be fixed to make sense instead.

Sure.

I didn’t know the implementation specifics of the problem. All
I know is that quite often I an explicit downgrade is necessary
to make XSUBs work, which means there is a bug – somewhere. For
the purposes of saying “you need utf8::downgrade as a workaround
sometimes”, it doesn’t matter *whose* bug it is. I wasn’t going
to make any claims about a subject where I am clueless.

Your argument about fixing `char *` sounds reasonable to me (as
indeed pretty much all of your arguments sound to me, as far as
the technical side is concerned). However, not every string can
be downgraded, so perl would then have to throw an exception when
trying to invoke an XSUB that uses `char *` when called with
a non-downgradeable string. Is that a good idea?

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About