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

Re: [ID 20000403.009] uninitialised concatenation???

April 4, 2000 15:55
Re: [ID 20000403.009] uninitialised concatenation???
Message ID:
From: Zenin <>
Subject: Re: [ID 20000403.009] uninitialised concatenation???
X-Newsgroups: perl.porters-gw
In-Reply-To: <> <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 <> wrote:
:>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
:>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
:     Undefined value in global $Foo::y at line 23 of

	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 (     "Hey, are you one of those Linux coders?"
                                    "Nyet.  Linux coder in next office."
                                    "Good man.  Ignore the screams."
                                 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About