develooper Front page | perl.perl5.porters | Postings from April 2000

Re: [ID 20000403.009] uninitialised concatenation???

From:
byron
Date:
April 4, 2000 15:55
Subject:
Re: [ID 20000403.009] uninitialised concatenation???
Message ID:
200004042257.PAA15528@thrush.omix.com
To: perl5-porters@perl.org
From: Zenin <zenin@bawdycaste.org>
Subject: Re: [ID 20000403.009] uninitialised concatenation???
X-Newsgroups: perl.porters-gw
In-Reply-To: <4.3.0.20000404101328.018e1d30@24.8.96.48> <2104.954859198@chthon>
Organization: Zenin's Rocky Horror Archive
User-Agent: tin/pre-1.4-19990413 ("Endemoniada") (UNIX) (FreeBSD/3.2-STABLE (i386))

In message <2104.954859198@chthon> Tom Christiansen <tchrist@chthon.perl.com> wrote:
	>snip<
:>Then we need to either:
:>A) Post in big bold letters someplace that internal optimizations may make
:>the errors they get at runtime a little odd
:>or
:>B) Attach enough hint info to the optree to emit errors correct for the 
:>original program text
:>A's easier, B's better but more expensive both in compile time and porter 
:>time. If the optimizer gets seriously attacked, though, it might be worth it.
: 
: There are many many cases of this that could be "attacked". Essentially,
: what people are suddenly expecting is that the compiler insert complete
: source code information during compilation so that during run time, the
: interpreter can say things.  Kind of like cc -g.  This is potentially
: prohibitively expensive, though, as you point out.  It's not like all cc
: compiles run with -g, and for good reason.

	How about adding a -g option to perl to do just that?

: Choice 1: Remove the warning and many others.

	I'd prefer not to remove it myself.  It's rare except in small
	programs that I've used uninitialized values where it wasn't an
	indication of a bug in my code someplace.

: Choice 2: Educate the users.  This is inevitable.  Things just are not
: what they were.  This is a compiler.  That's what compilers do.  Ever
: tried debugging highly optimized code from a DEC compiler?  Whew!

	Agreed.  Every compiler has its quirks.  Hell, javac even has a page
	(part of the FAQ?) that details nearly every error message and what
	it *really* means.  Perhaps perl needs something similar?

: Choice 3: Redesign the compiler and interpreter to store and access
: complete source code.
: 
: The bigger issue, if you're going to be bloating the optree with full
: source information, is to deal with
:     $x + $y
: and not knowing which variable was wicked.  It doesn't say
:     Undefined value in lexical $x defined at line 23 of Foo.pm
:     Undefined value in global $Foo::y at line 23 of Foo.pm

	Which would be nice, at least via a switch (-g or something). 
	Probably too much work for the result however.  I'd prefer to see
	threads happier then warning messages, for instance.

-- 
-Zenin (zenin@archive.rhps.org)     "Hey, are you one of those Linux coders?"
                                    "Nyet.  Linux coder in next office."
                                    "Good man.  Ignore the screams."
                                          --www.userfriendly.org



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