develooper Front page | perl.perl5.porters | Postings from October 2017

Re: source encoding

Thread Previous | Thread Next
October 25, 2017 23:49
Re: source encoding
Message ID:
Father Chrysostomos wrote:
>Currently source filters are applied based on line boundaries, not on
>lexical scope

Yes, but source filters are an abomination in the sight of Larry.

>I suspect that changing the default will cause too much breakage and
>be deemed unacceptable.

That might be so.  It's a case of not being able to make an omelette
without breaking some eggs, so we have to decide which eggs we're
willing to break.  I'm the wrong person to judge that.  I'm willing
to break programs that use literal UTF-8 bytes in Latin-1 source mode
(your suggested use case), but that's easy for me to say, because I
don't have any of those eggs.

All of my eggs, being written in pure ASCII, would be totally untouched
by my proposal.  I'd surely gripe at a source encoding proposal that
did affect that class of program.  The benefit to me, too, is all on the
side of having a coherent language to maintain.  I have no intention of
actually venturing beyond the confines of ASCII in my source, regardless
of how good the Unicode support gets.

>                         If so, then we could make 'use utf8' act like
>a source filter.

That would still require a deprecation.  Surely someone is relying on
the lexical scoping.  Especially among the people who fetishise having
the source code *look* right, from a naive point of view.  Someone who
puts UTF-8 bytes into a string literal in Latin-1 mode, to get an encoded
byte string from literal characters, might well locally switch to UTF-8
mode, to make the same correct-looking bytes of source code yield a
character string.

>What about on EBCDIC systems?

On an EBCDIC build, the fixed encoding would have to be UTF-EBCDIC.
Much as I'd love to deprecate EBCDIC builds and get rid of that porting
nightmare, that would be well outside the scope of my source encoding


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About