Re: Wanted: Perl 6 Programmers
by danger (Priest) on Sep 05, 2002 at 07:35 UTC
|
I had to make a couple of minor edits to the files: "anyop.c" and
"imcc.y" under the "languages/imcc" path --- the version was hardcoded
with 0,0,7 but needs to be changed to 0,0,8 once in each file. I found
mention of this on the perl6-internals list. After that, make test in
the perl6 directory succeeded on all tests. I just wanted to point
that out and possibly save someone a little grief. Time to write some
Perl6 code I guess :-)
| [reply] |
|
thanks for the advice mr danger -- i checked out a CVS copy, and needed to twiddle the version number as well.
have to say, i'm excited... even by my first for loop - parallel iteration is cool! likewise with the hyper operators - just like an even more brief map {} LIST. um... not sure about _ for concatenation though... call me a heretic, but i'd prefer an overloaded '+' to concatenate strings and '*' to repeat strings (a la perl5 'x' operator)... more parametric polymorphism please...
print "hello perl6 world\n";
my int @list1 = ( 1 .. 10 );
my int @list2 = @list1 ^* 2;
my int $i = 0;
for @list1; @list2 -> $a; $b {
print "list iteration " _ ++$i
_ ": a is " _ $a
_ "; b is " _ $b
_ "\n";
}
this works! although the contents of @list2, once hyper-doubled, appear to be (ie they print as) floating point numbers. nevertheless, this is extremely exciting.
matt
| [reply] [d/l] [select] |
|
although the contents of @list2, once hyper-doubled, appear to be (ie they print as) floating point numbers.
You are correct -- numeric hyper-operators always convert their operands to floating-point in the current implementation. This behavior is incorrect.
/s
| [reply] |
|
You're a heretic. :)
Personally, I *HATE* it when + is overloaded as string concatenation.
It leads to too many bugs/verbosities where you need to tell the
language "no, I wanted addition here", or "no, I wanted
concatenation here", especially in a language like perl which is
able to DWIM-convert strings to numbers and verse visa.
| [reply] |
|
Re: Wanted: Perl 6 Programmers
by busunsl (Vicar) on Sep 05, 2002 at 11:19 UTC
|
I'd like to test, but the build of the shared library for imcc fails.
This is on Solaris 6, without GNU.
The error is:
ld: fatal: option -h and building a dynamic executable are incompatibl
+e
ld: fatal: Flags processing errors
make[2]: *** [blib/lib/libparrot.so] Error 1
make[2]: Leaving directory `/home/sybase/src/parrot-0.0.8'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/sybase/src/parrot-0.0.8/languages/im
+cc'
make: *** [imcc] Error 2
I tried various things without really understanding what I was doing :-), but nothing worked.
Perhaps someone has an idea how to solve this.
rgds
| [reply] [d/l] |
|
LD_SHARED= -shared
to
LD_SHARED= -G
and imcc compiled after the patch danger mentioned.
All perl6 tests succeeded.
Now I'll try to convert some scripts from 5.6 to 6. | [reply] [d/l] [select] |
|
I submitted this (and your sketch of a fix) as a bug. Thanks,
/s
| [reply] |
Re: Wanted: Perl 6 Programmers
by sharkey (Scribe) on Sep 06, 2002 at 05:37 UTC
|
I'm having some fun playing with compiler, and I'm starting
to wonder what the best way to give you feedback would be?
Should I just note what I tried which did not work, such as
that any use of a hyper-assignment-operator (e.g.
@a ^+= @b; )
causes a runtime exception:
Died at P6C/Util.pm line 72.
Or should I submit it as a testcase? Is there some way
to indicate that the test is expected to fail?
output_is(<<'CODE', <<'OUT', "string interpolation");
sub main () {
$z = 1; @a = (1..3); $z1 = @a;
#currently outputs: z=($z) a=() \=@a=($z1)
print "z=($z) a=(@a) \$z1=\@a=($z1)\n";
}
CODE
z=(1) a=(1 2 3) $z1=@a=(3)
OUT
And how to we check if something has already been
reported, or what the current plans are to get rid
of the sub main() requirement?
You give your email address as the contact
point for the compiler, so I guess that means we
should send bug reports directly to you. (unless
they are disguised as a request for clarification
on how to report them...)
One final test case, and I'll stop.
output_is(<<'CODE', <<'OUT', "concatenation chain");
sub main() {
@a = (2,4,8);
print @a _ "\n"; # OK: 3
print @a ^_ "\n"; # OK: 2\n4\n8\n
print @a ^_ "\t" _ "\n"; # BAD: ''
print (@a ^_ "\t"); # OK: 2\t4\t8\t
print "next\n";
print "--" _ (@a ^_ "\t"); # BAD: --
print "next\n";
print ((@a ^_ "\t") _ "\n"); # BAD: ''
print "stop\n";
}
CODE
3
2
4
8
2 4 8
2 4 8 next
--2 4 8 next
2 4 8
stop
OUT
| [reply] [d/l] [select] |
|
There are different "bests" for different kinds of feedback, I suppose. If you have something that's pretty much certainly a bug, bugs-parrot at bugs6.perl.org is probably the best target (bugs-perl6 may also be up and running). If you have a patch, adding "[PATCH]" to the subject tags it automatically.
If you're not sure whether or not something should work, you can email either me (Sean) or perl6-internals with the question. If you want to make something work (i.e. by implementing it), I'm probably the one you should be bugging, since it will encourage me to document things.
If something clearly isn't implemented, a test-case is probably overkill -- just note it as "not implemented" and I'll put it somewhere in the docs. Hyper-assignment falls into this category. If something looks like it should work, but doesn't, then a test case is probably more appropriate.
Both of the tests you provide above look good overall, though I'm not sure about some of the cases in the second. For example,
print "--" _ (@a ^_ "\t"); # BAD: --
is concatenating "--" with an array value. It should probably evaluate the array in scalar context (yielding its length) instead of turning into an empty array, but I don't think it will be expanded as in double-quoted string context.
/s | [reply] [d/l] |
|
is concatenating "--" with an array value.
doh! I need to remember that hyper forces array
context. After I change the _ to , in those lines
it works correctly, so it looks like "array in scalar
context" evaluation is the only bug I'm showing there.
| [reply] |
Re: Wanted: Perl 6 Programmers
by John M. Dlugosz (Monsignor) on Sep 05, 2002 at 15:28 UTC
|
How about giving the language docs their own public URL's, so people can easily read "the latest" to keep up or figure out a posted example code fragment, even if we don't have the time or resources to install the stuff ourselves. | [reply] |
|
Which language docs? Larry's and Damian's Apocalypses and Exegeses, or the compiler docs? The former should be on the web (perl.org, maybe) already. As for the latter, I can't think of a good way to make them web-presentable at the moment; at least, nothing better than cvsweb, which isn't all that good. If people let me know what docs they would most like to see on the web, I'll see what I can do.
/s
| [reply] |
|
Well, you mentioned "there should be enough to get you started in languages/perl6/overview.pod" in the post, so I was thinking of that one. That is, let us read it without downloading/installing the whole thing.
If Perl6 stuff is already on perl.org or here in the documentation section, how about a link to it? The implication was that this leading-edge stuff would superceed any of that, since you mentioned mailing lists for discussion but no documents other than overview.pod.
| [reply] [d/l] |
|
|
|
|
If you don't mind pod, I put it on my perlmonk.org account here.
| [reply] |
|
Thanks. I'll give it a look.
I'm very interested in Perl6, but don't have time to dive in right now. I just moved, and my home computer room is not set up yet. And I've been doing projects like fixing physical things instead of software sigh.
I do hope to make a contribution, perhaps in the form of documentation (creation and editing). That will be less critical if I have to fade out for periods.
—John
| [reply] |