Re: Micro-articles on Perl 6 Operators

2007-09-19 Thread Paul Hodges

--- Larry Wall <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 18, 2007 at 07:41:54PM -0700, Paul Hodges wrote:
> :  while length($ruler) < $len;  # till there's enough
> 
> There is no length function anymore.

duh. I knew that. Still thinking in v5.
Thanks, Larry.


   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC


Re: [ANN] Lua on Parrot 0.4.16

2007-09-19 Thread chromatic
On Wednesday 19 September 2007 09:58:56 François PERRAD wrote:

> Any comments, suggestions, bug report, test, improvement are welcome on
> Parrot mailing list ([EMAIL PROTECTED]).

Two tests fail reliably for me on x86 GNU/Linux, and one fails now and then:

Failed Test   Stat Wstat Total Fail  List of Failed
---
lua/t/alarm.t1   256 61  2
lua/t/io.t   1   256411  15
lua/t/os.t   1   256251  23
 (1 subtest UNEXPECTEDLY SUCCEEDED), 4 subtests skipped.
Failed 3/48 test scripts. 3/954 subtests failed.
Files=48, Tests=954, 166 wallclock secs (139.54 cusr + 13.47 csys = 153.01 
CPU)

lua/t/os..NOK 23/25  
# Failed test (lua/t/os.t at line 187)
#  got: '94671
# nil
# '
# expected: '946677600
# nil
# '
# Looks like you failed 1 test of 25.

lua/t/io..NOK 15/41  
# Failed test (lua/t/io.t at line 156)
#  got: 'Opening 'perl -e "print 'standard output'"'
# file
# execvp: No such file or directory
# '
# expected: 'file
# standard output
# '

lua/t/alarm...ok 1/6 
# Failed test (lua/t/alarm.t at line 43)
#  got: 'hello
# src/inter_call.c:228: failed assertion 'PObj_is_PMC_TEST(sig_pmc)'
# Backtrace - Obtained 24 stack frames (max trace depth is 32).
#   (unknown)
# Parrot_confess
#   Parrot_init_arg_indexes_and_sig_pmc
# parrot_pass_args
#   Parrot_get_params_pc
# (unknown)
#   (unknown)
# (unknown)
#   (unknown)
# Parrot_runops_fromc_args_event
#   (unknown)
# Parrot_do_handle_events
#   Parrot_check_events__
# (unknown)
#   (unknown)
# (unknown)
#   (unknown)
# Parrot_runops_fromc_args
#   Parrot_runcode
# (unknown)
#   imcc_run
# (unknown)
#   __libc_start_main
# (unknown)
# '
# expected: 'hello
# in alarm!
# in alarm!
# '
# './parrot --no-gc languages/lua/lua.pbc  languages/lua/t/alarm_2.lua ' 
failed 
with exit code [SIGNAL 134].

-- c


[ANN] Lua on Parrot 0.4.16

2007-09-19 Thread François PERRAD


