Audrey Tang wrote:
> 在 2006/7/4 下午 8:50 時,Allison Randal via RT 寫到:
> 
>> The :immediate feature isn't really a question of reentrancy (it doesn't
>> hold static data over successive calls, and it doesn't return a pointer
>> to static data).
> 
> That depends on the :immediate code.  The equivalence of
> 
>     BEGIN { $Static::data++ }
> 
> is possible through :immediate interface, and successive Parrot 
> execution and/or IMCC compilation can be affected.
> 
> In that regard is it as bad as having static globals.

Yes, :immediate could be used to create the equivalent of static globals,
but then so could many other constructs. It's not a characteristic of
the :immediate feature, just a general characteristic of any system that
stores state in any way.

Dynamic features give great power to developers. Many regard this as
an advantage.

Perl tends to take the strategy of making the power accessible and
teaching people to use it wisely (a philosophy that Parrot carries on).

>> Many languages-under-development may start out interpreted
>> and then move to compiled (punie, pheme, and TGE itself have all
>> followed this path). It's an easy way to get started on a language
>> implementation.
> 
> Yet none of Punie, Pheme nor TGE make use of :immediate, so I'm not sure 
> how this sentence relates to the question.

It was in response to:

>> Currently in all Parrot-targetting languages, only Perl 6 has that
>> kind of evaluation-during-compilation feature, via its BEGIN block;
>> however, due to Perl 6's doctrine of separate compilation, the BEGIN
>> block has be compiled separately as another .pbc anyway; that means
>> nobody has a legitimate use of :immediate at this point.

That is, just because one language targets separate compilation doesn't
mean all languages will.

> I do agree that taking a try-and-see attitude is a valid option; in that 
> case we can simply declare "nothing but Parrot can work with PIR", in 
> the same way that "nothing but perl5 can work with Perl 5".

I don't see how that conclusion follows. Any external tools can write
PIR code and then execute it on Parrot, and anyone can implement a
backend that runs PIR.

Allison

Reply via email to