Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
assorted questions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rich Morin  
View profile  
 More options Oct 25 2004, 1:25 am
Newsgroups: perl.perl6.language
From: r...@cfcl.com (Rich Morin)
Date: Sun, 24 Oct 2004 22:25:16 -0700
Local: Mon, Oct 25 2004 1:25 am
Subject: assorted questions
A fellow Perlie (NOT on this list) was ruminating on the idea of
generalizing the "Taint" capability into a first-class part of
the language.  Something like allowing variables to log their
provenance, for later examination.

I came up with two possible approaches for this.  One would act
a bit like the D (in DTrace) way of doing "conditional traces".
Another would act a bit like the "watchpoints" I've seen in a
debugger or three.

In any case, one way of doing something like this in Perl might
be to have the ability to register exceptions for a range of
quite ordinary behavior, such as entering or leaving a statement,
setting or even accessing a variable, etc.

I realize that this would slow the program down radically, but I
could see it being useful in tracking down oddball problems.

-r

On a vaguely-related topic, I am reminded of another friend's
desire to be able to redefine floating point values as quartets
of values.  Each operation would then be done using all possible
rounding options (in the IEEE standard) and the results checked
for "significant" variations.  If anyone knows of a cute way to
do this in Perl 6, I'd be happy to hear about it...
--
email: r...@cfcl.com; phone: +1 650-873-7841
http://www.cfcl.com        - Canta Forda Computer Laboratory
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Austin Hastings  
View profile  
 More options Oct 25 2004, 8:03 am
Newsgroups: perl.perl6.language
From: Austin_Hasti...@Yahoo.com (Austin Hastings)
Date: Mon, 25 Oct 2004 08:03:40 -0400
Local: Mon, Oct 25 2004 8:03 am
Subject: Re: assorted questions

Rich Morin wrote:
> On a vaguely-related topic, I am reminded of another friend's
> desire to be able to redefine floating point values as quartets
> of values.  Each operation would then be done using all possible
> rounding options (in the IEEE standard) and the results checked
> for "significant" variations.  If anyone knows of a cute way to
> do this in Perl 6, I'd be happy to hear about it...

Implement an opaque object whose value, when fetched, is a junction.

=Austin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luke Palmer  
View profile  
 More options Oct 25 2004, 8:42 am
Newsgroups: perl.perl6.language
From: l...@luqui.org (Luke Palmer)
Date: Mon, 25 Oct 2004 06:42:36 -0600
Local: Mon, Oct 25 2004 8:42 am
Subject: Re: assorted questions

Rich Morin writes:
> In any case, one way of doing something like this in Perl might
> be to have the ability to register exceptions for a range of
> quite ordinary behavior, such as entering or leaving a statement,
> setting or even accessing a variable, etc.

Or passing a variable to a function.  This is sort of a hot topic in my
brain right now.  It turns out that Junctions cover some of the same
ground as your hooks want to.

I definitely want such hooks.

You can do it easily at compile time with a grammar munge that munges no
grammar:

    grammar DebugPerl is Perl {
        rule statement {
            { Parrot::emit "enter_hook()" }
            <super>         # call Perl::statement
            { Parrot::emit "exit_hook()" }
        }
    }
    use grammar DebugPerl;

For certain values of enter_hook() and exit_hook().

But another thing that would be nice is to track a value to see where
it's being used/changed.  Better yet, to implement a module that makes
use of that tracking ability to do some magick.

Don't mind if I digress from your question a bit now.  For large values
of "a bit".

I've been thinking of an Operator type class that represents "something
to be done".  Operatable variables would get a hook called with the
operator as an argument instead of doing something.  Junctions are
pretty easy if you do that:

    multi sub OVERLOAD (Conjunction $j: Operator $o) {
        map { $o.($_) } $j.states;
    }
    multi sub OVERLOAD (Conjunction $j: Operator::Boolify $o) {
        for ($j.states) {
            $_ or return;
        }
        return 1;
    }

And it opens up a huge field of junction-like things that you can do,
never before possible.  It's like a super-powerful tie.  

The question is: how do you catch these naughty values in the act?  If
we marked variables that could hold them and were forced to explicitly
type any function that returned them, then it's easy to do with no speed
hit to the unaware.

But we might be able to do better than that (that is, very little speed
hit without syntactic markings).

Whenever a magick value is created, it marks a scope local flag
"NAUGHTYBUSINESS", which is checked before magick hooks.  If it's on,
then the sub can branch to a less efficient, more aware version of the
call and proceed from there.  But then you still have to check a flag
before your hooks, which puts a limit on how many hooks you can have.

Warning:  highly theoretical stuff follows:

A really nice thing to be able to do is to change the implementation of
a sub while it's running, and be able to come back in the middle of the
changed one.  It's also a very hard thing to do, and usually deemed
impossible.

But I've been thinking that it's not, in fact, impossible.  If the two
subs are the same semantically (that is, you're not coming back saying
that "no I didn't do that" when you already did), and you have details
of both implementations, then it would be possible to make a mapping
from the old implementation's lexical state to the new one's at some
point in the execution.   I'm not sure how restrictive the restrictions
would have to be, but I'm sure that it works for at least a few useful
cases.

Did that answer your question?  :-p

Luke


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »