Front page | perl.perl6.language |
Postings from January 2001
Re: JWZ on s/Java/Perl/
From: Dan Sugalski
January 29, 2001 10:56
Re: JWZ on s/Java/Perl/
Message ID: email@example.com
At 12:20 PM 1/29/2001 -0500, Jeanna FOx wrote:
>David Mitchell wrote:
> > Jeanna FOx <Jeanna@vulpes.com> wrote:
> > > Everybody seems to be missing the fact that jwz bitching about Java's
> > > "32 bit non-object ints" means that at least he thinks they could be
> > > salvaged. What would he think of Perl's "224 bit non-object ints"?!
> > > Don't get smug because Perl can iterate over an array of anything. The
> > > price we pay is incredibly expensive.
> > Perl6's vtable implementation of scalars and arrays etc should
> > allow lightwight arrays of integers (eg 32 bits) which still appear
> > to the rest of Perl (and the programmer) to be arrays of full-blown SVs.
>Doubtful. It looks like we're still going to have a relatively
>heavy-weight SV (sometimes called a PMC for Perl Magic Cookie). This
>is currently 3 words in Perl 5 and it ain't shrinking for Perl 6.
The smallest value-carrying SV's actually 4 words in perl 5, not that it's
that big a difference. It's definitely not shrinking for perl 6, though,
and it'll probably be a bit bigger. Not as much as you might think, since
SVs generally hide lots of size off in other areas. (Plain integers are the
size of an SV plus 4 bytes, but 'real' scalars are somewhat larger)
Regardless, it's actually not that big a deal--most of the memory usage
you'll see is tied up in hashes and arrays, not in bare scalars.
I don't think that was jwz's big issue with Java ints--my reading made it
more of a problem with their non-objectness rather than their size. Our
ints are, for all intents and purposes, objects, or that's the plan at
least for perl 6. I doubt he'd complain about that in perl anyway, as
we're not really putting ourselves forward as a pure OO language the way
that Java is. (I'm sure he's a wide range of other problems with perl, but
I'd bet that's not one of 'em... :)
>while it's true that Perl 6 will get "lighter and faster", it doesn't
>come close to what jwz thinks of as "light and fast". He's expecting 32
>bits per int *total* (boxed values with 31 bit range and a 1 bit type
>mark) and a byte/native code compiler that's able to work with the data
>in native (unboxed) form when it's type safe to do that. And transparent
>auto-promotion to bigints. And built-in ints implemented as real objects
>that he can sub-class. And type-restrictions using typedef that can
>sub-type without the cost of sub-classing.
And a partridge in a pear tree. From reading things, jwz wants lots of
Really Black Magic built into the compiler. Which is not unreasonable, but
not all that likely to happen.
>Perhaps you meant that Perl 6 is going to have homogeneous arrays, in
>which case an array of ints would keep 32 bits (per value) of int data in
>the array and auto-generate the extra flags and stuff when a value is
>extracted from the array. That's possible, but it's a special case of small
>ints. You already know how jwz likes special cases.
There's nothing wrong with special cases as long as they're hidden, which
they will be with p6.
>It also looks like some features are impossible to turn off -- like the
>mandatory locking that jwz hates about Java. It's not safe to turn it
>off, but it's not really safe with it on either. Some people would rather
>loose the illusion of safety to get better performance.
Got me there with Java, but we're trying to be really careful with perl 6.
(If anyone thinks we've stumbled, do please chime in with reasons you think
things are wrong) Minimal locking to protect perl from coring is the goal.
Application stability (which is what looks to be more the goal for Java) is
a bad idea in my experience, as it's not really the place of the language
to enforce it. Not Algolish languages, at least--I can see some of the
parallel processing languages doing it, but they're radically different and
>I'm not saying any of this is a mistake; I agree with most of the Perl 6
>design direction. My only point is that we must maintain perspective and
>not be all things to all people. IMHO it's impossible to change Perl to
>the point where jwz would use it (or not hate using it... ;)
I'm not at all worried about what jwz thinks of perl, though if he had a
list of things he hated I'd be thrilled to read it. (I'll take vicious,
pointed criticism over vague praise any day)
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
firstname.lastname@example.org have teddy bears and even
teddy bears get drunk