develooper Front page | perl.perl5.porters | Postings from December 2019

Re: Why is perl removing an OS feature?

Thread Previous | Thread Next
From:
L A Walsh
Date:
December 11, 2019 10:11
Subject:
Re: Why is perl removing an OS feature?
Message ID:
5DF0BC99.4090807@tlinx.org
On 2019/10/24 17:32, L A Walsh wrote:
>
>
> On 2019/10/24 13:44, Tony Cook wrote:
>   
>>>  
>>>     
>>>       
>> While it might be desirable that sysread() and syswrite() work in
>> bytes, changing the behavior silently would be Bad.
>>     
====
       Au contraire.  The sysread and syswrite calls are documented to be
wrappers around the system read and write calls.  The system read and 
write calls
have NEVER worked in Unicode and have always worked in bytes.

    It was part of the documentation that was in error saying it was in
unicode bytes.  What I'm saying is that there would be no silent change 
of behavior
unless you can demonstrate where the system calls pay attention to the
encoding based on some Unicode setting. 

    The unicode settings are above the system i/o calls -- and what I 
was trying
to suggest is that the sysread/write calls should do like the system 
read/write
calls do and ignore any UTF-8 settings on such file handles.

    Changing sysread/syswrite because the documentation was broken and self-
inconsistent is a gratuious breakage of compatibility -- because the sys 
calls
that wrap the system calls have never spoken anything other than bytes.


>> I suggested adding a feature to make sysread/syswrite work in bytes
>> (which the user explicitly opts into), but response was underwhelming
>> to negative.
>>
>> https://github.com/Perl/perl5/issues/16732
>>     
----
    This would be bad, as it implies that they aren't already in bytes.
They are documented to be wrappers for the system calls which only speak
in bytes -- so that would already be the case.

    I am pretty sure that I asked for an example where code
written with the 'write(2) or read(2) system call was expecting it to 
understand
anything other than bytes.

    Just because someone wrote documentation saying they wanted it to be so
doesn't mean the documentation reflected the code or that it ever worked 
that
way.

    No it is not too late to rescind the deprecation, because the 
sysread/write
calls have always ignore those flags as do the system read/write calls.


> ----
>     sysread and syswrite are supposed to be maps to the OS read & write
> calls.
> The OS calls only work in bytes.  If the sysread/syswrite calls didn't
> map to the OS
> calls correctly, then that was a bug.
>
> I can't see how anyone would be against the calls in perl that are
> suppose to map to the system
> read/write calls, would do anything different.
>
> As it stands now, how do they *not* work in bytes already? 
>
> If that is the case how is this not a gratuitous breakage?
>
>
>
>
>   
>> Tony
>>   
>>     

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