RE: threads?

2010-10-12 Thread philippe.beauchamp
Although anecdotal, I've heard good things about Go's "channel" mechanism as a 
simple lightweight concurrency model and a good alternative to typical 
threading. Channels are first-class in the language and leverage simple 
"goroutine" semantics to invoke concurrency.


--- Phil



-Original Message-
From: thoughtstr...@gmail.com [mailto:thoughtstr...@gmail.com] On Behalf Of 
Damian Conway
Sent: October 12, 2010 10:23 AM
To: perl6-language@perl.org
Subject: Re: threads?

Leon Timmermans wrote:

> For the love of $DEITY, let's please not repeat ithreads!

$AMEN!

Backwards compatibility is not the major design criterion for Perl 6,
so there's no need to recapitulate our own phylogeny here.

The problem is: while most people can agree on what have proved to be
unsatisfactory threading models, not many people can seem to agree on
what would constititute a satisfactory threading model (or, possibly, models).

What we really need is some anecdotal evidence from folks who are actually
using threading in real-world situations (in *any* languages). What has worked
in practice? What has worked well? What was painful? What was error-prone?
And for which kinds of tasks?

And we also need to stand back a little further and ask: is "threading"
the right approach at all? Do threads work in *any* language? Are there
better metaphors?

Perhaps we need to think more Perlishly and reframe the entire question.
Not: "What threading model do we need?", but: "What kinds of non-sequential
programming tasks do we want to make easy...and how would we like to be
able to specify those tasks?"

As someone who doesn't (need to) use threading to solve the kinds of
problems I work on, I'm well aware that I'm not the right person to help
in this design work. We need those poor souls who already suffer under
threads to share their tales of constant misery (and their occasional
moments of triumph) so we can identify successful patterns of use
and steal^Wborg^Wborrow the very best available solutions.

Damian


RE: regex and

2010-08-10 Thread philippe.beauchamp
Back to your original advice...


> If you want to match an alphabetic string which does not include 'abc'
> anywhere, you can write this as
>
> ^ [   ]* $


I presume this only works here because  is one character... if instead 
of  I used anything more complicated 

(for example)

token name
{
<[A..Z]>*
}


And then tried to do ^ [   ]* $
This wouldn't work since there's a wildcard within name.



Once the & operator is in rakudo, though... I gather I /could/ do something 
like the following

^ [ * &  ]  $

And this would in effect ensued that the sequence "abc"  doesn't exist anywhere 
across the match for  


Is this correct?








RE: regex and

2010-08-10 Thread philippe.beauchamp
Great! That does it. Thanks. :)
I realized my error on the anchors after sending... but didn't think of the * 
on the grouping. 

On the & operator... are you saying that it would operate basically as 
expected... allowing sets of rules and'ed rather than or's with the | ?




--- Phil

-Original Message-
From: Moritz Lenz [mailto:mor...@faui2k3.org] 
Sent: August 10, 2010 2:09 PM
To: Beauchamp, Philippe (6009210)
Cc: perl6-language@perl.org
Subject: Re: regex and

Hi,

philippe.beauch...@bell.ca wrote:
> rule TOP
> {
> ^
> [
> & *
> & 
> ]
> $
> }

The & syntax is specced, but it's not yet implemented in Rakudo.

But note that  is a zero-width assertion, so your example regex
matches at the start of a string, if it does not begin with 'abc'.

Since you anchor it to the end of string too, it can only ever match the
empty string.

You can achieve the same with just ^$.

If you want to match an alphabetic string which does not include 'abc'
anywhere, you can write this as

^ [   ]* $

Cheers,
Moritz


regex and

2010-08-10 Thread philippe.beauchamp

Hi there...
New to the list and getting to understand perl6 after a bit of a hiatis from 
the Perl world.

I'm working my way through the new grammar syntax trying to implement some 
useful modules, and was wondering if there is a mechanism within the grammar 
constructs to allow two rules to apply simultaneously in parallel (not 
sequence).

In other words... I want to say that for a rule to pass it must pass two 
contained rules completely.

Ie:
token abc
{
'abc'
}

rule TOP
{
^
[
& *
& 
]
$
}


Such that the TOP rule would only match if a matching string consisted entirely 
of alpha's AND did not contain the letter sequence "abc" anywhere in it.

(*note I know the & notation isn't legit ;)