Parrot is a VM (virtual machine) designed specifically for running dynamic 
languages in general, and Perl 6 in particular (see 
http://www.parrotcode.org/).

Parrot is still in development, the latest monthly version is 0.4.16.

A complete prototype of Lua 5.1 is now available :
 - an Lua interpreter written in PIR (Parrot Intermediate Representation) 
that generates PIR

 - a large subset of the Lua Standard Librairies (written in PIR)
 - a test suite (more than 950 tests)

Documentation starts in 
http://svn.perl.org/viewcvs/parrot/trunk/languages/lua/doc/running.pod?view=markup 
and 
http://svn.perl.org/viewcvs/parrot/trunk/languages/lua/doc/status.pod?view=markup.


Any comments, suggestions, bug report, test, improvement are welcome on 
Parrot mailing list ([EMAIL PROTECTED]).


François Perrad. 





[ANN] Lua on Parrot 0.4.16

2007-09-19 Thread François PERRAD


Parrot is a VM (virtual machine) designed specifically for running dynamic 
languages in general, and Perl 6 in particular (see 
http://www.parrotcode.org/).

Parrot is still in development, the latest monthly version is 0.4.16.

A complete prototype of Lua 5.1 is now available :
 - an Lua interpreter written in PIR (Parrot Intermediate Representation) 
that generates PIR

 - a large subset of the Lua Standard Librairies (written in PIR)
 - a test suite (more than 950 tests)

Documentation starts in 
http://svn.perl.org/viewcvs/parrot/trunk/languages/lua/doc/running.pod?view=markup 
and 
http://svn.perl.org/viewcvs/parrot/trunk/languages/lua/doc/status.pod?view=markup.


Any comments, suggestions, bug report, test, improvement are welcome on 
Parrot mailing list ([EMAIL PROTECTED]).


François Perrad.




Re: launched PMC PDD

2007-09-19 Thread Andy Dougherty
On Sat, 15 Sep 2007, Allison Randal wrote:

> I just launched PDD 17 out of the drafts directory, which marks it as ready
> for implementation. Jonathan Worthington and chromatic have volunteered to
> work with me on implementing the refinements to the PMC design.

I had two questions:

1. Is the order of elements in struct PMC deliberate?

   struct PMC {
   Parrot_UInt flags;
   UnionVal cache;
   VTABLE *vtable;
   DPOINTER *data;
   struct PMC_EXT *pmc_ext;
   };

In particular, on 32-bit SPARC, sizeof(flag) will be 4, but cache will
have to be aligned on an 8-byte boundary.  Thus there will be 4 "wasted"
bytes of padding.  Swapping the order (putting cache first and flags
second) will reduce the size of a pmc by 4 bytes.  Not crucial, but
nice.

2.  Did you deliberately drop _int_val2 from UnionVal?
Specifically, the former 
struct _i {
INTVAL _int_val; 
INTVAL _int_val2;
} _i;
has been replaced by a single _int_val entry.  However, since the
UnionVal already contains 2 pointers, keeping the second _int_val2 only
costs space on systems where sizeof(INTVAL) > sizeof(void *).  Are such
platforms a significant concern?

Or were there other good reasons for dropping the entry?  I do note that
it's used heavily in the various array pmcs (including
src/pmc/resizeablebooleanarry.pmc, which I know you've worked on
relatively recently.)

-- 
Andy Dougherty  [EMAIL PROTECTED]



Re: Micro-articles on Perl 6 Operators

2007-09-19 Thread Adriano Ferreira
On 9/18/07, David Vergin <[EMAIL PROTECTED]> wrote:
>  > On 9/18/07, Paul Hodges <[EMAIL PROTECTED]> wrote:
>  >> 
>  >> For the Gearheads
>  >>   We won't bore you with excess details,
>  >>   but for more info... c.f. ...
>  >> 
>
> on 9/19/2007 10:19 AM Adriano Ferreira said the following:
>  > I am thinking about such hooks and good ways to do that.
>
> As an eager reader of these articles, I would find such hooks quite helpful.
>
> How about a standard section near the end of each article:
>
> 
> Going Deeper:
> For info on a trick with (@x, *) to extend a list, see...
> To learn how to use @@() for multidimensional context, see...
> 

Sounds like a good idea.

Stumbling blocks:

* (@x, *) does not work in current implementations
* it's a very good idea that I learn more Perl 6
* Gotta get those operators articles out

By the way, the article on ~ was published:

http://www.oreillynet.com/onlamp/blog/2007/09/yap6_operator_stitching.html

> Regards,
> dvergin
>


Re: Micro-articles on Perl 6 Operators

2007-09-19 Thread Adriano Ferreira
On 9/18/07, Paul Hodges <[EMAIL PROTECTED]> wrote:
>
> Looks good . . . but how short do we want them?

Very short. The usual length that an IT-savvy guy (with at least some
curiosity on programming languages) reads in a glimpse instead of
going somewhere else looking for shorter or more immediate
information.

We could write a treatise on Perl 6 operators (and that will be long
and fascinating for some), but that's not the goal right now.

> For the non-Perl audience, I think it might be worth mentioning the
>  (to us) obvious automatic context manipulations. e.g.,
>
>  ~ is "stitching" strings, and will make strings out of its arguments
> if it can -- it's not adding, but has the same precedence, so:
>   $x =  1 ~  2  + 3;  # 15: is "12" + 3, string coerced to number
>
> maybe even add
>   $y = (1 ~  2) + 3;  # 15: same as above, but explicit
>   $z =  1 ~ (2  + 3); # 15: 1 ~ 5, numbers coerced to strings
> though I think that adds up to a bit too much clutter.

"adds too much clutter" - that's the cutting point. If adds that much,
leave it (at least this time).

> Or have I gone too long without sleep? It looks funny

It is indeed. But mixing string and numeric operations is perlishly
weird -- it scares little children and find good use in rare places
IMO.

> The point is that we want these articles to play up both the old
> "perlishness" that's retained for those fearful of change, and give a
> good feel of what "perlishness" is all about to those used to C and
> Java...or CoBOL and ForTran. We also want shell programmers to see that
> the convenience factor of quick scripting is still there, but with
> Perl's ramped-up capabilities -- it beats the hell out of ksh and awk,
> after all, but isn't really so much harder to learn and use, either at
> the low or the high end.
>
> Maybe we should add a "Making the easy things easy, and the hard things
> possible" tagline to all these articles. :)

There are newer taglines for Perl 6, but I could not find them right now.

I prefer not to stick those mottos in the series to not enforce even
more the (hopefully) effect of the articles as advertising of the
language.

> Also -- is it out of the scope of these to have each perhaps present a
> basic problem and a use of the operator to solve it? I think the zip
> article does that, and the example helped, but this one seems like a
> small but faintly operator-spicy example would help, even if a little
> contrived.
>
>   sub page_ruler ( uint8 $len = 80 ) { # take int, max 256, default 80
>   my $ruler = '';  # declares a buffer
>   my $digit = 0;   # starts with 0
>   $ruler ~= $digit++ % 10  # appends next digit
>  while length($ruler) < $len;  # till there's enough
>   return $ruler;   # and returns the string
>   }
>   my $r = page_ruler(25); # 0123456789012345678901234

I think small examples are a good idea. The problem is to have much
simpler ways to do some things, like

  [~] map { $_ % 10 }, 0 ..^ $len

Obviously, this is far from didactical in this moment.

> Again, PLEASE double-check my probably goofy syntax.
>
> Paul
>
> --- Adriano Ferreira <[EMAIL PROTECTED]> wrote:
>
> > On 9/18/07, Paul Hodges <[EMAIL PROTECTED]> wrote:
> > >
> > > --- Adriano Ferreira <[EMAIL PROTECTED]> wrote:
> > > [[snips here and at end]]
> > > > > . . . I have one suggestion: you might want to mention
> > > > > the roundrobin function in the article on the zip function
> > since
> > > > > the two are very closely related.
> > > >
> > > > Thanks, Joe and Alberto.
> > > >
> > > > Even though the roundrobin is very closely related to zip, I
> > think
> > > > that mentioning it and giving an explanation would add length and
> > > > detail to the article. I already sacrificed the trick with (@x,
> > *) to
> > > > extend a list and the @@() for multidimensional context, which
> > are
> > > > fine but too much for this piece of text.
> > >
> > > It would certainly add length, but you could minimize the addition
> > of
> > > detail by using them as hooks. Maybe embed them in a special
> > section...
> > > e.g.,
> > >
> > > 
> > > For the Gearheads
> > >
> > >   We won't bore you with excess details, but for more info on the
> > trick
> > >   with (@x, *) to extend a list and the @@() for multidimensional
> > >   context, c.f. .
> > > 
> >
> > I am thinking about such hooks and good ways to do that. More on that
> > later.
> >
> > > Sorry, not sure where to link off the top of my head, but if anyone
> > > thinks it's a good idea I'll look it up on request.
> > >
> > > > Well, it's kind of hard to keep these articles small and
> > interesting.
> > > > Maybe this stuff can find their way in later articles.
> > >
> > > Personally, I'm a bit behind on my P6, but I think this is a good
> > idea.
> > >
> > > I'd be happy to contribute something, and though my time is short
> > like
> > > everyone's these days, please feel free to contact me here

Re: Micro-articles on Perl 6 Operators

2007-09-19 Thread Adriano Ferreira
On 9/18/07, Joe Gottman <[EMAIL PROTECTED]> wrote:
> Adriano Ferreira wrote:
> > I salute every bit of help. I am trying to organize the production and
> > will hopefully provide more details soon. By now, I think that I can
> > handle suggestions and corrections to the articles. The next one is
> > here:
> >
> > http://ferreira.nfshost.com/perl6/stitching6.html
> >
> >
>This one's very nice.  One question: what's the "~+" operator you
> talk about in your discussion of prefix ~ ?  I can't find any mention of
> it in Synopsis 3.

Like Larry pointed, I got it wrong. I replaced this with the bitwise
or for strings '~|' which was basically what I intended from the
beginning.

> Joe Gottman


Re: Micro-articles on Perl 6 Operators

2007-09-19 Thread Adriano Ferreira
On 9/19/07, Moritz Lenz <[EMAIL PROTECTED]> wrote:
> Adriano Ferreira wrote:
> > http://ferreira.nfshost.com/perl6/stitching6.html
>
> A grammatical nit: "The infix operator '~' keeps the same precedence of
> '+' in Perl 6."
> I think that should be "the same precedence _as_" (but I'm not a native
> speaker, so forgive me if I'm wrong ;-))

I will trust you. It kind of sounds better.

> Anyway, a nice article again.
>
> Cheers,
> Moritz
>
> --
> Moritz Lenz
> http://moritz.faui2k3.org/ |  http://perl-6.de/
>
>
>


Re: Micro-articles on Perl 6 Operators

2007-09-19 Thread David Vergin

> On 9/18/07, Paul Hodges <[EMAIL PROTECTED]> wrote:
>> 
>> For the Gearheads
>>   We won't bore you with excess details,
>>   but for more info... c.f. ...
>> 

on 9/19/2007 10:19 AM Adriano Ferreira said the following:
> I am thinking about such hooks and good ways to do that.

As an eager reader of these articles, I would find such hooks quite helpful.

How about a standard section near the end of each article:


Going Deeper:
   For info on a trick with (@x, *) to extend a list, see...
   To learn how to use @@() for multidimensional context, see...


Regards,
dvergin


Re: Gone for a while

2007-09-19 Thread Joshua Isom
Oh, just pick a small section no one else bothers with.  I'm setting up 
again for working on complex.pmc(setting up, not working).  I'm doing 
amd64 jit even if it only works on FreeBSD(not enabled by default for a 
reason).  If you don't do anything/commit anything for a while, it's 
still ok.  There are things like mod_parrot that will be very useful 
and dealing with potential issues will encourage good coding standards 
for use with mod_parrot from the start(how many programs need to be 
ported to mod_perl?).  I also did GetOpts;Obj and even though it has 
"issues" and could be adapted for various getopt styles(such as gnu, 
bsd, and parrot), I haven't done it, and actually haven't heard much 
about it.  It was better than what there was at the time, and I haven't 
really touched it since.


For another idea, perl has CPAN, and parrot has the potential for 
multiple languages to use the same library, that can be optimized in 
PIR.  A common API for things like CGI across several languages, etc.  
Maybe start on being able to embed parrot into a browser?


Parrot offers many little niches.  Some benefit parrot's developers, 
some benefit parrot, etc...  Some are yet to be touched.


Personally I have noticed some of the issues regarding communication, 
and have had my aggravations regarding certain areas, but I still 
continue.


On Sep 18, 2007, at 3:57 PM, Andy Lester wrote:

I'm sorry to hear that. You're welcome back any time. All 
contributions
are valuable, and isn't necessary to follow every detail of every 
aspect

of the project to contribute.


Understood.  It's just clear that I'm way out the loop on things, and I
don't have the time to talk about the things that I've been wanting to
talk about for a while anyway.
--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance





[svn:parrot-pdd] r21373 - in trunk: docs docs/pdds lib/Parrot/Pmc2c src/pmc

2007-09-19 Thread particle
Author: particle
Date: Wed Sep 19 00:25:51 2007
New Revision: 21373

Modified:
   trunk/docs/pdds/pdd17_pmc.pod

Changes in other areas also in this revision:
Modified:
   trunk/docs/pmc2c.pod
   trunk/lib/Parrot/Pmc2c/PMC.pm
   trunk/lib/Parrot/Pmc2c/PMCEmitter.pm
   trunk/lib/Parrot/Pmc2c/UtilFunctions.pm
   trunk/src/pmc/default.pmc
   trunk/src/pmc/scalar.pmc

Log:
[PDD17]: rename pmc definition modifier 'noinit' to 'no_init' for consistency

Modified: trunk/docs/pdds/pdd17_pmc.pod
==
--- trunk/docs/pdds/pdd17_pmc.pod   (original)
+++ trunk/docs/pdds/pdd17_pmc.pod   Wed Sep 19 00:25:51 2007
@@ -133,7 +133,7 @@
 The PMC cannot be instantiated. (By convention, abstract classes are given
 lower-case names.)
 
-=item noinit
+=item no_init
 
 Don't generate class initialization code (don't set up a vtable for the PMC).
 Used with C.