-
Notifications
You must be signed in to change notification settings - Fork 579
[5.6.2-to-be] PerlIO is EVIL #4165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From [email protected]#!perl -w open F, "$^X -wle 'binmode STDOUT; print q()' |" or die; is silent on usual perl, and warns "255" on 5.6.2-to-be. No, I have The *actual* problem is that char-by-char input requires DUPLICATE pressing pp_getc() calls is_eof() which does getc/ungetc [BTW, I see no logic in this sequence of events.] The problem is that ungetc() can't unget "\n" if this \n is the first char if (ch == '\n') Tracing through perlio.c shows how much EVIL it is. All 80K of it. I In the example of Term::ReadKey, CRTL *knows* that TTYs should be opened This code *duplicates* the work already done in the CRTL, thus lead to The task of CRNL translation is very quick and easy - with a proper [It is also very efficient to report only the part until this buffer as I do not even want to mention that in many cases all Perl needs is a I do not think that PerlIO is ready for 5.6.2. Hope this helps, Flags: Site configuration information for perl v5.7.1: Configured by vera at Mon Jun 25 01:33:44 PDT 2001. Summary of my perl5 (revision 5.0 version 7 subversion 17) configuration: Locally applied patches: @INC for perl v5.7.1: Environment for perl v5.7.1: |
From [Unknown Contact. See original ticket]Message RFC822: Nick,
yes, I see that, and I meant that a slot will be marked further by someone PerlIO_push(aTHX_ ptr2,self,mode,PerlIOArg); Here works a rule that no-one should dare to break: if "PerlIO_allocate" is Anyway, I can live with that while things are working properly. Just a question - why not to use normal standard perlish way of allocating Best wishes, |
From [Unknown Contact. See original ticket]Obviously, doing CRLF in Perl when CRTL supports it already is not a And the current state of FD should have been queried when PerlIO is Ilya |
From @jhiIlya, the PerlIO subsystem has been in open and public development for |
From [Unknown Contact. See original ticket]Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
It is legacy scheme - for systems where we cannot snoop the buffer
If the handle is in text mode then '\n' should have come from a CRLF pair,
All the handles should be binary() at the OS level. The reason for crlf If OS2's CRLF logic is solid an efficent then it may make sense to
So get Term::ReadKey to tell PerlIO it should be binary.
That is NOT the intent. The intent is that crlf layer is used when:
The main pain is getting tell() and seek() to work right.
I agree it is "impossible" - but there is a _need_. If the handle was in
Patches welcome. I wrote the CRLF layer very quickly.
PerlIO does _NOT_ insist on copying - that is exactly the sort of thing
|
From [Unknown Contact. See original ticket]
That is not the reason. The reason is to get the function/macro calls out of the
Patches welcome. |
From [Unknown Contact. See original ticket]Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
Try stepping through Borland C CRTL version and see if you still agree...
Querying the state needs Configure-oid probing to see how the CRTL flags
|
From [Unknown Contact. See original ticket]
(speaking of layers in general) I want to add that things became worse: I can't report a bug in the Borland CRT anymore :( And that bug makes perl compiled by Borland not to pass test suite ... Best wishes, |
From @jhiOn Fri, Jul 06, 2001 at 02:58:31PM +0200, Konovalov, Vadim Vladimirovich (Vadim) wrote:
That's insane if that means they will not even accept bug reports. (I could understand charging if there were a *support contract* of some Send bug reports from one-time anonymous hotmail accounts? :-)
|
From [Unknown Contact. See original ticket]
Sorry, I can't see any loops there: SSize_t Anyway, that tiny snippet of code is not essential, so it does not worth much debating...
Okay. Inline Patch--- d:\WORK\PerlCompile\perl@11148-orig\perlio.c Sat Jun 30 22:41:57 2001
+++ d:\WORK\PerlCompile\perl@11148\perlio.c Fri Jul 6 17:07:24 2001
@@ -2278,14 +2278,13 @@
SSize_t got = 0;
if (count == 1)
{
- STDCHAR *buf = (STDCHAR *) vbuf;
/* Perl is expecting PerlIO_getc() to fill the buffer
* Linux's stdio does not do that for fread()
*/
int ch = PerlSIO_fgetc(s);
if (ch != EOF)
{
- *buf = ch;
+ *((STDCHAR *)vbuf) = ch;
got = 1;
}
}
Best wishes, |
From @doughera88On Fri, 6 Jul 2001, Konovalov, Vadim Vladimirovich (Vadim) wrote:
So? What's wrong with being less verbose? Clarity counts too,
[ patch snipped ] This is rather pointless since any decent optimizer ought to do the same If you think the changed code is somehow "cleaner", that's fine and not |
From [Unknown Contact. See original ticket]
agreed, and that's why I did not suggested that patch earlier. Precisely, I thought that compiler should optimize that stuff away, and that is why I did not included this (?:pseudo-)?optimization patch into my 11079 one.
It is obvious that perlio.c is written in a different style that other perl itself, and one could argue whether this is good or bad. Best wishes, |
From [Unknown Contact. See original ticket]Vadim Vladimirovich Konovalov <vkonovalov@lucent.com> writes:
But s is used in both branches of the if - so factoring it out saves code Sorry this is my style, it isn't completely pointless - having "loads"
Does that actually change the generated code at all?
|
From [Unknown Contact. See original ticket]
... but "buf" is never used except inside "if" condition, so it'll be faster
Nick, I really appreciate your perl/Tk work and am sure about high quality
mmm... I suggested not that much patches, so I have a feeling that I joke, forget this. Being serious, I have a feeling that all compilers must be able to do lvalue Really warmest wishes, |
From [Unknown Contact. See original ticket]On Fri, Jul 06, 2001 at 01:39:10PM +0100, Nick Ing-Simmons wrote:
We *can* snoop the buffer with PerlIO (and without it too in my setup).
Absolutely not. It can com from CRLF or from a lone LF.
This is unacceptable if the CRTL level CRLF handling is 10x as
Agreed...
You propose to duplicate the CRTL's knowledge of the system's
This is just plain impossible without an enormous overhead of marking A reasonable target is to make tell() work on the results of seek(). Ilya |
From [Unknown Contact. See original ticket]On Fri, Jul 06, 2001 at 01:46:05PM +0100, Nick Ing-Simmons wrote:
No need to Configure. There is win32ish.h etc.
Existence of non-reliable CRTLs should not make it not work anywhere. Ilya |
From [Unknown Contact. See original ticket]Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
It is Configure-oid - because Borland, VC++ and Mingw32 all have different
Agreed.
|
From [Unknown Contact. See original ticket]On Mon, Jul 09, 2001 at 09:10:14AM +0100, Nick Ing-Simmons wrote:
For two macros: get-state/set-state? Since set-state is already Even if no #ifdef nest already exists, it is trivial to add. It is Ilya |
@chorny - Status changed from 'open' to 'stalled' |
From @doyDoes anything still need to be done here? I don't know if PerlIO has -doy |
The RT System itself - Status changed from 'stalled' to 'open' |
From @jkeenanNo response in over two months to doy's request for feedback. Closing ticket. Thank you very much. |
From [Unknown Contact. See original ticket]No response in over two months to doy's request for feedback. Closing ticket. Thank you very much. |
@jkeenan - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#7220 (status was 'rejected')
Searchable as RT7220$
The text was updated successfully, but these errors were encountered: