develooper Front page | perl.perl5.porters | Postings from May 2008

Re: on the almost impossibility to write correct XS modules

Glenn Linderman
May 21, 2008 18:08
Re: on the almost impossibility to write correct XS modules
Message ID:
On approximately 5/21/2008 2:21 PM, came the following characters from 
the keyboard of Juerd Waalboer:
> Glenn Linderman skribis 2008-05-21 10:17 (-0700):
>> So where are the places where perl string operations need bytes?  O (of 
>> I/O) springs to mind.
> Everything involving system calls or C level calls that aren't
> specifically wrapped to deal with Unicode.

Yes, of course.  That is one of the things that started this discussion.

>> So if it is cheap to add a flag to prevent upgrades, and produce errors 
>> or warnings at the point of upgrade attempts, maybe that is OK, but 
>> correct code wouldn't need the checks, as far as I can see.
> I agree that correct code wouldn't need the checks. That is: if an API
> is correctly designed. However, if the API is already set in stone,
> giving this single bit of metadata to a string can really help to
> improve existing modules.

Not sure what you mean here... if the API is set in stone, then how can 
the module be improved?  Internal checks on the bit?  But that could 
change the semantics of the API without changing the interface of the 
API -- not clear that is helpful... just make a new parallel API if you 
need to handle both binary and text data.

Glenn --
A protocol is complete when there is nothing left to remove.
-- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About