»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by masak on 12 May 2015. |
|||
00:03
SquireOfGothos joined
00:04
dmitri joined
00:05
jjido left
|
|||
Sgeo | Will someone eventually accidentally do something like @foo[$_-1] ? | 00:08 | |
(Where {} around tha expression would presumably make it work) | |||
(The $_-1 I mean) | 00:09 | ||
I think I'd like $_ more if it was more like $^a | |||
I saw a Perl5 vs Perl6 comparison thing, did $a have special meaning in P5? | |||
dmitri | Sgeo, yes $a is special | 00:10 | |
yoleaux | 2 Aug 2015 12:01Z <smls> dmitri: For .pm files, you can assume it's Perl 5 by default, and only Perl 6 if the first non-comment line starts with one of: use v6 unit module class | ||
geekosaur | $a and $b are magic, yes | ||
Sgeo | dmitri, what does it do? | ||
geekosaur | they're always package variables, predeclared, because sort puts the items passed to the comparison function in $a and $b | 00:11 | |
not as parameters | |||
dmitri | Sgeo, what geekosaur said | ||
geekosaur | (an optimization going way back in perl history() | ||
00:11
gfldex_ is now known as gfldex
|
|||
dmitri | yoleaux: That's not always the case, though. I added a special taster to ctags that can figure this out. | 00:11 | |
geekosaur | basically perl did not build a stack frame for the comparison function, so no way to pass parameters normally | ||
dmitri | Speaking of ctags, it now supports Perl 6 | 00:12 | |
geekosaur | that should have been directed to smls, not the bot :) | ||
dmitri | heh | ||
geekosaur | ...maybe via .tell | ||
dmitri | smls: That's not always the case, though. I added a special taster to ctags that can figure this out. | ||
Juerd | geekosaur: They're not always package variables. In fact, if you do "my $a;", and then use sort { ... $a ... }, it's not accessing the package variable $a, but the lexical one, and the sorting doesn't do what you want. A warning is emitted. | 00:13 | |
geekosaur | yeh | ||
it's ugly | |||
Juerd | It's not as ugly as it could have been :) | ||
geekosaur | (it also predates my variables, so not surprising that things misbehave in that case) | ||
00:14
SquireOfGothos left
|
|||
geekosaur reminded of the bad old days with local. yeurccccchhh | 00:14 | ||
Juerd | It's more like there's an implicit "our ($a, $b);" at the beginning of your file. | 00:15 | |
00:15
cognominal left
|
|||
Juerd | geekosaur: local is *great* for what it does, not so much for being a lexical-ish thing. | 00:15 | |
dmitri | a few years ago I was writing lots of shell scripts | 00:16 | |
I grew to love dynamic scoping | |||
geekosaur | yes, but in perl 3 local was all we had! | ||
Juerd | dmitri: In Perl 6, dynamic scoping is done with "temp". | 00:17 | |
dmitri | perl 3... is perl 6 twice as good? :) | ||
Sgeo | I thought dynamic was done with $* ? | ||
Juerd | Hm, I guess two different things are both called dynamic scoping in my head. | 00:18 | |
geekosaur | which part is dynamic? :) | ||
Juerd | m: my $foo = "foo"; { temp $foo = "bar"; $foo.say; }; $foo.say | 00:19 | |
camelia | rakudo-moar 720090: OUTPUT«barfoo» | ||
Juerd | m: my $*foo = "foo"; { $*foo = "bar"; $foo.say; }; $foo.say | 00:20 | |
camelia | rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/KnpcPCZYzXVariable '$foo' is not declared. Did you mean '$*foo'?at /tmp/KnpcPCZYzX:1------> 3my $*foo = "foo"; { $*foo = "bar"; 7⏏5$foo.say; }; $foo.say» | ||
Juerd | m: my $*foo = "foo"; { $*foo = "bar"; $*foo.say; }; $*foo.say | ||
camelia | rakudo-moar 720090: OUTPUT«barbar» | ||
Juerd | m: my $*foo = "foo"; { my $*foo = "bar"; $*foo.say; }; $*foo.say | ||
camelia | rakudo-moar 720090: OUTPUT«barfoo» | ||
ShimmerFairy | Juerd: unless I'm mistaken, in Perl 6 "dynamic scoping" refers to scoping according the the chain of callers (instead of outers), and has nothing to do with 'temp' :) | ||
Juerd | m: my $*foo = "foo"; sub x { $*foo.say }; { my $*foo = "bar"; x; }; x; | ||
camelia | rakudo-moar 720090: OUTPUT«barfoo» | ||
geekosaur | yes, they're two different kinds of "dynamic" | 00:21 | |
Juerd | m: my $foo = "foo"; sub x { $foo.say }; { temp $foo = "bar"; x; }; x; | ||
camelia | rakudo-moar 720090: OUTPUT«barfoo» | ||
Juerd | These features can be used to achieve the same effect. I don't know when you'd pick which. | ||
ShimmerFairy | m: sub x { $*foo.say }; { my $*foo = "bar"; x; } | 00:22 | |
camelia | rakudo-moar 720090: OUTPUT«bar» | ||
ShimmerFairy | m: sub x { $foo.say }; { temp $foo = "bar"; x; } | ||
camelia | rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EZ3JiPqnjLVariable '$foo' is not declaredat /tmp/EZ3JiPqnjL:1------> 3sub x { 7⏏5$foo.say }; { temp $foo = "bar"; x; }» | ||
geekosaur | I feel like $* is for control structures and temp is for automatic saving and restoring of values | 00:23 | |
ShimmerFairy | Juerd: ^ that's a situation where you need $* vars | ||
Juerd | Jargon is definitely an issue here: in Perl 5, "dynamic scope" is associated with "local", and in Perl 6, "temp" is documented to be like Perl 5 "local", but "dynamic scope" is something else. | ||
ShimmerFairy | (I see the 'temp' keyword for "temporary" things more than dynamic scoping ☺) | ||
Juerd | Through Perl 5, "temp" is also associated with the term "dynamic scope". | 00:24 | |
ShimmerFairy | Juerd: $* vars show up in regexes a lot in my experience, and I believe it's precisely because of the way they can quickly nest in complex ways; it lets you carry info through sub-rules, instead of through inner scopes like lexicals. | 00:25 | |
(keep in mind I could be wrong, I'm not too well-versed in dynamic variables. This is just what I've picked up over the years.) | |||
Juerd | A shared lexical with use of temp would do the same thing. Only it requires a code layout that has everything in the same file. | 00:26 | |
But you could use a global thing and temp, and then I don't really see much difference between the two anymore. | 00:27 | ||
ShimmerFairy | IIRC dynvars also carry into the action methods called by the grammar, which is really nice. | ||
Juerd | I know nothing about grammars yet. | ||
Or, more precisely: s/yet/anymore/ | |||
00:28
shinobi-cl joined
|
|||
shinobi-cl | hi all... | 00:28 | |
Juerd | Hello ShimmerFairy | ||
Argh, shi<tab> :( | |||
Sorry, ShimmerFairy and shinobi-cl | |||
Hello shinobi-cl | |||
shinobi-cl | Hi Juerd | ||
is there a way to pass a regex as a parameter to a sub? | |||
Juerd | Yes. | 00:29 | |
m: sub foo ($re) { $re.perl.say }; foo(/bar/); | |||
camelia | rakudo-moar 720090: OUTPUT«/bar/» | ||
ShimmerFairy | Juerd: admittedly, there's also something nice about how $*SPECIAL_INFO looks for information you pass down through calls :3 | ||
Juerd should really spend a week, maybe more, relearning Perl 6 | 00:30 | ||
I've learned Perl 6 too early and haven't kept up. | 00:31 | ||
Wrote hypothetical Perl 6 code in 2002, never wrote anything more than a oneliner with real Perl 6. | 00:32 | ||
Still should try how much of www.perlmonks.org/?node_id=179755 would work in real life. I expect a lot of rewriting to be necessary. | 00:33 | ||
ShimmerFairy | Juerd: first, there was a time when P6 regexes still looked P5-ish!? O_o (the (?: ... ) is what I noticed). And second, I happen to have an XML 1.1 parser in P6 I wrote not too long ago, I could gist it if you were interested. :) | 00:38 | |
skids | Well, similar stuff wored well enough for the Grammar::BNF package and ruoso's (not ecosystem yet) Grammar::EBNF package. | 00:39 | |
*worked | |||
skids should make sure BNF is still working | 00:41 | ||
shinobi-cl | r: my @a = <1 2 3 4 45 6>; sub regx(Regex $search) { @a.match($search); }; my $x = rx/4.*/; say regx($x); | ||
camelia | rakudo-{moar,jvm} 720090: OUTPUT«「4 45 6」» | ||
shinobi-cl | i love perl6 | 00:42 | |
r: my @a = <1 2 3 4 45 6>; sub regx(Regex $search) { @a.match($search); }; my $x = "4.*"; say regx($x); | 00:43 | ||
camelia | rakudo-{moar,jvm} 720090: OUTPUT«Type check failed in binding $search; expected 'Regex' but got 'Str' in sub regx at /tmp/tmpfile:1 in block <unit> at /tmp/tmpfile:1» | ||
shinobi-cl | r: my @a = <1 2 3 4 45 6>; sub regx(Str $search) { @a.match($search); }; my $x = "4.*"; say regx($x); | ||
camelia | rakudo-{moar,jvm} 720090: OUTPUT«Nil» | ||
shinobi-cl | r: my @a = <1 2 3 4 45 6>; sub regx(Str $search) { @a.match($search); }; my $x = "4"; say regx($x); | ||
camelia | rakudo-{moar,jvm} 720090: OUTPUT«「4」» | ||
ShimmerFairy | .tell jnthn I'm curious on your thoughts on the Stringy and Unicodey roles as mentioned in S15, I'd like to see them fleshed out finally :) (I have this S32::Str potential rewrite from some while ago featuring the two roles, if it helps: gist.github.com/lue/9941658 ) | 00:44 | |
yoleaux | ShimmerFairy: I'll pass your message to jnthn. | ||
00:44
mjgardner joined
|
|||
Juerd | ShimmerFairy: No, (?:...) has not existed in Perl 6 regexes as far as I know. That part is Perl 5 :) | 00:45 | |
geekosaur | not spelled that way | 00:46 | |
ShimmerFairy | Juerd: I didn't know P5 had rule foo { } back then, then :) | ||
geekosaur | but afaik it was always [] in p6 | ||
Juerd | ShimmerFairy: What I meant was, I wrote Perl 5 code in Perl 6. | ||
ShimmerFairy: That's the kind of mistakes one makes if there's no parser to tell you you're way off. | 00:47 | ||
ShimmerFairy | Juerd: ah, so that (?: ) in "rule xml :i {" was a mistake in typing? I understand :) | ||
Juerd | ShimmerFairy: Note that the *generated* P6 does have [] instead of (?:...) | ||
ShimmerFairy | (though there's always :P5 ... :P) | ||
00:48
laouji joined
|
|||
Juerd | ShimmerFairy: Also note that in the second part of the code that does (?:) in Perl 6, I did fix it... So at some point I must have known that it was wrong. | 00:48 | |
ShimmerFairy | Juerd: interestingly, the (?: ) only appear in your singleton alternation; the <foo>bar</foo> alternation uses [] :) | ||
Juerd | That | 00:49 | |
geekosaur | habits are hard to break? | ||
Juerd | Now... should I edit a post from 2002 or leave it be... | ||
ShimmerFairy | esp. in 2002 with no P6 implementation, I'd guess :) | ||
Juerd: depends on how obvious it is that it comes from 2002 and the land of no implementation. | |||
Juerd | ShimmerFairy: Pretty obvious. | ||
ShimmerFairy | Juerd: so I think at most you'd want to add a note at the top that says something like "UPDATE (someday 2015): Just pointing out that this post comes from long before there was even an implementation. Left as-is for historical interest." :) | 00:51 | |
Juerd: one more thing, about the <!after>s in your code, and your mention that they should be <!before>s: for PITarget, as an example, I specified token PITarget { <!before :i XML> <Name> } | 00:53 | ||
(I do recall there were parts of the EBNF grammar I couldn't quite grok, so there were a couple spots where I just went with my best guess. An EBNF converter would do better than me in those spots, I'd imagine :P) | 00:54 | ||
00:55
kst joined
|
|||
Juerd | I remember that PITarget is weird because the EBNF and the description disagree. The EBNF treats the letters individually, whereas the description only mentioned XML and xml. | 00:55 | |
ShimmerFairy: Rewriting things as <!before ...> is really hard, though. | 00:56 | ||
Perhaps Perl 6 just needs something like EBNF's - operator. | 00:57 | ||
ShimmerFairy | yeah, :i XML was simply a shorter way of writing something like <[Xx]> <[Mm]> <[Ll]> (so I went with the grammar's description) | ||
Juerd | - is used in two completely different ways in EBNF by the way | ||
foo - bar sometimes means that foo shouldn't match bar anywhere in it, whereas in other occasions it's anchored to whatever foo matched. | 00:58 | ||
ShimmerFairy | Juerd: I couldn't understand the <foo>* - (<foo>* <bar> <foo>) stuff, looking at the spec again. | 00:59 | |
00:59
yqt left
|
|||
ShimmerFairy | (oops, <foo>* for the last one too) | 00:59 | |
Juerd | That's the version with implicit anchoring | ||
So it allows any number of <foo>, where none of the <foo> is <bar>. | 01:00 | ||
It's unclear whether this should fail the entire subrule, or just stop whenever bar is encountered. | |||
Off to bed. Good localtime! | 01:01 | ||
ShimmerFairy | CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) for instance I turned into token CharData { [<!before "]]>"> <-[<&]>]* } | ||
♞ Juerd o/ | |||
looking at those "implicit anchoring" things, it seems to me like it's just a way of saying "stop when you see this", and not a case for failure (unless you can/want to let backtracking handle that stuff) | 01:03 | ||
So I think I was right in using <!before> like I showed above :) | |||
Juerd | Please put whitespace inside of []. Makes it much easier to read, especially in this case :) | 01:04 | |
I think you're right too. | |||
afk! | 01:05 | ||
ShimmerFairy | Juerd: sure, I think most of my rules are more readable than that btw :) | ||
skids | m: ("a","b")>>.chars.say; ("a","b")>>.ords.say | 01:15 | |
camelia | rakudo-moar 720090: OUTPUT«1 197 98» | ||
skids | hrm, that's broken locally. | ||
TimToady | broken how? | 01:16 | |
skids | The second one gives an empty list. | ||
b2gills | m: my \if = "hello"; say '', if if if; | 01:17 | |
camelia | rakudo-moar 720090: OUTPUT«hello» | ||
b2gills | m: my \if = "hello"; say if if if; | ||
camelia | rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EEuUJAePmtUnsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argumentat /tmp/EEuUJAePmt:1------> 3my \if = "hello"; say7⏏5 if if if;» | ||
skids | (or, ((), ()) to be exact) | ||
I only have one very unrelated mod in my codebase... | 01:18 | ||
TimToady | m: my \if = "hello"; say (if) if if; | 01:19 | |
camelia | rakudo-moar 720090: OUTPUT«hello» | ||
TimToady | the check for bare say is looking for terminators there, and 'if' is a terminator | 01:20 | |
(as are any statement modifiers) | |||
b2gills | You mean it looks like the terminator of the same name | ||
TimToady | right | ||
just as if you'd said say; | 01:21 | ||
m: my \if = "hello"; say for if if; | |||
camelia | rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kct0GkcdLNUnsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argumentat /tmp/kct0GkcdLN:1------> 3my \if = "hello"; say7⏏5 for if if;» | ||
skids tries to find the more detailed thing like $*PERL | 01:24 | ||
01:24
rmgk_ joined,
rmgk left,
rmgk_ is now known as rmgk
01:28
mjgardner left
|
|||
skids | Oh hah. $*PERL.gist--; | 01:28 | |
geekosaur | you wanted .perl? | 01:30 | |
skids | yeah it hid itself from me. | 01:31 | |
geekosaur | just one of those things you have to remember, .gist is often a short version | ||
skids | yeah. | ||
geekosaur | (not surprising to me given what "gist" means...) | 01:32 | |
01:32
mjgardner joined
|
|||
skids wonders why my version has dots and camelias doesn't (7200905 versus 6.c.3.d.63.b) | 01:33 | ||
OK my moar is newer. | |||
Heh. $*PERL.Str is even shorter than .gist. | 01:35 | ||
geekosaur | ...and after you said that, I was expecting just "6" or "6.0" | 01:36 | |
b2gills | m: say ~$*PERL | ||
camelia | rakudo-moar 720090: OUTPUT«Perl 6» | ||
TimToady | it puts dots in where there are letters, 7200905 has no letters | 01:38 | |
zostay | so, i've updated the P6SGI spec to v0.2.Draft, includes a number of typo fixes and small errors | 01:40 | |
i've made the major change of requiring Promise to be used in all cases... this, however, does break all existing implementations of PSGI-like servers and apps in Perl 6 | 01:41 | ||
i have not yet addressed the Channel versus Supply bit yet | 01:42 | ||
that will require a bit more thought and research.... i'm leaning toward Supply's but they are so flexible it is difficult to see a clear way to a solution | |||
01:44
ButterBalls joined
|
|||
ButterBalls | dSo. | 01:44 | |
So.... | 01:45 | ||
Perl6 can run in a different languages interpreter when compiled...? | |||
IE: .net, JVM, Dalvik | |||
skids | JVM yes, not the others yet. Well mono if you count older neicza. | ||
ButterBalls | So perl6 threw away the crappy interpreter that 5 had in favour of a well built one by Oracle? | 01:46 | |
Does this mean multithreading wont suck anymore? | 01:47 | ||
skids | Yes it is a ground-up rewrite. And multithreading is a top priority. | ||
ButterBalls | I just learned perl5 last year. | 01:48 | |
I do want to talk about the implications this will have. | |||
By using the JVM the userbase will be much bigger but when that happens malicious programs are wrote in these languages. Perl6 wont be an exception thanks to it's amazing file API's | 01:49 | ||
O | |||
I | |||
I'm just trying to understand why the JVM? | |||
gfldex | because jnthn++ had experience with that vm | ||
skids | Neither has Perl 5 been an exception to that, considering it used to e te primary language holding evrything together. | 01:50 | |
ButterBalls | >so is a loose precedence operator that coerces to Bool. The logical opposite of not, it returns a Bool with a preserved boolean value instead of the opposite one. | ||
gfldex | he seams to like moarvm better now tho | ||
ButterBalls | I am in love. | ||
my god. | |||
Perl6 has some great choices but I don't agree with all of them. | 01:51 | ||
geekosaur | I would imagine that given jvm support, clr support would not be that difficult (famous last words...) | ||
skids | .oO(OK so my issue is not the moarvm version... maye NQP.) |
||
ButterBalls | geekosaur, I would imagine that Dalvik and it's RT library would be used just like Java's | 01:52 | |
Imagine it. | |||
Perl6 on Android. | |||
No extra interpreter needed. | |||
I must ask the important question now. Does perl6 support perl5 regex's? | |||
skids | Through an adverb on rx//, yes. | 01:53 | |
m: say "aa" ~~ m:P5/a(?:a)/ | 01:54 | ||
camelia | rakudo-moar 720090: OUTPUT«「aa」» | ||
ButterBalls | Forgot to add, will perl5 scripts work fine in perl6? | ||
skids | Some of them, using Inline::Perl5 | 01:55 | |
b2gills | You may be able to write a small program that will work in both, Perl 5 and Perl 6 but it won't be worth it | ||
ButterBalls | It would. | 01:56 | |
I normally do my development in Java. | |||
Write once, deploy everywhere. | |||
(I never tie to system dependant behaviours) | |||
b2gills | The differences between Perl 5 and Perl 6 are about as different as the difference between C and D | ||
*C++ and D | 01:57 | ||
ButterBalls | M: say "hi" | ||
blargh | |||
why | |||
b2gills | lowercase m | ||
ButterBalls | Why name it perl then? | ||
Why not something like Perl2 | |||
gfldex | because it stole not just the name from perl 5 | ||
ButterBalls | m: say "hi" | ||
camelia | rakudo-moar 720090: OUTPUT«hi» | ||
ButterBalls | m: while(so 2/1==2){say ""} | 01:58 | |
camelia | rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/v24oNmvJHWUndeclared routine: while used at line 1» | ||
shinobi-cl | r: say ((1, 2, 3, 4, 5, 6) ~ (1, 2, 33, 4, 5, 6)) ?? "true" !! "false"; | ||
ButterBalls | I was wondering if that would work | ||
gfldex | and when Perl 6 was first discussed it was much closer to Perl 5 then to Perl 6 | ||
camelia | rakudo-{moar,jvm} 720090: OUTPUT«true» | ||
ButterBalls | What's the point of perl6 if perl5 will continue to be mantained | 01:59 | |
Why not just split off into an entire new version of perl. | |||
b2gills | What's the point when FORTRAN already exists? | ||
ButterBalls | Different purposes | ||
shinobi-cl | r: say ((1, 2, 3, 4, 5, 6) ~~ (1, 2, 33, 4, 5, 6)) ?? "true" !! "false"; | ||
camelia | rakudo-{moar,jvm} 720090: OUTPUT«false» | ||
gfldex | what's the point of c++ if c is continued to be maintained? | ||
ButterBalls | r say @_; | y | 02:00 | |
gfldex, different purposes | |||
skids | ButterBalls: Perl "6" is an entriely new "version" of perl :-) | ||
gfldex | exactly | ||
ButterBalls | r: say @_; | y | ||
camelia | rakudo-{moar,jvm} 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfileCannot use placeholder parameter @_ in the mainlineat /tmp/tmpfile:1------> 3say @_7⏏5; | y» | ||
ButterBalls | do things like @_ behave like before? | ||
TimToady | sometimes | ||
b2gills | m: sub p5example { say @_ }; p5example 'hello' | 02:01 | |
camelia | rakudo-moar 720090: OUTPUT«hello» | ||
skids | ButterBalls: since you know Perl 5, you may want to start here: doc.perl6.org/language/5to6 | ||
gfldex | the sane Perl 5 oddities tend to work in Perl 6 | ||
ButterBalls | So I assume I have access to the entire JVM RT.jar? | 02:02 | |
b2gills | m: say (<a b> Xx ^9).perl | ||
camelia | rakudo-moar 720090: OUTPUT«("", "a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", "aaaaaaaa", "", "b", "bb", "bbb", "bbbb", "bbbbb", "bbbbbb", "bbbbbbb", "bbbbbbbb")» | ||
skids | ButterBalls: I'm not sure where JVM interop is at, implementation-wise. | 02:03 | |
ButterBalls | " | ||
Space is required immediately after keywords" | |||
no. | |||
just no. | |||
skids | Yep. | ||
ButterBalls | no. | ||
TimToady | there are reasons | ||
ButterBalls | I will write an entire cleaning tool to avoid that. | ||
TimToady | having to do with extensibility | ||
ButterBalls | I will write a tool to prep code so it's valid just to NOT have to add that space. | 02:04 | |
my god. | |||
TimToady | that's just silly | ||
it's more readable with the space, you're just not used to it | |||
ButterBalls | I am coming from java | ||
TimToady | you can leave out the parens | ||
ButterBalls | while(true) is more common than while (true) | ||
TimToady | while true is more better | ||
ButterBalls | I find the parens help | 02:05 | |
02:05
dayangkun joined
|
|||
ButterBalls | (readability wise) | 02:05 | |
TimToady | not really, if you linebreak nicely | ||
skids | Well, "loop" is better than "while True" :-) | ||
ButterBalls | "$ Scalar | ||
The $ sigil is now always used with "item" variables (e.g. $name), and no longer for array indexing and Hash indexing. That is, you will still use $x[1] and $x{"foo"}, but you use them on $x, not @x or %x." | |||
Whoever chose that deserves a pizza. | 02:06 | ||
$x[<pointer] is something that I love. | |||
TimToady can't eat pizza... | |||
b2gills | That was a **very** early decision from what I've read | 02:07 | |
ButterBalls | I'm trying to understand "&" | ||
so $x = &funcname | |||
TimToady | it's now just a noun marker | ||
ButterBalls | Just typing $x will trigger &funcnanme? | ||
b2gills | & is used the same way you would use it in Perl 5 ( for the most part ) | ||
skids | Butterballs: no, $x() | ||
b2gills | $x would be a reference to the subroutine ( in Perl 5 speak ) | 02:08 | |
TimToady | just as &foo will not call, but &foo() will | ||
ButterBalls | skids, So I can dynamically assign $x to functions by going $x = &func to call $x() to trigger &func | ||
skids | Yes. | ||
ButterBalls | So $x(params) is valid? | ||
TimToady | sure | ||
except we usually call those args | |||
ButterBalls | I am loving perl6 | ||
TimToady | and reserve params for the formals | ||
b2gills | m: for &[+], &[-] | ||
camelia | rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/eDUefNJa7PMissing blockat /tmp/eDUefNJa7P:1------> 3for &[+], &[-]7⏏5<EOL> expecting any of: block or pointy block» | ||
ButterBalls | These little changes make the language much easier to work with | 02:09 | |
skids | m: my $x = { $_ .say }; $x("hi"); $x = { 42.say }; $x(); | ||
camelia | rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Ceb07PZysGTwo terms in a rowat /tmp/Ceb07PZysG:1------> 3my $x = { $_7⏏5 .say }; $x("hi"); $x = { 42.say }; $x() expecting any of: infix infix stopper statemen…» | ||
shinobi-cl | how can i generate a list starting with 1, then 4, then 7,...up to 64? | ||
TimToady | m: say 1,4,7...64 | ||
camelia | rakudo-moar 720090: OUTPUT«1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64» | ||
b2gills | m: for &[+], &[-], &[*] -> &func { say func 4,5 } | ||
camelia | rakudo-moar 720090: OUTPUT«9-120» | ||
ButterBalls | Perl6 is about concistency isn't it? | ||
gfldex | m: my @a.push(sub {42},sub {43}, sub {44}); say @a>>.(); | ||
camelia | rakudo-moar 720090: OUTPUT«42 43 44» | ||
skids | m: my $x = { $_.say }; $x("hi"); $x = { 42.say }; $x(); | 02:10 | |
camelia | rakudo-moar 720090: OUTPUT«hi42» | ||
shinobi-cl | i see.. I was using " .. " :( Thanks! | ||
skids | ButterBalls: It is "strangely consistent" :-) | ||
TimToady | ButterBalls: there's certainly more consistency than P5 | ||
but you can't be consistent in all dimensions at once | 02:11 | ||
ButterBalls | so % allows you to call a object from a 2d @ by it's name? | ||
so @t["apple", "pear"] = qw("good", bad"); | |||
%t["apple"] = "good"? | |||
b2gills | %t{'apple'} | ||
skids | No. @ is only for positionals. | 02:12 | |
ButterBalls | b2gills, sorry about syntax but the idea is right? | ||
skids, ok | |||
TimToady | you can slice either arrays or hashes, and either can be multidimensional, but then you use ; instead of , | ||
ButterBalls | I'm still trying to understand some Syntax changes but it seems to be pretty straight forward | 02:13 | |
How is performance? | |||
Especially for GUI | |||
dalek | kudo-star-daily: 9b3538e | coke++ | log/ (9 files): today (automated commit) |
||
skids | Really it is the [ and { and ( that decide what happens, more than the $ @ or % | ||
gfldex | performance heavily depends on what you do | 02:14 | |
ButterBalls | I'm thinking of porting a NES emulator to Perl6 | ||
I want to see how feasble it is. | |||
(coming from Java) | |||
b2gills | Considering a faithful NES implementation in C/C++ maxes out a modern processor, I wouldn't hold my breath | 02:16 | |
ButterBalls | b2gills, You think I'm going for perfect hardware accuracy? | 02:17 | |
huehuehue | |||
b2gills | In Perl 6 normal operators are subroutines, and subroutines are objects, it will require a smart implementation to make it fast enough for an emulator. | 02:19 | |
ButterBalls | But to be honest the issue with maxing out the CPU ois due to the overhead of the OS | ||
02:19
mjgardner left
|
|||
b2gills | It has more to deal with implementing custom ASICs, and a whole other processor in software | 02:20 | |
ButterBalls | b2gills, I know | ||
TimToady | we're getting faster, but we don't know how fast we'll get eventually | ||
ButterBalls | The issue is timing. | ||
b2gills | I just read an article about it | 02:21 | |
ButterBalls | I was implimenting a 6502 (the NES custom A02 one) on a Arduino Uno. | ||
skids | Yeah "».ords" broke sometime after NQP 70f65eb. | ||
ButterBalls | The issue was the lack of memory so paralell ram was going to be used. | ||
Implimeting a proccesor in software is quite simple. Implimenting it's timing isn't. | 02:23 | ||
Microsoft cheated though. | |||
FWIU: 360 on One uses a JIT interpreter that hooks every API call and remaps them to the local system API | 02:24 | ||
The issue though will be that the 360 was cell, not x86. | |||
Cell is known for it's math capabilities. | |||
Even to date the proccessor in the ps3 is stupidly fast at math thanks to the PPU's vs x86 | 02:25 | ||
The issue is you can't really write a JIT in Perl | |||
02:26
shinobi-cl left
|
|||
ButterBalls | b2gills, make sense? | 02:26 | |
Instead of interpreting why not boil it down to instructions the host proccessor can simply interpret directly? | 02:27 | ||
Dolphin does it. | |||
RPCS3 (that's how you spell it IIRC) does it with PS3 games | |||
b2gills | I'm currently watching TV | 02:29 | |
ButterBalls | heh | 02:30 | |
skids | ButterBalls: do you like working on JIT stuff? | ||
ButterBalls | b2gills, TL;DR: JIT = Magic | ||
b2gills | The cell processor did seem to be a very interesting design | ||
ButterBalls | skids, personally no. | 02:31 | |
Just studying | |||
skids | Ah. Well if you want to keep track of moarvm's for study purposes, follow brrt++ | 02:32 | |
brrt-to-the-future.blogspot.nl/2015...ilers.html | |||
ButterBalls | I want Perl6 on Android. | ||
Ideally you shouldn't do a serial multiplication on bigger numbers but break them down to multiple cores to do in paralell | 02:33 | ||
Well not multiplications but certain pieces of math can be done in parallel much faster | 02:34 | ||
skids | I don't know if dalvik will come first for Android or webassembly. But for now the goal is at least a MoarVM (and maybe JVM) 6.0 RC by Christmas. | ||
ButterBalls | For now I'll continue to develop with Perl5 and play with Perl6. | ||
I also use Java, and Python | 02:35 | ||
b2gills | m: say [+] 1..10 # this could be done in parallel | ||
camelia | rakudo-moar 720090: OUTPUT«55» | ||
ButterBalls | WebAssembly should be ignored for now. | ||
It's still to early to call it standardized. | |||
Right now I'm not sure what to do. | 02:37 | ||
Sgeo | I'm a bit of a language exploration addict, although I can't remember when I wrote anything real with any language :( | ||
ButterBalls | Sgeo, I am a tinkerer. | ||
If it's wrote in Java I will shred it. | |||
I want to know what makes it tick. | |||
Sgeo | But I rejected PErl5 but am fascinated by Perl6 | ||
02:38
mr-foobar left,
gfldex left
|
|||
ButterBalls | Perl6 on Debian is slow. | 02:39 | |
painfully slow. | |||
Sgeo | I wonder which lens usescases P6 can meet and which ones it might struggle with | ||
02:41
mr-foobar joined
|
|||
TimToady | ButterBalls: there are several reasons for that, all of which we're hoping to fix in the next month or two | 02:41 | |
02:41
noganex_ joined
|
|||
TimToady | well, most of which, anyway | 02:42 | |
b2gills | Java was slow once too | 02:43 | |
02:44
noganex left
02:46
ButterBalls left
02:48
ButterBalks joined
|
|||
ButterBalks | Perl6 hung my computer. | 02:49 | |
/yaaaay/ | |||
02:50
dayangkun left,
dayangkun_ joined
|
|||
ButterBalks | yay | 02:50 | |
b2gills | I've done that before too | 02:53 | |
It is very easy to create an infinite loop `[+] 0..Inf` | 02:55 | ||
02:56
ButterBalks left
|
|||
skids | .tell timotimo NQP 808ce0fcb broke ("a","b")».ords for some reason. | 02:56 | |
yoleaux | skids: I'll pass your message to timotimo. | ||
03:05
kaare_ joined
03:14
TimToady left
03:16
TimToady joined
03:38
pc2046 joined
|
|||
pc2046 | hello | 03:38 | |
skids | o/ | ||
03:39
dayangkun_ left
|
|||
flussence | .oO( it's funny when someone inadvertently reveals their PHP background, by complaining about any other language for not sharing its "unique" built in memory/runtime limits :) |
03:40 | |
03:44
nys left
03:45
dayangkun_ joined
|
|||
b2gills | pc2046: Anything in particular you want to discuss? | 03:51 | |
TEttinger | pearl earrings | 03:52 | |
perl errings | |||
b2gills | One reason its not spelled with the "a" is there was already a language called Pearl | 03:54 | |
TEttinger | heh | ||
Praal | |||
Purl, Pirl, Purrel | 03:55 | ||
purr wouldn't be a bad name for a convenience library in perl. but I've been watching too much of these darn kitten cams livestream.com/tinykittens/tip | 03:57 | ||
then again, that implies there's something that perl needs a convenience library for | 03:58 | ||
pc2046 | I have developed perl project for more than 10 years, one technique that I adopt is store all perl processes and components into database, evaluate them and parse the result to the main for display, I am not sure if perl 6 would affect my component based evaluation type of programming | 03:59 | |
originally, I want to have central big business-core server/platform, that every perl projects can just reference to the correct version from the central server, either with assign version or upgrade version | 04:01 | ||
I think to store "pm" on every server is a quite old-fashioned | |||
say, old way is: use ABC::def; new way could be just use 123.123.123.123::ABC::def {v=1,update_local=false}; | 04:05 | ||
skids | pc2046: you should probably be able to make a custom CompUnitRepo that uses your database. | 04:10 | |
pc2046 | that is a very good idea | 04:12 | |
ugexe | thats cloudpan | ||
skids | pc2046: design.perl6.org/S11.html and design.perl6.org/S22.html are the design docs for packaging. More of S11 is actually implemented than S22 yet. | 04:14 | |
pc2046 | Skids, your information is useful. | 04:18 | |
04:39
skids left
05:01
schmooster joined
05:15
pc2046 left
05:26
mr-foobar left
05:33
xinming joined
05:44
rurban joined
05:53
diana_olhovik_ joined
06:03
AlexDaniel left
06:11
araujo joined,
araujo left,
araujo joined
06:13
jjido joined
06:23
oetiker left
06:24
oetiker joined
06:25
gfldex joined,
rurban_ joined
06:27
llfourn joined
06:41
rurban left
06:42
rurban joined
06:57
domidumont joined
07:00
ShimmerFairy left
07:01
domidumont left
07:02
domidumont joined
07:06
telex left
07:07
jjido left,
FROGGS joined
07:08
telex joined
07:11
llfourn left
07:13
ShimmerFairy joined
07:17
darutoko joined
07:19
yeahnoob joined
07:21
labster left
07:26
domidumont left
07:33
mr-foobar joined
07:44
mrf joined
|
|||
dalek | kudo/nom: 1c76b58 | TimToady++ | src/Perl6/Grammar.nqp: Parse with/without as either control or modifier |
07:49 | |
kudo/nom: b620a37 | TimToady++ | src/ (3 files): implement with/without modifiers |
|||
kudo/nom: 2623525 | TimToady++ | src/ (4 files): get new orelse/andthen to do assignops |
|||
TimToady | note that the statement control with/without are still just testing boolean | 07:50 | |
FROGGS | o/ | 07:51 | |
07:51
RabidGravy joined
|
|||
TimToady | the statement modifiers are testing definedness, but still need to topicalize non-block expressions | 07:51 | |
jobs for tomorrow... | 07:52 | ||
TimToady --> sleep & | |||
07:53
yeahnoob left
07:54
mr-foobar left
|
|||
jdv79 | nice | 08:04 | |
08:10
llfourn joined
08:11
rurban left
08:14
rurban joined
08:15
domidumont joined
08:16
rindolf joined
08:17
laouji left
08:18
laouji joined
08:21
domidumont left
08:22
laouji left,
laouji joined
|
|||
nwc10 | top entry currently on planetpython.org/ is "Python 4 Kids" | 08:24 | |
I misparsed that the first time. | |||
08:29
brrt joined
|
|||
jnthn | Yes, that parses two ways... :) | 08:38 | |
yoleaux | 00:44Z <ShimmerFairy> jnthn: I'm curious on your thoughts on the Stringy and Unicodey roles as mentioned in S15, I'd like to see them fleshed out finally :) (I have this S32::Str potential rewrite from some while ago featuring the two roles, if it helps: gist.github.com/lue/9941658 ) | ||
nwc10 | jnthn: is it Friday? | 08:41 | |
how about now? | |||
:-) | |||
RabidGravy | it is now | ||
nwc10 | oh gosh, I'm almost halfway to POETS | 08:42 | |
jnthn | nwc10: Well, going to take on lazy/eager/hyper/race at least somewhat first. | 08:43 | |
08:44
rurban left,
[Tux] joined
08:45
rurban joined
|
|||
RabidGravy | nwc10, or we could arbitrarily define beer o'clock as 12 and you're almost done ;-) | 08:57 | |
nwc10 | that late? :-) | ||
08:57
espadrine left
|
|||
jnthn | The term "known infinite" is now resting. Updated everywhere that matters in gist.github.com/jnthn/aa370f8b32ef98e4e7c9 to talk about an iterator considering itself lazy instead | 09:00 | |
sergot | oh hai #perl6 \0 | 09:03 | |
jnthn | o/ sergot | 09:04 | |
RabidGravy | erp | 09:08 | |
09:13
Sqirrel left,
[Tux] left
|
|||
jnthn | yay, my lazy impl worked first time | 09:14 | |
Working out a nice really simple test case for lazy was fun | |||
Turns out that the best one is: | |||
RabidGravy | nwc10, as a further inducement it's International Beer Day | ||
jnthn | my @a = 1, 2; | ||
my @b = lazy @a; | |||
say @b[0]; # 1 | |||
@a[1] = 42; | |||
say @b[1]; # 42 | |||
Becuase lazy means we don't actually copy from @a until we really need to | 09:15 | ||
09:15
virtualsue joined,
Sqirrel joined
|
|||
jnthn | Note that it's not binding, still assignment, so: | 09:15 | |
@a[1] = 0; | |||
say @b[1]; # 42 still, 'cus the bondage is broken once the assignment gets done | |||
I...guess I can't wait to see what evil people actually do with these semantics :P | 09:16 | ||
ShimmerFairy | jnthn: looks nice. I'd hope that in most cases it's not unobvious where 'lazy' things come up :) (though I suppose there's always the possibility of forcing something to be eager if you're paranoid) | ||
nine | jnthn: that's neat :) | ||
jnthn | ShimmerFairy: The only things that default to lazy are all typically immutable in nature | 09:17 | |
09:17
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
nine | jnthn: not in a strict sense. A file can be changed while one is iterating with lines() | 09:17 | |
09:18
espadrine joined
|
|||
jnthn | nine: "in nature" was my get-out clause for that :) | 09:21 | |
nine | I thought "typically" was ;) | 09:22 | |
jnthn | Always have backups! | ||
ShimmerFairy | the prudent thing would of course be to do shell("cp $file $file.mine"); for "$file.mine".lines { } :P | 09:24 | |
jnthn | Darn it. I've an off-by-one somewhere... | 09:31 | |
Doing @a[2] actually reifies 4 things, not 3... | |||
oh, it was an off-by-reified error... | 09:34 | ||
nwc10 | order 1 beer, get 2? | 09:37 | |
jnthn | Well, if you'd reified two beers first, you'd have ended up with 5 when asking for the third one... :) | 09:39 | |
And I'm not sure "it's happy hour!" is going to fly in RT :P | |||
09:39
brrt left
|
|||
jnthn | (It got fixed, working on eager now) | 09:39 | |
09:40
pRiVi joined
|
|||
dmitri | I am looking for an example of use of "package" keyword in Perl 6, but I cannot find it. | 09:40 | |
Is there some code that says package Foo { ... }?? | 09:41 | ||
jnthn | dmitri: We don't tend to use "package" in Perl 6, but rather module/class/grammar | ||
RabidGravy | however the BSON module does use it, I was looking at it yesterday | 09:42 | |
dmitri | jnthn: I realize that -- this is what the docs say. However, it seems that it *can* be done. | ||
BSON? | |||
dmitri looks | |||
jnthn | dmitri: It can, but you'll not get various bits of conflict detection | 09:43 | |
m: package Foo { }; package Foo { }; | |||
camelia | ( no output ) | ||
jnthn | m: module Foo { }; module Foo { }; | ||
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/gCzZWGWKvbRedeclaration of symbol Fooat /tmp/gCzZWGWKvb:1------> 3module Foo { }; module Foo7⏏5 { }; expecting any of: generic role» | ||
RabidGravy | but in summary | ||
dmitri | RabidGravy: thank you very much! | ||
RabidGravy | m: package Foo { our $Bar = "hjs" }; say $Foo::Bar | ||
camelia | rakudo-moar 262352: OUTPUT«hjs» | ||
dmitri | The reason I am looking for it is that I missed this keyword in ctags parser of Perl 6 and I wanted some examples. Now I have them. This is good. | 09:45 | |
jnthn | Aha :) | ||
RabidGravy | jnthn, isn't that "non-confliction" actually a reason to use it, so you can use it in more than one file for instance? | 09:48 | |
though | |||
09:48
spider-mario joined
|
|||
RabidGravy | m: package Foo { class Bar {} }; package Foo { class Bar {}} | 09:48 | |
camelia | rakudo-moar 262352: OUTPUT«===SORRY!===Could not locate compile-time value for symbol Bar» | ||
RabidGravy | is a bit odd | 09:49 | |
jnthn | RabidGravy: Well, we use it for stubbing int he compiler too | ||
m: class A::B { }; class A { } # this works since A starts out as a package after the first decl | 09:50 | ||
camelia | ( no output ) | ||
09:50
virtualsue left
10:00
brrt joined,
virtualsue joined
|
|||
nwc10 | [ptc]: do you happen to know what the ticket price was for Pycon Europe? I can't find it online any more | 10:00 | |
of course I can *now* :-) | 10:01 | ||
actually, that's On-Desk rate that I can find. I guess "Standard Rate" was a bit lower than "Personal: EUR 440 (for people enjoying Python from home)" | 10:02 | ||
[ptc] | nwc10: I'll just go check, hang on a tick | 10:03 | |
nwc10: 255Euro was the normal price (i.e. not the On-Desk or Early Bird tickets) | 10:07 | ||
nwc10: hth | |||
brrt | what does 'On-Desk' refer to? | ||
[ptc] | brrt: when one turns up to the conference without buying tickets online beforehand | 10:08 | |
brrt | ah, ok | ||
but they're still pre-selling the tickets? weird... | |||
[ptc] | no, the conference is over | ||
brrt | oh, right :-) | 10:09 | |
10:09
[Tux] joined
|
|||
[ptc] | and they stopped selling normal tickets a couple of days before the conference | 10:09 | |
jnthn | Giving people a strong incentive to buy their ticket before they show up is rather helpful from an organizational perspective. :) | ||
jdv79 | is there any way to interp the type name on the LHS of .? | 10:11 | |
my $c = "A"; $c.new kinda thing | |||
jnthn | ::($c) | 10:14 | |
Not just for LHS of . | |||
jdv79 | explains why i coudln't find it whtn looking at method calls docs | 10:15 | |
:( | |||
thanks! | |||
jnthn actually wrote a test for my $i = 0; my @a = lazy eager loop { last if $i == 5; $i++ }; | 10:16 | ||
nine | A lazy eager loop? | ||
jnthn | Yeah. | ||
nine | Where's the difference to my @a = lazy [ 0, 1, 2, 3, 4, 5 ];? | 10:17 | |
10:17
eternaleye joined
|
|||
jnthn | gist.github.com/jnthn/aa370f8b32ef98e4e7c9 updated with lazy/eager | 10:17 | |
nine: See the comment I wrote above the final test in gist linked above | 10:18 | ||
nwc10 | [ptc]: that was the normal business price? (I'm guessing that your work paid for you) | 10:20 | |
10:20
danstoner joined
10:21
Grrrr joined
|
|||
nine | Aah...a lazily started eager loop so to speak | 10:22 | |
RabidGravy | lazy eager is "really likes the idea of doing it, but in reality can't be bothered" | ||
jnthn | "I'm not going to do anything, unless you make me, and then I'll do EVERYTHING just to show you!" | 10:24 | |
10:25
kaare_ left
10:31
kaare__ joined
|
|||
RabidGravy | :) | 10:31 | |
sounds like me most of the time TBH | |||
jnthn | Mostly I'm glad that the test I wrote did exactly what I expected without having to tweak anything | ||
Anyway, I'm happy we have a well-defined meaning of lazy/eager now. I don't know we've had that so clearly before. | |||
10:31
nwc10_ joined
|
|||
jnthn | OK, hyper and race...these will be hard | 10:31 | |
jdv79 | and awesome! | ||
RabidGravy | m: use NativeCall; class Foo is repr('CStruct') { has CArray[num32] $.foo is rw; } say Foo.new(foo => CArray[num32].new); # is that simply NYI or intentional? | ||
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/J_QhMBhHEqStrange text after block (missing semicolon or comma?)at /tmp/J_QhMBhHEq:1------> 3uct') { has CArray[num32] $.foo is rw; }7⏏5 say Foo.new(foo => CArray[num32].new);  expecting an…» | ||
RabidGravy | m: use NativeCall; class Foo is repr('CStruct') { has CArray[num32] $.foo is rw; }; say Foo.new(foo => CArray[num32].new); # is that simply NYI or intentional? | ||
camelia | rakudo-moar 262352: OUTPUT«Cannot modify an immutable NumTypedCArray[num32] in block <unit> at /tmp/upJjqhtPuB:1» | 10:32 | |
RabidGravy | rather | ||
jnthn | looks odd to me | ||
RabidGravy | or, at option, a bug | ||
jnthn afk for a bit to do design work on hyper/race | |||
10:32
rurban left
|
|||
jdv79 | lets say I want A.new to return a A::B obj - how? | 10:40 | |
how best i mean | |||
in p5 i can just bless into A::B | |||
10:41
[TuxCM] left
10:42
tommi joined
10:45
Sqirrel left,
araujo left,
pyrimidine left,
Woodi_ left,
pecastro left,
ilbot3 left,
Khisanth left,
schmooster left,
silug_ left,
vytas left,
krunen left,
ingy left,
bobkare left,
f3ew left,
freeze left,
vike left,
aborazmeh left
10:47
nwc10_ is now known as nwc10
10:48
[Tux] left,
[Tux] joined
10:49
Sqirrel joined,
araujo joined,
schmooster joined,
pyrimidine joined,
Woodi_ joined,
pecastro joined,
ilbot3 joined,
Khisanth joined,
silug_ joined,
vytas joined,
krunen joined,
ingy joined,
bobkare joined,
f3ew joined,
freeze joined,
vike joined,
krakan joined,
MilkmanDan joined,
felher joined,
slavik joined,
Guest90936 joined,
maddingue joined,
ab5tract_ joined,
mls joined
10:51
hobbified left,
chansen_ left
10:52
hobbs joined
10:53
chansen_ joined
10:57
freeze left
10:59
freeze joined
11:01
Sqirrel left
|
|||
[ptc] | nwc10: no, that was the personal price | 11:01 | |
nwc10: I paid 340 for early bird business price, but since work didn't end up paying for me, I converted the ticket into a personal one | 11:02 | ||
nwc10 | ah OK thanks. that's doubly useful | ||
11:03
Sqirrel joined
11:04
rurban joined
11:05
danaj joined
|
|||
jdv79 | 'A::B' cannot inherit from 'A' because it is unknown - even with require? | 11:07 | |
11:08
rurban_ left
|
|||
jnthn | require is runtime, inheritnace is compile time | 11:09 | |
jdv79 | no way around that? | 11:11 | |
jnthn | Use "use"? | 11:12 | |
Do the require at BEGIN time? | |||
jdv79 | well, the use doesn't work cause its in A | 11:13 | |
that's why i tried require | |||
jnthn | However you slice it, though, the thing you're inheriting from has to be available to the compiler by the time it sees the "is A" | ||
jdv79 | hmm, i thought that sort of cycle would be handled well | 11:16 | |
jnthn | That Perl 6 does one pass parsing goes pretty deep. | ||
jdv79 | painfully | 11:17 | |
hope it worth it | |||
*its | |||
jnthn | Well, it tends to force you to think out your dependencies better. | 11:18 | |
itz | [ptc]: *cough* the cricket ;) | ||
jdv79 | except it forces architecture patterns but ok | ||
jnthn | On hyper/race, my current thinking is that we're going to need some amount of "contaigous" behavior on it | ||
jdv79 | just not as perlish as i'm used to | ||
viral ? | 11:19 | ||
jnthn | That is, once you opt in to hyper then things downstream of it will be too | ||
my $max = @climate-files.map(&parse).hyper().map(&normalize).grep(*.continent eq 'Europe').max(*.yearly-average); | 11:21 | ||
ShimmerFairy | jnthn: if that's the case, would there be room for some sort of "I can wait" piece in the stream? (Like, say, @list».foo.bar.baz.«wait-to-do-this ) | ||
jnthn | I think .hyper() and .race() cannot be quite like .eager() | 11:22 | |
We want them to go deep so we can do pipeline-y things | |||
And also we want to be able to do parallel reduce (max, min, etc.) too | |||
Trouble is I don't like the visaul off-by-one I'm seeing too | 11:24 | ||
In that in the one I just wrote above, the hyper() would parallelize the thing that is to the left of it AND those to the right | |||
I'm wondering if that one should be written | 11:25 | ||
my $max = @climate-files.hyper().map(&parse).map(&normalize).grep(*.continent eq 'Europe').max(*.yearly-average); | |||
I think previously we might have imagined that | 11:26 | ||
ShimmerFairy | jnthn: honestly, I thought that hyper() only affected everything after it. (would correlate with ». at least) | ||
jnthn | hyper for @xs -> $x { } # just @xs.map({...}).hyper.sink | 11:27 | |
But that we may want the compiler re-write to be | |||
hyper for @xs -> $x { } # just @xs.hyper().map({...}).sink | |||
ShimmerFairy: Yes, that would be your first guess reading the code, and I think we probably want to make that how it is | |||
It *is* a departure from earlier thinking, where hyper and race were just forms of eager | 11:28 | ||
The trouble with putting it on the end is it doesn't work out for things that leave the monad | |||
Like reduce | |||
ShimmerFairy | I think it'd make more sense for .hyper and .race to say "from this point on, things run in parallel" (as though it were actually .hyper(stuff) instead of .hyper.stuff, in a sense) | ||
jnthn | Yeah | ||
Until you call something that doesn't know how to play within the paradigm | 11:29 | ||
So basically .hyper() and .race() return a HyperSeq, and multi-dispatch picks parallel implementations of .map, etc. | |||
JimmyZ thinks it is DWIM # about race/hyper contagious | 11:30 | ||
jnthn | And that way it can pick a parallel implementation of .reduce too, for example | ||
ShimmerFairy | jnthn: would this affect the fact that you sometimes end up with @list».foo».bar».baz , or would it just affect the use of .hyper ? | ||
jnthn | ShimmerFairy: It depends what >>.foo is meant to return | 11:31 | |
ShimmerFairy: If it can return a HyperSeq than we'll get the opportunity to pipeline. | |||
Which TimToady++ really wants | |||
(And me too!) | 11:32 | ||
ShimmerFairy | Personally multiple ». has always felt a bit strange to me, and almost seems like it should be a sign of multidimensionality (that is, the example line I gave maybe sorta reads like for @list { for $_.foo { for $_.bar { ... ) | ||
jnthn | Cache locality is everything. | ||
Well, with what we're discussing here, it becomes sugar for .hyper().deepmap(*.foo) | 11:33 | ||
Writing a parallel deepmap will be a headache-inducing... | |||
ShimmerFairy wonders if HyperSeq would look a bit Junction-y in spots... | |||
jnthn | No | 11:34 | |
It'll be incredibly boring | |||
Like Seq is | |||
[ptc] | itz: please remember that I'm a New Zealander ;-) | 11:35 | |
jnthn | (New Zealand)++ # beautiful scenery AND craft beer | 11:36 | |
ShimmerFairy | jnthn: Yeah, I suspected we wouldn't suddenly be introducing a new non-Any type at this point, I was just reminded of autothreading for some reason :) | ||
[ptc] | itz: it's nice to see the Aussies lose for once :-) They were too powerful a force in cricket for so long | ||
jnthn: Summer Ale is *very* yummy | 11:37 | ||
jnthn | Also, hyper whenever $supply -> $x { ... } really, really wants the $supply to be affected for a clean desugar | ||
So making hyper for work the way I suggested will make it be exactly the right operation on hyper whenever. | |||
I...guess hyper/race are statement prefixes... | 11:38 | ||
Only trouble is what hyper @foo.map(*.bar) means, which if it just calls .hyper on the end result will not be good. | |||
[ptc] | itz: but 60/10 in one innings in test cricket is a whipping! I believe only the Kiwis have played worse... | ||
ShimmerFairy | I feel like hyper and race are more "deliberate" than eager/lazy. eager/lazy feel like something you'll naturally encounter often (and perhaps not always need to think about), while hyper/race feel like they'll only usually happen when you specifically ask for it. | 11:39 | |
jnthn | Oh, for sure... >>.foo is just a succinct way of asking for it :) | ||
Maybe for now we conservatively only support hyper/race statement prefixes on for and whenever... | 11:40 | ||
I think most people setting up pipelines will do it with the methods | 11:41 | ||
11:41
spider-mario left
11:43
jferrero joined
|
|||
ShimmerFairy | »» for race, obviously :P (I did stumble upon an old specs revision today that mentioned »» as a possible deepmap-ing hyper) | 11:44 | |
jnthn | It's funny that hyper and race share almost exactly the same code until the end when you're about to hand back a buffer, and with hyper you have to check if it's the right sequence number :) | 11:45 | |
Anyway, will ponder some more over lunch, but I think we're sorta converging on something workable. | |||
jdv79 | ha. the OO hierarchy seems to work as i wanted. i forgot to use the parent in the child:( | ||
jnthn | jdv79: phew...so it's not as bad as you feared... :) | 11:46 | |
ShimmerFairy | jnthn: so, hyper is just .race(:who'sin1st) ? :P | ||
jdv79 | my assumption about the error being related to the deps was not 100% corret ^H | 11:47 | |
11:47
laouji left
|
|||
jdv79 | jnthn: seems so. nice. | 11:47 | |
brrt | jnthn: we want to do SIMD over hyper, don't we? | 11:50 | |
11:51
[TuxCM] joined
11:56
timotimo left
12:02
Sqirrel left
12:10
dayangkun_ left
12:12
Sqirrel joined
12:16
Sqirrel left
12:21
Sqirrel joined
|
|||
[Coke] | jnthn: typo of "Corret" in one place in the glr gist. | 12:22 | |
12:25
TEttinger left
12:28
timo joined,
timo is now known as Guest16283,
Guest16283 is now known as timotimo
12:34
cognominal joined
12:36
lucasb joined
12:38
yqt joined
|
|||
lucasb | m: multi f($,$,$,$,$,$) {}; f | 12:47 | |
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/nhKVACBKCSCalling f() will never work with any of these multi signatures: ($,,,,,)at /tmp/nhKVACBKCS:1------> 3multi f($,$,$,$,$,$) {}; 7⏏5f» | ||
lucasb | lost the anonymous scalars somewhere down the road | 12:48 | |
12:48
pmurias joined,
dmitri left
|
|||
pmurias | hi | 12:49 | |
tony-o | hi | 12:54 | |
12:54
AlexDaniel joined
|
|||
RabidGravy | erk | 12:55 | |
Program received signal SIGSEGV, Segmentation fault. | |||
0x00007ffff7b210c6 in MVM_frame_find_lexical_by_name () from /home/jonathan/.rakudobrew/moar-nom/install/lib/libmoar.so | |||
itz | [ptc]: :) | 12:58 | |
12:59
rurban left
13:04
beastd left,
beastd joined
13:11
zakharyas joined
|
|||
sergot | can you see any LHFs in the RT? | 13:17 | |
I'm looking for an easy task to work on | 13:18 | ||
are you aware of one? | |||
lucasb | m: my \x = 1; x\ .say | 13:24 | |
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/rktUk5i_V7Variable '&x' is not declaredat /tmp/rktUk5i_V7:1------> 3my \x = 1; 7⏏5x\ .say» | ||
lucasb | Unspaces doesn't mix with terms. this affects 'self\ .method' as well | 13:25 | |
m: class C { method f { self.say } }; C.new.f | 13:28 | ||
camelia | rakudo-moar 262352: OUTPUT«C.new» | ||
lucasb | m: class C { method f { self\ .say } }; C.new.f | ||
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/cDjU2HwYpTVariable '&self' is not declaredat /tmp/cDjU2HwYpT:1------> 3class C { method f { 7⏏5self\ .say } }; C.new.f» | ||
13:31
andreoss joined
13:34
yqt left
|
|||
[Coke] | sergot: no tickets are tagged LHF at this time. | 13:35 | |
When I'm digging for stuff, I sometimes try the LTA errors - sometimes making them awesome enough is easy enough. | |||
searching for things with Parrot in the title and seeing if they work ok on Moar or JVM... | 13:36 | ||
m: my Int a | 13:37 | ||
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5===Type 'Int' is not declared. Did you mean 'int'?at /tmp/dzhAgkCmKQ:1------> 3my Int 7⏏5aMalformed myat /tmp/dzhAgkCmKQ:1------> 3my Int 7⏏5a» | ||
[Coke] | m: my Int a; | ||
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kTKug1RgojMalformed my (did you mean to declare a sigilless \a or $a?)at /tmp/kTKug1Rgoj:1------> 3my Int a7⏏5;» | ||
[Coke] | ^^ RT #120831; ISTR jnthn fixed a bug like this recently that needed to allow for an end of file, not just an end of statement. | 13:38 | |
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=120831 | ||
jnthn | sergot: rt.perl.org/Ticket/Display.html?id=125733 is an easy error message fix | ||
13:38
raiph joined,
skids joined
|
|||
[Coke] | m: uniname("\0").say | 13:39 | |
camelia | rakudo-moar 262352: OUTPUT«NULL» | ||
13:43
rurban joined
13:47
Sqirrel left
13:49
Sqirrel joined
13:52
mjgardner joined
|
|||
tony-o | m: ''.^can('uniname').say; | 13:53 | |
camelia | rakudo-moar 262352: OUTPUT«uniname» | ||
andreoss | m: "\1".uniname.say | 13:54 | |
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/iXnbMrmjGCUnrecognized backslash sequence: '\1'at /tmp/iXnbMrmjGC:1------> 3"\7⏏051".uniname.say expecting any of: double quotes term» | ||
andreoss | m: "\0".uniname.say | ||
camelia | rakudo-moar 262352: OUTPUT«NULL» | ||
13:54
brrt left
|
|||
tony-o | m: '👩👩👦 '.uniname.say; | 13:54 | |
camelia | rakudo-moar 262352: OUTPUT«WOMAN» | ||
andreoss | isn't \1 just 1? | 13:55 | |
tony-o | no | ||
\1 is 'start of heading' | |||
'1' is \31 iirc | 13:56 | ||
x31 .. | |||
timotimo | m: say "1".encode.perl.say | ||
yoleaux | 02:56Z <skids> timotimo: NQP 808ce0fcb broke ("a","b")».ords for some reason. | ||
camelia | rakudo-moar 262352: OUTPUT«utf8.new(49)True» | ||
timotimo | :o | ||
oh crap, i broke something? | |||
tony-o | x31 == 49 :-) | ||
skids | Well, only for bleeding edge people. | ||
tony-o | timotimo: it's bc of the 2 'say's | 13:57 | |
timotimo | no, i meant what skids showed me | ||
tony-o | oh ^ | ||
timotimo | we obviously didn't have a test in roast that'd exercise this code path | ||
tony-o | m: "\x31".uniname.say; | ||
camelia | rakudo-moar 262352: OUTPUT«DIGIT ONE» | ||
tony-o | m: "\x1".uniname.say; | 13:58 | |
camelia | rakudo-moar 262352: OUTPUT«START OF HEADING» | ||
tony-o | andreoss ^^ | ||
13:58
Sqirrel left
|
|||
tony-o | m: "\xFE".uniname.say; | 13:58 | |
camelia | rakudo-moar 262352: OUTPUT«LATIN SMALL LETTER THORN» | ||
skids | timotimo: as big as roast is, it still has holes :-) | 13:59 | |
tony-o | that isn't a nice thing to say about someone skids | 14:00 | |
skids | tony-o: sorry, roast :-) | ||
timotimo | skids: can you give me a one-liner that shows ("a", "b")>>.ords breaking? | ||
m: say ('a', 'b')>>.ords | |||
camelia | rakudo-moar 262352: OUTPUT«97 98» | ||
timotimo | this is the expected output? | ||
skids | Yes, camelia does not have that nqp yet. | ||
timotimo | of course | ||
skids | With it you get a blank line -- ((),()) actually. | 14:01 | |
timotimo | oh lord | ||
i'm about to have a built rakuod on this machine | |||
skids | But only for ords. And maybe some other thing. But not for .chars at least. | 14:02 | |
timotimo | ... what? %) | ||
skids | m: say ('a', 'b')>>.uninames | 14:04 | |
camelia | rakudo-moar 262352: OUTPUT«LATIN SMALL LETTER A LATIN SMALL LETTER B» | ||
skids | Yeah, things that return lists are broken. | 14:05 | |
So probably more a problem in ">>." than ".ords" | |||
timotimo | mhm, likely | 14:09 | |
... there aren't even "while"s in there :\ | 14:11 | ||
14:12
AlexDaniel left
14:17
brrt joined
|
|||
lucasb | what does 'rpa' stands for in the core? 'returned parcel' or something? | 14:20 | |
14:22
FROGGS left
|
|||
timotimo | nah | 14:22 | |
something PMC Array | |||
[Coke] | resizable | 14:23 | |
timotimo | ah, yeah | ||
from when we primarily used parrot as our backend | |||
[Coke] | original parrot nomenclature. | ||
PMC == "parrot magic cookie" | |||
sort of an primitive VM object. | |||
lucasb | oh, thanks timotimo and [Coke]! | ||
Woodi_ | hi #perl6 :) | 14:24 | |
timotimo | hello Woodi_ | ||
RabidGravy | and there I was thinking that a libsamplerate binding would be nice and easy | 14:27 | |
hahahahaahahahahahahaha! | |||
nine | Every time you break object encapsulation in Perl 5 code, an Inline::Perl5 developer's kitten dies... or so | ||
Woodi_ | jnthn: .hyper don't need to parallelize to the end, eg. .map().map().map() 2 first can work concurently but 3rd can use values from all places in the array. so before 3rd map() values on "one side" can be inserted into buffer and on the "other side" iterated sequentially | 14:30 | |
timotimo | how would the last .map be able to use values from everywhere? | 14:32 | |
Woodi_ | also I wanted to say: "instruction pipeline is more valuable" in CPUs (.map() instructions can be put there and data can flow) but realy we want all cases :) static instructions in cache but also small "static" data with long .map() sequence... | 14:33 | |
timotimo: something needs to collect them :) | |||
14:33
AlexDaniel joined
|
|||
timotimo | huh? | 14:34 | |
but map works only with chunks of the thing on the LHS | |||
Woodi_ | is .map().map like my @b = @a.map(); my @c = @b.map(); .... ? | 14:35 | |
timotimo | kind of | ||
but more like my $in_between := @a.map(); my @result = $in_between.map() | |||
there's not really an assignment step in between when using .map().map() | 14:36 | ||
Woodi_ | yes, but if 3rd map wants to see all data then something must to bufer them. or programmer can use 2 lines of code... :) | 14:37 | |
jnthn | Indeed | ||
.map doesn't return data | |||
.map returns something that knows how to provide data | |||
Woodi_ | details :) | 14:38 | |
jnthn | Details you don't know about, so you spout meaninglessly, yes... | 14:39 | |
14:42
skids left
|
|||
pmurias | nine: why does breaking object encapsulation cause trouble for Inline::Perl5? | 14:45 | |
timotimo | no need for a second line of code either, you can just map.map.eager.map to have the result of the first two maps eagerly evaluated and thus buffered | ||
14:45
xfix joined
|
|||
jnthn | timotimo: Yeah, that works; I do wonder if we want a .sequential() or so that drops you back to sequential processing without having to buffer up everything though. | 14:48 | |
This bit is really, really tricky to design and get right... | |||
timotimo | i'm not sure i understand that? | ||
the first image that appears in my head is "turn non-cooperating code into gather/take" | |||
nine | pmurias: because subclassing P5 classes in P6 is kind of a stunt that works surprisingly well...until someone from outside the base class tries to look at the object's internals | 14:51 | |
pmurias: as if it wasn't already complicated enough. Perl 5 documentation tells you for example that an object is a blessed reference and it looks like that's true. But deep down it isn't. It's a reference to a blessed thingy. I was quite surprised when I found out that. | 14:54 | ||
timotimo | jnthn: or do you mean some kind of mechanism to signal that only parts of a sequence are supposed to be eagerified? | ||
jnthn | timotimo: eager blocks until the previous stage has produced everything | 14:57 | |
14:58
skids joined,
telex left
|
|||
jnthn | timotimo: If you still want to consume values as they become available from the parallel computation, but that you want to be sure you're on a single thread, then eager is kinda overkill | 14:58 | |
.lazy works too, but that may be overkill in the other direction | |||
timotimo | ah | 14:59 | |
jnthn | Also, the way this is turning out, .sequential() is probably going to be a one line method to provide... I bet TimToady'll want it called soemthing else though. | ||
timotimo | so it'll give you something more like pipeline semantics, but on a single thread using batching instead of communicating threads or something | 15:00 | |
PerlJam | call it .seq and confuse everybody ;) | ||
timotimo | basically a moving buffer/window thingie that gets pushed along? | ||
15:00
telex joined
|
|||
jnthn | PerlJam: heh, or call HyperSeq a Par :P | 15:01 | |
15:03
Possum joined
15:07
rurban_ joined
|
|||
itz | m: class A { has $.foo; has $.foo}; | 15:07 | |
camelia | rakudo-moar 262352: OUTPUT«===SORRY!===Package 'A' already has an attribute named '$!foo'» | ||
nine | pmurias: or not! It's really the reference that's blessed. Looking at the code, it's just newSVrv's documentation that's clearly wrong. Sending a doc patch... | ||
itz | shouldn't that be $.foo in the error or am I missing something? | 15:08 | |
jnthn | itz: Attributes are always called $!foo | 15:09 | |
itz: The . just means "and also generate an accessor" | 15:10 | ||
itz | ah | ||
jdv79 | complexity ftw | ||
TimToady isn't awake yet, but that kinda sounds like what I was proposing to call "silo" | 15:11 | ||
15:12
vytas left
|
|||
awwaiid | ICFP contest today! icfpcontest.org | 15:12 | |
GREAT place to show off a new language. Actually pretty much the perfect place. | |||
15:12
xfix left
|
|||
jdv79 | what does this silo do? | 15:14 | |
15:14
vytas joined
|
|||
nine | Wow, newSVrv's docs have been wrong since they were written in 1994 | 15:17 | |
15:17
diana_olhovik_ left
15:19
captain-adequate joined
|
|||
RabidGravy | something weird that someone may able to explain to me | 15:19 | |
pmurias | nine: when I create 2 references to the same hash, both change class when I call bless on one of them | 15:21 | |
15:21
pierrot_ is now known as pierrot
|
|||
nine | pmurias: oh yes, that's true. And is the reason, why my first attempt at implementing this failed back then. | 15:22 | |
RabidGravy | if I do something like "class A is repr('CStruct') { has CArray[num32] $!foo; submethod BUILD() { $!foo := CArray[num32].new }}" and then pass that a new one of thiose to a native sub it segfaults trying to write the array | ||
but something like "class A is repr('CStruct') { has CArray[num32] $!foo; submethod BUILD() { my $foo := CArray[num32].new; $!foo:= $foo }}" works fine | 15:23 | ||
any clue as to why? | |||
nine | pmurias: so what I wrote earlier is true after all. It's the thingy that's blessed, even if you have to pass the reference to sv_bless. | 15:24 | |
RabidGravy | yeah | 15:28 | |
perl -e 'my $a = 1; bless \$a, "Foo"; print $a,", \$a' | |||
1 Foo=SCALAR(0x1c676e0) | |||
15:30
pmurias left
|
|||
dalek | osystem: 23c4882 | (Steve Mynott)++ | META.list: add HTML::Restrict |
15:36 | |
RabidGravy | Hmm libsamplerate produces 0.2% too few frames when doubling the samplerate | 15:48 | |
15:53
Psyche^ joined
15:58
Psyche^_ left
15:59
cognominal left
16:00
zakharyas left
|
|||
RabidGravy resorts to 'ok ($out-frames-total / ($in-frames-total * 2)) <1, "got the expected total number of frames (approximately)";' | 16:02 | ||
16:04
Sqirrel joined
16:17
brrt left
16:21
nys joined
|
|||
tony-o | who is stmuk ? | 16:25 | |
itz | me | 16:27 | |
timotimo didn't know that | 16:28 | ||
tony-o | does that HTML::Restrict just filter out bad html tags, does it kill all the child nodes or place them in the parent? | ||
itz | I think it might wrongly kill child nodes which I only noticed a few mins ago | 16:29 | |
tony-o | should have a :save-the-children flag | 16:30 | |
itz | :) | ||
tony-o | that way it's fun to say to other people | ||
16:33
rurban left
|
|||
RabidGravy | or :geldof | 16:35 | |
tony-o | geldof ? | 16:37 | |
itz | UK charity figure | ||
tony-o | ah | 16:38 | |
itz | a bit like the vim editor | ||
b2gills | m: 'a' ==> { .say }() # does it make sense to allow this to work without the parens | 16:39 | |
camelia | rakudo-moar 262352: OUTPUT«a» | ||
16:41
brrt joined,
rurban_ left
|
|||
tony-o | m: 'a' ==> { .say; }; | 16:44 | |
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/wO8SKf8llESorry, do not know how to handle this case of a feed operator yet.at /tmp/wO8SKf8llE:1------> 3'a' ==> { .say; }7⏏5;» | ||
16:46
mr-foobar joined
|
|||
sergot | jnthn: thanks! | 16:57 | |
jnthn: I will start there then :) | 17:00 | ||
TimToady | I don't think I like contagious hyper if it's user-visible, cuz it's adding another dimension to the ambiguity of dispatch, which was already bad enough with 'nodal' | 17:05 | |
in @a».foo.elems, is that .elems supposed to be the number of elements that came through from @a, or the number of elems from each return from .foo, or the number of hyper batches? | 17:06 | ||
if we want something contagous, it should have both a beginning and an end | |||
*gious | |||
much like we took the original placeholder proposal with its arcane scope rules, and said, "It's always just to the curlies" | 17:07 | ||
jnthn | TimToady: Aside from any side-effects foo may do, it's exactly equivalent result wise to @a.deepmap(*.foo).elems | 17:08 | |
TimToady | so for now I think hyper should only be contagious to the next hyper | ||
17:09
eam joined
|
|||
timotimo | how did my change to nqp::while break deepmap? :( | 17:09 | |
the things i changed were - potentially - how passing the condition to the block will be handled, and what nqp::while returns | 17:10 | ||
eam | I'm playing around with perl6 and I don't understand why perl6 -e'say ("a", "b" ...^ * gt "y").pick' prints one character "a".."y" like I'd expect, but if I say gt "z" I get two random letters | ||
jnthn | TimToady: If you'd prefer @a>>.foo to mean @a.hyper().deepmap(*.foo).sequential() it's fine too | ||
timotimo | the bodies of the nqp::while blocks in deepmap aren't blocks with arguments, so no argument passing needed, and the return value would just get sunk'd | ||
TimToady | I just don't want it magically turning into @a.deepmap(*.foo.elems) | 17:11 | |
17:11
havenwood joined
|
|||
jnthn | Oh, that wasn't even slightly what I was suggesting | 17:11 | |
TimToady | okay, was probably misunderstanding something in the backlog then | ||
17:12
brrt left
|
|||
timotimo double-checks it's actually that exact commit that breaks it | 17:13 | ||
eam | nevermind, I figured it out - "za" is the first sequence gt "z" | 17:14 | |
"yz" actually | 17:15 | ||
timotimo | oh damn it, it *is* that commit | ||
dalek | rl6-roast-data: e1a0985 | coke++ | / (9 files): today (automated commit) |
||
17:15
domidumont joined
|
|||
TimToady | jnthn: another more credible wrinkle is if you have ».foo.map: -> $a, $b {...} then you risk $a being at the end of one batch and $b at the beginning of another, so you can't pipeline batches quite independently | 17:17 | |
tony-o | what order does » operate on a list? | ||
is it doing a map reduce essentially? | 17:18 | ||
TimToady | any order it likes, as long as it returns results in the original order | ||
tony-o | ah okay, i was consistently getting the same order from it and was curious. ty | ||
TimToady | I think race is more like map-reduce | 17:19 | |
tony-o | m: ("a".."z")»{$_}.join.say; | ||
camelia | rakudo-moar 262352: OUTPUT«abcdefghijklmnopqrstuvwxyz» | ||
timotimo | tony-o: we intentionally throw the items around, but it's deterministic sticc | 17:20 | |
m: ("a".."z")>>.say | |||
camelia | rakudo-moar 262352: OUTPUT«zxvtrpnljhfdbywusqomkigeca» | ||
timotimo | m: ("a".."z")>>.say | ||
camelia | rakudo-moar 262352: OUTPUT«zxvtrpnljhfdbywusqomkigeca» | ||
tony-o | m: race (1..5) { $_; } | ||
camelia | rakudo-moar 262352: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IfAgrj4FtLUnexpected block in infix position (missing statement control word before the expression?)at /tmp/IfAgrj4FtL:1------> 3race (1..5)7⏏5 { $_; } expecting any of: infix …» | ||
tony-o | timotimo: that's what i was experiencing ^ thanks for confirming | ||
TimToady | race is NYI, barely :) | 17:21 | |
jnthn | TimToady: I'm just not going to attempt to parallelize maps where the block's arity ain't 1 for now | ||
TimToady: But yeah, there's no very easy way to handle that. | |||
17:22
mr_ron joined,
cognominal joined
|
|||
jnthn | Whatever you do. | 17:22 | |
I think what I've got will be flexible enough API wise to find a way to cope reasonably well. | 17:23 | ||
dinner; bbiab & | |||
timotimo | perl6 -e 'say deepmap(-> $a { (1, 2).map(->$a {$a}) }, ("a", "b"))' - comes up empty | 17:24 | |
perl6 -e 'say deepmap(-> $a { my @ = (1, 2) }, ("a", "b"))' | |||
1 2 1 2 | |||
TimToady | on a slightly different subject, I know Fortress did a lot of work in list structures that could be split N ways easily, so I'm wondering how much of a bottleneck with left-to-right splitting of batches at the head of the pipeline... | ||
havenwood | How to you limit to just the `foo(bar)` or `bar.foo` style? My googlefu is failing me. | ||
How do* you | 17:25 | ||
timotimo | what do you mean? | ||
RabidGravy | method or sub? | 17:26 | |
sub or method | |||
havenwood | I'd swear there was a way to do something like `strict OO`, my memory fails me. | ||
TimToady | why would you want to do that? | ||
17:27
diana_olhovik joined,
andreoss left
|
|||
mr_ron | Anyone know a p6 module with good examples of exception classes and handling? | 17:27 | |
TimToady | there are very good reasons for both early binding and late binding | ||
havenwood | TimToady: I don't want to use it. Just recalled there being a way like `use oo;` but can't find it for the life of me. | 17:30 | |
TimToady: Just playing around, mere curiosity. | 17:31 | ||
TimToady | you're probably thinking of S12's use oo :closed :final; | ||
17:32
domidumont left
|
|||
TimToady | but that's just knobs on OO, not a stricture | 17:32 | |
17:33
diana_olhovik left
17:39
coffee` joined
17:41
llfourn left
|
|||
TimToady | jnthn: on bikeshedding .sequential, some starting ideas: .reform .linear .serial .queue .fifo .hypo | 17:44 | |
well, and .silo | 17:46 | ||
but maybe .seq is okay | 17:47 | ||
17:47
plicease joined
|
|||
TimToady | .oO("Why are they calling string eq there?") |
17:48 | |
colomon just booked his plane tickets to Switzerand. | |||
17:51
Sqirrel left
17:53
Sqirrel joined
|
|||
jdv79 | Your search - nodal site:perlcabal.org/syn/ - did not match any documents. :( | 17:59 | |
18:11
espadrine left
18:15
pRiVi is now known as Tisch_der_Sieger
18:22
havenwood left
18:27
[TuxCM] left
18:33
espadrine joined
|
|||
raiph | jdv79: 6 matches in design.perl6.org/S03.html | 18:37 | |
jdv79 | i noticed that | 18:41 | |
the google site search on design.perl6.org aint so hot | |||
yay for good ole grep | 18:42 | ||
18:56
[TuxCM] joined
19:04
[TuxCM] left
19:06
AlexDani` joined
19:07
AlexDaniel left
19:16
[TuxCM] joined
|
|||
dalek | kudo/nom: c048e75 | lizmat++ | src/core/Pair.pm: Naively implement pair() As discussed at irclog.perlgeek.de/perl6/2015-08-06#i_11014717 . Please note that I don't think it's a good idea to also have a named variant for this: if you want to use named parameters, please do Pair.new() |
19:25 | |
lizmat | $ 6 'say pair(42,666)' | 19:26 | |
42 => 666 | |||
please note I also see a use for pair() in those cases you want to be sure to pass a Positional Pair, rather than a named parameter | |||
aka frobnicate( pair("a",42") ) | |||
aka frobnicate( pair("a",42) ) # rather :-) | 19:27 | ||
jnthn | TimToady: Any feeling in exception semantics for hyper/race? | 19:28 | |
*on | |||
TimToady | well, we'd like each dataflow to succeed or fail separately, so we don't blow up the rocket just because one sensor was bad | 19:32 | |
jnthn | That's fine if folks fail, but what if they die? | 19:33 | |
Uh...that sounded more morbid than intended. :) | |||
19:35
mjgardner left
|
|||
dalek | ast: 9940e5e | lizmat++ | S04-statements/if.t: Remove superstitious parens from if tests |
19:35 | |
TimToady | for now that's a DIHWIDT, I suspect; I don't recall that we've specced any kind of distributed try | ||
jnthn | *nod* | 19:36 | |
19:37
llfourn joined
|
|||
jnthn | Well, I guess the more specific question I shoulda asked is: do we just throw the first exception we become aware of, or if we manage to get concurrent failure to we package them up into some kind of aggregate exception? | 19:37 | |
In .Net they do the latter in the name of preventing information loss, but I've rarely seen that actually happen in the wild. | 19:38 | ||
And it makes exception handling harder, 'cus now your when blocks won't match | |||
So refactoring to parallel becomes more of a job. | |||
19:42
llfourn left
|
|||
dalek | kudo/nom: 1a3f1a2 | TimToady++ | src/ (2 files): make andthen/orelse topicalizers This also fixes the with/without statement modifiers to topicalize correctly. |
19:42 | |
ecs: 8268851 | TimToady++ | S03-operators.pod: change orelse to topicalize to $_, not $! (Also makes 'without' use $_ for its topic.) |
19:44 | ||
ast: 9ba702f | lizmat++ | S04-statements/with.t: Add basic "with" test (todo for now) |
|||
lizmat off for some MI:4 | 19:45 | ||
TimToady off for lunch | |||
19:50
diana_olhovik joined
|
|||
AlexDani` | sergot: some time ago you asked for LHFs. Well, I don't mark my tickets as LHFs because most of the time I have no idea what the problem is, but at the same time I've never submitted anything that is extraordinarily hard | 19:50 | |
19:50
AlexDani` is now known as AlekDaniel
19:51
AlekDaniel is now known as AlexDaniel
|
|||
AlexDaniel | sergot: so maybe filtering by [email@hidden.address] will give you a decent list of LHFs | 19:52 | |
yoleaux | 6 Aug 2015 05:00Z <skids> AlexDaniel: The message for "..." still has to be fixed; it is a separate issue ("..." implicity tries to "return" from the mainline code, not just sink a Failure) What was fixed was there is no longer a different backtrace when a Failure is sunk in the last statement. | ||
AlexDaniel | oh ok | ||
and most of my tickets are just LTAs | 19:53 | ||
m: .say for 1...NaN; | 19:58 | ||
camelia | rakudo-moar c048e7: OUTPUT«(timeout)10-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-4…» | ||
AlexDaniel | mwahaha :) | ||
m: .say for Inf..0 | 19:59 | ||
camelia | rakudo-moar c048e7: OUTPUT«(signal XFSZ)-9223372036854775808-9223372036854775808-9223372036854775808-9223372036854775808-9223372036854775808-9223372036854775808-9223372036854775808-9223372036854775808-9223372036854775808-9223372036854775808-922337203685…» | ||
20:02
[particle] left
20:11
jjido joined
20:12
jjido left
20:13
rindolf left
|
|||
TimToady | m: .say with 42; 42 andthen .say | 20:24 | |
camelia | rakudo-moar 1a3f1a: OUTPUT«4242» | ||
TimToady | m: .say without Rat | ||
camelia | rakudo-moar 1a3f1a: OUTPUT«(Rat)» | ||
TimToady | m: .say with 0; .say with Nil | ||
camelia | rakudo-moar 1a3f1a: OUTPUT«0» | ||
20:25
darutoko left
|
|||
TimToady | m: with 0 { .say } # now to make this work | 20:25 | |
camelia | ( no output ) | ||
20:37
llfourn joined
20:41
llfourn left
20:44
diana_olhovik left
20:51
yqt joined
|
|||
jdv79 | is it possible to use a role to share a new and BUILD method amongst consuming classes? | 20:54 | |
it seems to only partially work | |||
TimToady | role BUILDs are not yet composed properly | 21:01 | |
skids | jdv79: the workaround has been to abuse the attribute default value initialization logic. | 21:07 | |
21:10
skids left
|
|||
jnthn | 'fraid I ain't gonna get the hyper/race all the way there today | 21:11 | |
(Headache + bureaucratic distractions... :/) | 21:12 | ||
Think I'm close to a first working example though. | |||
So probably tomorrow. | |||
TimToady | be better! | 21:13 | |
jnthn | Thanks! | ||
The headache's already gone, by now I'm just tired, and that's not a good state to juggle a lock and a pair of condvars :) | |||
TimToady | m: say "jnthn++" without $*headache | 21:15 | |
camelia | rakudo-moar 1a3f1a: OUTPUT«jnthn++» | ||
jnthn | ooh :) | 21:16 | |
I see you left the bit involving hack on code-gen until the end. :) | |||
TimToady | working on that bit now, yeah | 21:17 | |
I can generate with and without opcodes, but they still behave like if/unless :) | |||
just need to figure out the bits where it evaluates the conditional so as to pass the original object but evaluate with .defined | 21:18 | ||
21:18
lucasb left
|
|||
RabidGravy proselytises a CPAN author who was keen for me to check out his module to port it to Perl 6 ;-) | 21:18 | ||
first time I've actually been "spammed" about a module I think | |||
jnthn | TimToady: I'll be you'll have an easier time doing it on Moar first | ||
TimToady | also still need to force passing of the conditional | 21:19 | |
well, that's what I'm doing | |||
jnthn | TimToady: JVM is a stack machine which makes code-gen harder (unless you're at university writing a compiler for a tiny language, and then the stack machine looks wonderfully elegant to make code for :P) | ||
Yeah, we do stash the conditional away | 21:20 | ||
TimToady | I see the bind, but I need to sneak in a defined after that | ||
jnthn | right | 21:21 | |
The two places you'll need to tweak are those near resolve_condition_op | 21:22 | ||
There's this: | 21:23 | ||
push_op(@ins, 'decont', $decont_reg, @comp_ops[0].result_reg); | |||
$decont_reg now holds the thing to test | |||
So if you just do a findmeth on that and then shove in a call, you can even write the result of the call back into the same register and leave the code the same | 21:24 | ||
Also, there's a conditional "@comp_ops[0].result_kind == $MVM_reg_obj" | |||
TimToady | so that one is the evaluation, and is post-bind to the temp? | 21:25 | |
jnthn | Yes | ||
That one is literally at the point where we spit out the jump | |||
TimToady | right | ||
jnthn | We've already stashed the condition away by that point if we need it | ||
Anyway, earlier on you have: | 21:26 | ||
@comp_ops[0] := ... | |||
Twice | |||
I'd pass :want($MVM_reg_obj) to the two calls that assign to it | |||
That demands an object register | |||
Then you can delete the condition and its else branch that I mentioned a moment ago | |||
Because it's highly unlikely anyone will sensibly use with/without on a native type | |||
TimToady | okay, maybe that's enough to ignite my brane | 21:28 | |
it's got soggier these last few decades... :) | |||
RabidGravy | boo! | 21:29 | |
mind I've felt really stupid for the last week | 21:30 | ||
I kind of woke up again today | |||
jnthn has had one of his better weeks this one for productivity | 21:32 | ||
TimToady | fershure | ||
21:34
bin_005 joined
|
|||
jnthn kinda wants to show off .hyper/.race and also supply/whenever at this YAPC::Asia talk :) | 21:35 | ||
*his | |||
TimToady is probably gonna rewarm his fosdem talk, since that never got properly recorded | 21:37 | ||
TimToady doesn't have the brane to write new talks right now anyway | |||
jnthn | Well, I get to re-use the YAPC::Asia one at Swiss Perl Workshop :) | 21:39 | |
RabidGravy | jnthn, does the thing about not being able to bind a new CArray directly to an attribute in a CStruct and having to bind to a variable which is then bound to the attribute ring any bells? | 21:40 | |
jnthn | RabidGravy: No, I was pretty confused by that... | 21:42 | |
RabidGravy | well you can do it but it appears to mess the pointer up | 21:43 | |
ShimmerFairy | TimToady: what are the "new andthen/orelse" mentioned in one of your commits yesterday? (That is, what's different from how they have been before?) | ||
jnthn | RabidGravy: FROGGS++ worked on that stuff much more recently than I have so may have an idea | ||
RabidGravy | all weird | ||
the samplerate API is a bit special anyway, it gets a struct which contains both the input buffer and output buffer so quite niche | 21:45 | ||
jnthn | OK, time to wander afk to rest | 21:48 | |
Back tomorrow to juggle my condvars some more... | |||
o/ | |||
TimToady | \o | ||
RabidGravy | juggle your stuff in private matey ;-) | 21:49 | |
TimToady | ShimmerFairy: they topicalize the for the RHS as specced | ||
m: 42 andthen .say | |||
camelia | rakudo-moar 1a3f1a: OUTPUT«42» | ||
TimToady | and the internals are reworked to support with/without statement modifiers also | 21:50 | |
ShimmerFairy | Ah, so you "just" implemented more of the spec on them then :) | ||
TimToady | well, I also tweaked the spec :) | ||
RabidGravy | if the spec don't fit tweak it | 21:52 | |
TimToady --> nap | 22:05 | ||
22:05
TEttinger joined,
telex left
|
|||
dalek | kudo-star-daily: 1b77bdd | coke++ | log/ (8 files): today (automated commit) |
22:06 | |
22:06
telex joined
|
|||
RabidGravy | boom! | 22:12 | |
dalek | kudo-star-daily: 94d04df | coke++ | log/ (10 files): archive parrot logs |
22:16 | |
22:29
virtualsue left
22:36
Zoffix_ joined
22:38
llfourn joined
|
|||
Sgeo | fail reminds me a bit of Rust's try!(Err(...)) | 22:40 | |
22:41
Zoffix left,
][Sno][ joined,
TimToady_ joined
22:43
llfourn left,
mrf left
22:49
nys left,
Grrrr left,
[Sno] left,
TimToady left,
Grrrr joined
22:50
skids joined
|
|||
RabidGravy | is it possible to parameterise a subset? | 22:53 | |
lizmat | RabidGravy: I have no idea | 22:58 | |
looking at blogs.perl.org/users/aaron_baugher/...erl-6.html | |||
I wonder whether we shouldn't have a .contains, which would just return Bool ($i != -1) | 22:59 | ||
so we can skip the .defined in that benchmark | |||
23:00
nys joined
|
|||
lizmat gets some sleep | 23:06 | ||
RabidGravy | to be fair index is always going to be way faster than a regex | ||
b2gills | I tested parsing with index and substr in Perl 5. It was faster for up to about 4 calls to index, after that the regex was faster. | 23:13 | |
23:33
RabidGravy left
23:36
TimToady_ is now known as TimToday,
TimToday is now known as TimToady
23:37
mr_ron left
23:46
average joined
|
|||
average | gist.github.com/masak/66735ee4c40a...les-p6-L73 | 23:46 | |
wow, I like how this looks | |||
lines 85,86,93 much <3 | 23:47 | ||
oh, line 76 too | |||
i'm wondering how the \in and \cap are implemented or if they can be overriden | 23:48 | ||
I suppose one should be able to implement them for specific cases because they can have faster ones in particular cases | 23:49 | ||
23:50
beastd left
23:54
captain-adequate left
|
|||
average | either way, much interesting stuff in the p6 blogosphere | 23:55 | |
10x | |||
23:55
average left
|
|||
ShimmerFairy | I was about to say: there's "texas" versions of all those unicode operators. Rakudo's source suggests that you should override the texas versions, since the unicode versions are explicitly 'only' subs, but that doesn't actually stop anything. | 23:56 | |
m: class Foo { }; multi sub infix:<⊂>(Foo $a, Foo $b) { "OK!" }; say Foo ⊂ Foo; say Foo (<) Foo; | |||
camelia | rakudo-moar 1a3f1a: OUTPUT«OK!False» | ||
ShimmerFairy | supposedly, that infix:<⊂> is an 'only' sub and therefore shouldn't be overrideable. | 23:57 | |
However, I personally would prefer overriding the unicode operators instead, so I don't mind :) | 23:58 |