Front page | perl.perl6.internals |
Postings from January 2002
RE: How Powerful Is Parrot? (fwd)
From:
Josh Wilmes
Date:
January 24, 2002 18:02
Subject:
RE: How Powerful Is Parrot? (fwd)
Message ID:
200201250202.UAA10505@sky.net
Who is the keeper of the FAQ? This is gold.
--Josh
------- Forwarded Messages
Date: Thu, 24 Jan 2002 12:35:05 -0800
From: "Brent Dax" <brentdax@cpan.org>
To: <David.Leeper@bisys.com>, <perl6-internals@perl.org>
Subject: RE: How Powerful Is Parrot?
David.Leeper@bisys.com:
# I've been watching the Parrot development with interest and have a few
# questions about Parrots capabilities.
#
# Will Parrot support templates (also known as generics)?
If you mean like C++ templates, then the answer is that it's up to the
language. There won't be anything in Parrot that will prevent it.
# Will Parrot support operator overloading?
Yup, that's what vtables are all about. At the Parrot level, you just
overlaod the 'add' vtable entry (and its variants) to implement +; at
the language level you do whatever you want.
# Do Parrot classes have constructors and destructors?
Yes.
# Does Parrot have garbage collection?
Not yet, but it will.
# When a Parrot class is garbage collected or otherwise
# destroyed, is its
# destructor executed? If so, when? In other words, is
# object destruction
# 100% deterministic in Parrot?
Depends on the language, but Parrot will support deterministic
destruction.
# Does Parrot memory allocation support placement? In other
# words, can I
# supply a Parrot memory allocation routine with the address
# of a variable
# and the desired size to allocate and expect Parrot to
# allocate a block
# of the given size starting at the address I provided?
Dunno, that's not my department.
# How hard would it be to implement memory pools of objects
# in Parrot?
.....
# Does Parrot support threads?
Not yet, but it will.
# Does Parrot support exceptions?
Not yet, but it will.
# Can I invoke routines written in other languages, such as
# C or C++, from
# Parrot?
Yes--you'll just have to write opcodes to wrap them.
# Thanks in advance for your help.
You're quite welcome.
- --Brent Dax
brentdax@cpan.org
Parrot Configure pumpking and regex hacker
<obra> mmmm. hawt sysadmin chx0rs
<lathos> This is sad. I know of *a* hawt sysamin chx0r.
<obra> I know more than a few.
<lathos> obra: There are two? Are you sure it's not the same one?
------- Message 2
Date: Thu, 24 Jan 2002 16:22:34 -0500
From: David.Leeper@bisys.com
To: perl6-internals@perl.org
Subject: RE: How Powerful Is Parrot?
Thanks Brent.
# # Does Parrot have garbage collection?
# Not yet, but it will.
When it does, I'd ask that there be some sort of option on what type of
garbage collection is used. This is because different methods of garbage
collection have very different characteristics.
For example, reference counting can't handle circular references and the
garbage collector therefore leaks memory. Mark and Sweep is not 100%
deterministic and there is no way to know when or if a garbage collected
object will have it destructor executed. This is a big reason why Java has
a "finally" keyword, so the programmer can execute code that would normally
go in a destructor in a 100% deterministic language.
I have a garbage collector written in C++ that handles circular references,
is 100% deterministic, and is fast. When it comes time to implement garbage
collection in Parrot, I'd be happy to provide the source if the Parrot
community feels it'd be worthwhile. I currently own the copyright, but have
no problem making it open source.
Dave
"Brent Dax"
<brentdax@cpan To: <David.Leeper@bisys.com>, <per
l6-internals@perl.org>
.org> cc:
Subject: RE: How Powerful Is Parro
t?
01/24/02 03:35
PM
David.Leeper@bisys.com:
# I've been watching the Parrot development with interest and have a few
# questions about Parrots capabilities.
#
# Will Parrot support templates (also known as generics)?
If you mean like C++ templates, then the answer is that it's up to the
language. There won't be anything in Parrot that will prevent it.
# Will Parrot support operator overloading?
Yup, that's what vtables are all about. At the Parrot level, you just
overlaod the 'add' vtable entry (and its variants) to implement +; at
the language level you do whatever you want.
# Do Parrot classes have constructors and destructors?
Yes.
# Does Parrot have garbage collection?
Not yet, but it will.
# When a Parrot class is garbage collected or otherwise
# destroyed, is its
# destructor executed? If so, when? In other words, is
# object destruction
# 100% deterministic in Parrot?
Depends on the language, but Parrot will support deterministic
destruction.
# Does Parrot memory allocation support placement? In other
# words, can I
# supply a Parrot memory allocation routine with the address
# of a variable
# and the desired size to allocate and expect Parrot to
# allocate a block
# of the given size starting at the address I provided?
Dunno, that's not my department.
# How hard would it be to implement memory pools of objects
# in Parrot?
......
# Does Parrot support threads?
Not yet, but it will.
# Does Parrot support exceptions?
Not yet, but it will.
# Can I invoke routines written in other languages, such as
# C or C++, from
# Parrot?
Yes--you'll just have to write opcodes to wrap them.
# Thanks in advance for your help.
You're quite welcome.
- --Brent Dax
brentdax@cpan.org
Parrot Configure pumpking and regex hacker
<obra> mmmm. hawt sysadmin chx0rs
<lathos> This is sad. I know of *a* hawt sysamin chx0r.
<obra> I know more than a few.
<lathos> obra: There are two? Are you sure it's not the same one?
------- Message 3
Date: Thu, 24 Jan 2002 16:52:59 -0500
From: Dan Sugalski <dan@sidhe.org>
To: David.Leeper@bisys.com, perl6-internals@perl.org
Subject: Re: How Powerful Is Parrot?
[Brent's answered some of these already, but I'll fill in the blanks.
Also some of the answers presume a fully-implemented engine, which we
don't have yet]
At 2:52 PM -0500 1/24/02, David.Leeper@bisys.com wrote:
>I've been watching the Parrot development with interest and have a few
>questions about Parrots capabilities.
>
> Will Parrot support templates (also known as generics)?
That's a language issue, and we're a step below that.
> Will Parrot support operator overloading?
Absolutely.
> Do Parrot classes have constructors and destructors?
Yup, though generally it's at a level below your language of choice.
(Which would, presumably, use the hooks to do appropriate things)
> Does Parrot have garbage collection?
Will, yup. GC's either going to be some form of compacting collector
or a M&S system. No refcounts.
> When a Parrot class is garbage collected or otherwise destroyed, is its
> destructor executed? If so, when? In other words, is object destruction
> 100% deterministic in Parrot?
Object destruction is not 100% deterministic by default. You can,
however, explicitly trigger a dead object detection sweep as you see
fit, depending on the needs of the language. We don't guarantee
behavior in cross-language situations. At some point things will be
destroyed, of course.
> Does Parrot memory allocation support placement? In other words, can I
> supply a Parrot memory allocation routine with the address of a variable
> and the desired size to allocate and expect Parrot to allocate a block
> of the given size starting at the address I provided?
No, though it's always a dodgy thing to guarantee that a block of X
bytes can be allocated at location Y. (How do you know that there's
enough free space?) You can, however, construct a variable using a
pre-allocated block of memory and tell parrot to use it for your
string or whatever. You also have control over whether a variable's
memory should be touched by the GC system or not.
> How hard would it be to implement memory pools of objects in Parrot?
That's what we're going to have as soon as it gets implemented. PMCs
are coming from memory arenas, as it makes dead object detection a
lot easier.
> Does Parrot support threads?
Yup.
> Does Parrot support exceptions?
Yup.
> Can I invoke routines written in other languages, such as C or C++, from
> Parrot?
Absolutely.
- --
Dan
- --------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
dan@sidhe.org have teddy bears and even
teddy bears get drunk
------- Message 4
Date: Thu, 24 Jan 2002 19:16:08 -0500
From: "Bryan C. Warnock" <bwarnock@capita.com>
To: David.Leeper@bisys.com, perl6-internals@perl.org
Subject: Re: How Powerful Is Parrot?
On Thursday 24 January 2002 14:52, David.Leeper@bisys.com wrote:
> I've been watching the Parrot development with interest and have a few
> questions about Parrots capabilities.
Brent and Dan have already answered, so I'm going to be so foolish as to
answer, too.
> Will Parrot support operator overloading?
At both the language and internals level. The language level is
overloading as is commonly thought of in OO - the treatment of an
operator as a method call.
The Parrot level overloading is the vtable mutation, and it isn't clear
exactly how (and why) that will be done, but it will be done. (Since
vtables *are*, in some sense, Parrot, it's not clear where to draw the line
between an overloaded Foo and a brand new Bar, so it may end up not being
overloading anyway.)
> Do Parrot classes have constructors and destructors?
Yes.
> Does Parrot have garbage collection?
Yes, it's been collecting a lot of garbage. But it will do some form of GC,
too.
> When a Parrot class is garbage collected or otherwise destroyed, is its
> destructor executed? If so, when? In other words, is object destruction
> 100% deterministic in Parrot?
Destruction is deterministic at the language level, but not at Parrot's
level.
> Does Parrot memory allocation support placement? In other words, can I
> supply a Parrot memory allocation routine with the address of a
> variable and the desired size to allocate and expect Parrot to allocate a
> block of the given size starting at the address I provided?
Nope. We don't have nearly enough feet to shoot ourselves in for this.
> How hard would it be to implement memory pools of objects in Parrot?
Dunno. How hard?
The rest are Dan's answers, verbatim.
- --
Bryan C. Warnock
bwarnock@capita.com
------- End of Forwarded Messages
-
RE: How Powerful Is Parrot? (fwd)
by Josh Wilmes