»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
00:00 cognominal joined 00:05 Entonian left
raiph github.com/raiph/rakudo-debugger/c...nt-6177323 would appreciate response by someone who knows how to use github to do updates of pull requests 00:06
00:09 cognominal left 00:11 rurban left 00:32 cognominal joined 00:38 moistcherry joined 00:41 moistcherry is now known as hoverboard
dwarring raiph: I'm no github expert by any stretch 00:56
github automatically creates a branch for each PR 00:57
that PR is on branch patch-4 00:58
I'd try: git checkout patch-4 00:59
raiph dwarring: thanks for help
dwarring++ # for advent fixing too 01:00
dwarring: I don't currently use git but I guess it's time to change that :)
dwarring it's fun 01:02
have picked up lots of tips and techniques along the way
still most of 2010 & 2011 open 01:04
if anyone else wants to do some
raiph i've used git over the last couple years for a couple things but not with github repos nor with my current rakudo dev environment (feather) 01:05
dwarring github adds another layer of magic 01:07
afk 01:08
01:08 Sqirrel_ joined 01:10 Sqirrel left 01:22 xenoterracide_ joined 01:31 FROGGS joined 01:53 FROGGS left 01:54 klapperl_ left 01:55 klapperl joined 01:56 hoverboard left, Su-Shee left, FROGGS joined 01:57 xinming_ left 01:58 Su-Shee joined, xinming_ joined 02:04 hoverboard joined 02:06 FROGGS left, btyler left
japhb When a particular method of a common class in the setting does not make sense on some backends, what's the usual way to handle this? Hide the method entirely on those backends? Do an X::NYI.new(feature => 'The::Class.the-method').fail? 02:06
dalek kudo/nom: 6023d81 | (Geoffrey Broadwell)++ | src/core/IO.pm:
Add an IO::Path.watch convenience method
japhb just picked one
02:23 hoverboard left 02:27 BenGoldberg left 02:29 BenGoldberg joined 02:33 xragnar_ joined, xragnar is now known as Guest12522, Guest12522 left, xragnar_ is now known as xragnar 02:41 hoverboard joined
colomon hmmm, is there a way to do something in a loop every time but the first? 02:44
02:44 thou joined 02:49 hoverboard left
BenGoldberg while ( blah blah blah ) { state $first; doit() if $first++ } 02:50
colomon BenGoldberg++
BenGoldberg :) 02:51
Although you might want to declare $first as a 'my' variable, before the loop 02:52
... if this is in a subroutine, and if you *don't* want it to be influenced by previous calls to the subroutine.
03:03 dayangkun left 03:13 hoverboard joined 03:15 dayangkun joined 03:17 dayangkun left, dayangkun joined 03:18 dayangkun left 03:19 dayangkun joined 03:20 dayangkun left 03:21 dayangkun joined 03:22 dayangkun left 03:23 dayangkun joined 03:24 dayangkun left 03:25 dayangkun joined 03:41 stux joined 03:45 thou left 03:55 BenGoldberg left 04:03 kaare_ joined 04:04 thou joined 04:09 zacts joined
zacts is perl6 usable for production projects? 04:10
04:10 FROGGS joined 04:12 hoverboard is now known as moistcherry 04:17 lvfjf left 04:18 SamuraiJack joined, lvfjf joined 04:32 rindolf joined 04:34 Psyche^_ left 04:36 lvfjf left, Psyche^ joined, lvfjf joined 04:37 FROGGS left 04:39 adu joined 04:42 bjz joined 04:45 jnap1 left
TimToady .tell BenGoldberg using 'my' instead of 'state' is not necessary, since the loop's closure is recloned at the same time the 'my' would have been, so the state resets on re-entry to the outer scope 04:48
yoleaux TimToady: I'll pass your message to BenGoldberg.
04:49 moistcherry is now known as hoverboard 05:01 Alula_ left 05:02 kaare_ left 05:14 Alula_ joined 05:16 jnap joined
adu hi 05:16
05:18 lvfjf left 05:20 jnap left 05:26 kaare_ joined 05:30 sigstuff joined, sigstuff left 05:34 rindolf left 05:42 telex left
vendethiel o/, #perl6 05:43
05:44 telex joined
nwc10 jnthn: only ASAN fail is t/spec/S17-lowlevel/lock.rakudo.moar 05:50
jnthn: read by thread T3 of somethign freed by T1, allocated by T0
06:04 hoverboard is now known as moistcherry 06:05 rindolf joined 06:16 jnap joined 06:21 jnap left 06:25 thou left, cxreg left 06:32 dayangkun left 06:35 cxreg joined 06:36 adu left 06:41 pdcawley left 06:43 pdcawley joined 06:45 kaare_ left 06:46 moistcherry left 06:47 FROGGS joined 06:49 dayangkun joined, igorsutton joined 06:52 grondilu joined
grondilu std: $_ (-)= set () 06:55
camelia std ec3d853: OUTPUT«===SORRY!===␤Confused at /tmp/RGWoGkVZS_ line 1:␤------> $_ ⏏(-)= set ()␤ expecting any of:␤ feed_separator␤ infix or meta-infix␤ infixed function␤ statement modifier loop␤Parse failed␤FAILED 00:01 125m␤»
grondilu std: $_ = $_ (-) set () 06:56
camelia std ec3d853: OUTPUT«===SORRY!===␤Confused at /tmp/iwM4f_285M line 1:␤------> $_ = $_ ⏏(-) set ()␤ expecting any of:␤ feed_separator␤ infix or meta-infix␤ infixed function␤ statement modifier loop␤Parse failed␤FAILED 00:01 1…»
nwc10 jnthn: paste.scsys.co.uk/362401 -- ctx->callsite->has_flattening -- 0x6008003fab6c is located 28 bytes inside of 40-byte 06:58
no, 28 doesn't make sense to me in terms of structure offset, but it's adamant 07:00
07:06 logie left 07:08 zakharyas joined 07:09 pecastro left 07:17 jnap joined 07:22 jnap left, sqirrel joined, darutoko joined
lizmat jnthn: didn't get around to testing async IO yet, got stuck with finding out why Supply.delay|stable tests don't work 07:36
07:40 Sqirrel_ left, Sqirrel_ joined 07:46 sqirrel left 07:51 denis_boyun_ joined 07:53 thou joined 07:58 thou left 07:59 kaare_ joined
dalek ecs: 02e59c9 | (Elizabeth Mattijsen)++ | S17-concurrency.pod:
Formally spec Supply.(Channel|Promise)
08:07 Ven joined
Woodi hi today :) 08:08
FROGGS hi Woodi 08:09
lizmat hi Woodi FROGGS !
FROGGS hi lizmat :o)
08:12 virtualsue joined
dalek ast: 219a020 | (Elizabeth Mattijsen)++ | S17-supply/Channel.t:
Added basic Supply.Channel tests
08:18 jnap joined
FROGGS jnthn: I think I need your help after you had your coffee :/ 08:18
08:19 darutoko- joined 08:21 darutoko left 08:23 jnap left
FROGGS usually a HanderScope is made when I compile my script, which has a (labeled) loop 08:23
and this is differntly for MapIter, the HandlerScope is already made in the setting
so I cannot attach the label to the handler at that time
I think I need a way to attach/detach a label to a HandlerScope when it runs the MapIter.reify
jnthn: does that seem sane? and how do I get my hands on that HandlerScope? 08:24
Woodi someone could help me how to get items from match object in order they was parsed ? I have files with colums definitions on top then data, then ocassionally columns redefinition. I trying to take this info from match object so working post-parse, no actions. 08:25
FROGGS Woodi: can you put that in a gist? a runnable script including sample data?
Woodi k
08:28 lue left
Su-Shee good morning everyone. 08:29
lizmat Su-Shee o/
dalek ast: 4ee319e | (Elizabeth Mattijsen)++ | S17-supply/Promise.t:
Add basic Supply.Promise tests
kudo/nom: 936fb75 | (Elizabeth Mattijsen)++ | t/spectest.data:
Make sure we test Supply.(Channel|Promise)
ast: c0fc454 | (Elizabeth Mattijsen)++ | S17-supply/ (2 files):
We don't need Test::Tap here
lizmat afk&
Woodi hi Su-Shee 08:37
08:37 darutoko joined
Woodi FROGGS: script and data: pastebin.com/qv7QnSUB 08:38
08:39 darutoko- left
Woodi probably I trying to mimic Perl5 way, badly etc. but I wonder can grammar be used in DOM/SAX/StAX ways ? :) pl.wikipedia.org/wiki/Streaming_API_for_XML 08:40
08:41 lue joined
Woodi um, en.wikipedia.org/wiki/StAX :) 08:44
FROGGS Woodi: so you want to be able to loop over the headers, and then have the dlines in its header?
Woodi probably. I need to sums data in columns
for start how to get something like $r.list... 08:46
maybe "token lines" including all kinds could help... 08:47
FROGGS token TOP { [ <header> | <.comment> ]+ };
token header { '=data ' <cs>+ % [\h+] \n [ <dline> | <.comment> ]* };
I would use these tokens instead 08:48
this way you would have the dlines nestid in their headers
and you discard the comments
Woodi hmm
right, let's build some grammar ;)
FROGGS then you can do: for @($r<header>) -> $h { for @($r<dline>) -> $dl { ... } } 08:49
08:49 raiph left
masak antenoon, #perl6 08:50
Woodi hallo masak
FROGGS Woodi: here is the gist: gist.github.com/FROGGS/3b7cebc3301e050a9b9a
I commented some stuff so it better fits on my screen :o) 08:51
hi masak
Woodi FROGGS: checking
FROGGS: work ! thanx :) 08:55
FROGGS Woodi: you're welcome :o)
Woodi but still I have problem with understanding something: for @($r<header>) -> $h { for @($r<dline>)... $r<header> is level-one item in hash and $r<dline> is also level-one so normally they are unrelated. looks automagically works but I didn't try this approach becouse I expected <dlines> should be "inside" headers... 08:58
FROGGS ohh 08:59
should be for @($h<dline>)
masak m: $h = { dline => 42 }; say @($h<dline>); say @$h<dline> 09:00
camelia rakudo-moar 6023d8: OUTPUT«===SORRY!=== Error while compiling /tmp/O8M1HLVfJo␤Variable '$h' is not declared␤at /tmp/O8M1HLVfJo:1␤------> $h⏏ = { dline => 42 }; say @($h<dline>); sa␤ expecting any of:␤ postfix␤»
masak m: my $h = { dline => 42 }; say @($h<dline>); say @$h<dline>
camelia rakudo-moar 6023d8: OUTPUT«42␤===SORRY!===␤postcircumfix:<{ }> not defined for type List␤»
FROGGS m: my $h = { dline => 42 }; say @h<dline> 09:01
camelia rakudo-moar 6023d8: OUTPUT«===SORRY!=== Error while compiling /tmp/pe3EmJv7PL␤Variable '@h' is not declared. Did you mean '$h'?␤at /tmp/pe3EmJv7PL:1␤------> my $h = { dline => 42 }; say @h<dline>⏏<EOL>␤ expecting any of:␤ po…»
FROGGS ahh, wait, only @<foo> was sugar for @($<foo>) of course
Woodi ook, so probably my grammar was messing with me. thanx 09:02
btw. tips for grammars in Perl6: a) forget "rules"; b) use \h, not \s :) 09:03
jnthn FROGGS: No, 'cus that handler scope is static and so shared between all maps 09:05
FROGGS and c) if the rules/token look overly complex, one is missing the obvious simple solution :o)
jnthn FROGGS: So will need to see what label is being thrown, if any, and check it in the handler, I think.
FROGGS jnthn: but how can I check it in the handler if I cannot attach it to the handler? 09:06
Woodi no, no, no... for line-after-line format lines are obvious way !
FROGGS I get the thrown payload, but I have nothing to compare it to 09:07
jnthn FROGGS: huh? You pass the label into MapIter, no?
FROGGS Woodi: I wasn't talking about the current piece of code :o)
jnthn: I have it in the MapIter, aye
09:08 virtualsue left
FROGGS hmmm 09:08
jnthn And the label is conveyed through the exception object, surely?
FROGGS the thrown label is in the payload of the exception, yes
09:08 Rotwang joined
jnthn So you get it and compare it? 09:09
'REDO', $state = 2, 09:10
FROGGS jnthn: are you saying that I should try to get my hands on the thrown exception in MapIter.reify? using nqp::exception()?
jnthn Like there.
09:11 darutoko- joined
jnthn I hope at some point we'll compile sink-context for loops into something that doesn't need to go through MapIter. 09:11
FROGGS I am all 'for' it :o)
jnthn :P 09:12
nwc10 good appropriate-time-of-day, real-jnthn
jnthn o/ nwc10
09:14 darutoko left 09:19 jnap joined 09:23 jnap left 09:35 plobsing left 09:39 denis_boyun_ left 09:43 rindolf left 09:48 spider-mario joined
FROGGS ohh, it seems to work now... damn, that was tricky 09:52
jnthn Welcome to Perl 6 impl :P 09:55
FROGGS :P 10:00
jnthn righty...admin things done, now I can hack :)
nwc10 good afternoon, jnthn 10:01
jnthn ;) 10:02
I think the VMNull-introducing branch seems to not be busting things. 10:05
So I think I'll go ahead and merge.
10:06 dalek left
jnthn Hm, well, it was a ff in Moar :) 10:06
10:06 dalek joined, ChanServ sets mode: +v dalek
jnthn github.com/Netflix/RxJava/wiki/Obs...s#parallel # that's a cute supply method idea :) 10:09
dalek p: 2b8ad37 | jnthn++ | tools/build/MOAR_REVISION:
Bump to a Moar with VMNull changes.
masak this month still wants for a release manager. 10:17
10:19 jnap joined 10:23 jnap left 10:26 vaskozl joined 10:27 rindolf joined 10:29 ponbiki left
dalek kudo/nom: 7a8d595 | (Timo Paulssen)++ | src/vm/moar/ops/perl6_ops.c:
this gets us through CORE.setting. but it's probably wrong.

at the very least p6captureouters is not correct this way.
10:32 dalek left 10:33 dalek joined, ChanServ sets mode: +v dalek
colomon …. errr, that's a scary looking commit message. 10:33
jnthn colomon: It was the first commit in a branch 10:34
colomon: Which I just merged
colomon ah
10:34 vaskozl left 10:38 denis_boyun_ joined 10:51 vaskozl joined 10:57 xinming_ left
dalek rlito: 4242a67 | (Flavio S. Glock)++ | / (4 files):
Perlito5 - string parser flags \E \L \U \Q
p/async_ops: 7ca649e | (Donald Hunter)++ | src/vm/jvm/runtime/org/perl6/nqp/ (2 files):
Implement asyncwritebytes on JVM.
11:06 donaldh joined
dalek rlito: 971dcd9 | (Flavio S. Glock)++ | / (3 files):
Perlito5 - AST dumper tweak
tadzik did anyone look into a deserialization bug from p6u? 11:11
11:12 donaldh left 11:13 donaldh joined
FROGGS tadzik: not yet 11:16
11:18 xenoterracide_ left, Alina-malina left 11:20 jnap joined 11:24 pippo joined
pippo o/ #perl6! 11:24
11:25 jnap left
lizmat pippo o/ 11:25
pippo o/ lizmat :-) 11:26
I have tried this jnthn example here gist.github.com/anonymous/260ffb652a390fa9bb45 11:27
but does not reliably work: gist.github.com/anonymous/4850e487711d1d97dca7
Is it a know bug?
lizmat tries 11:29
pippo Results differ and I also have unhandled exceptions …
jnthn If we're unlucky enough that .words uses gather/take, then it's probably the known issue around that. 11:30
Only on Moar, not JVM.
pippo jnthn: I confirm JVM works fine.
lizmat confirmed the problem on moar 11:31
.words uses .comb, which uses .map
11:32 Alula_ left
lizmat words for defined objects uses com, which uses match, which uses gather 11:32
although I'm really at a los to understand why gather would be needed here
11:33 Alula_ joined
lizmat *loss 11:33
dalek kudo/nom: 7c80abb | jnthn++ | src/vm/moar/ops/perl6_ops.c:
Fix a warning.
kudo/nom: 2f5809b | jnthn++ | src/vm/moar/ops/perl6_ops.c:
Move some reads after lexical lookups.

This is in preparation for making allocation of scalars etc. lazier.
pippo lizmat: so at the moment gather/take is somehow causing glitches with concurrency on Moar. Thank you lizmat and jnthn. 11:36
I'll use JVM for that kind of tasks for now. 11:37
11:38 pecastro joined
lizmat pippo: that seems like a good temporary workaround 11:39
jnthn Yeah. I looked a bit at the gather/take bug. It's hard.
The fix may not be hard
But working out what's going on is. 11:40
pippo jnthn: I am not a pro. Well the contrary of that is more realistic. But if I can help I can have some hours this week-end. 11:44
afk & 11:48
11:50 xinming_ joined 11:59 anaeem1 joined 12:03 anaeem1 left 12:05 denis_boyun_ left 12:16 Alina-malina joined, SamuraiJack left 12:18 SamuraiJack joined
masak tip for when you know you only need one grammar/actions pair: put the grammar inside the actions class. 12:18
and then do G.parse(..., :actions(self.new)) 12:19
or even $?CLASS.new 12:20
12:20 Vlavv left 12:21 jnap joined 12:25 jnap left
lizmat senses an opportunity for a blog post :-) 12:26
masak that's what I felt when I discovered this, yes. 12:29
I also re-used the same actions *object* for several parses, something I hadn't done before. 12:30
this tends to be something one wants when parsing a line-based format.
dalek kudo-star-daily: 0da4854 | coke++ | log/ (5 files):
today (automated commit)
Ven github.com/coke/rakudo-star-daily/...0da4854209 -- changes over ~60 days 12:37
12:37 kurahaupo joined
Ven github.com/coke/rakudo-star-daily/...0da4854209 -- over one month 12:38
dalek ecs: b806d66 | (Elizabeth Mattijsen)++ | S17-concurrency.pod:
Spec Supply.act
12:39 vaskozl left
lizmat m: Supply.new.tap.WHAT.say 12:48
camelia rakudo-moar 72f5b9: OUTPUT«(Tap)␤»
lizmat m: Tap.WHAT.say 12:49
camelia rakudo-moar 72f5b9: OUTPUT«===SORRY!=== Error while compiling /tmp/Rc9_uyKrhR␤Undeclared name:␤ Tap used at line 1␤␤»
lizmat hmmm.. seems we cannot check if something is a Tap ?
jnthn Not easily
I think it's a lexical class at the moment within Supply
masak m: my @fruits = { :apple }, { :orange }, { :orange }; for @fruits { when :(:$apple) { say "apple" }; when :(:$orange) { say "orange" } } 12:50
camelia rakudo-moar 72f5b9: OUTPUT«apple␤orange␤orange␤»
lizmat jnthn: it is
masak syntax is a bit quirky, but can definitely use signatures to partially match hash pseudo-objects.
lizmat is there a reason for having it only inside the Supply role ? 12:51
jnthn Mostly because it's only meaningful for Supply to create them.
And I tend to default to encapsulating things I consider implementation details :) 12:52
lizmat indeed, it;s now just hard to test whether .tap actually returns a Tap :-)
jnthn Aye.
I've no particular feelings on how to fix that :)
lizmat the odd thing of course, is that .WHAT *does* expose the inner Tap class 12:53
as (Tap), not as e.g. (Supply::Tap) 12:54
masak lizmat: well, there's your way to check whether something is a Tap, then :P
m: say Supply.new.tap ~~ Supply.new.tap.WHAT 12:55
camelia rakudo-moar 72f5b9: OUTPUT«True␤»
lizmat eh... that feels like checking that 42 ~~ 42
masak more like 42 ~~ Int
where someone gave you a type and told you it's an Int.
lizmat would be more like 42 ~~ 42.WHAT 12:56
I can't specify the Int, *that* is the problem
masak could declare a Supply.Tap method that returns the Tap type. 12:57
but I'm not sure that's preferable to just putting Tap outside Supply.
lizmat well, that's what
masak if the reason for keeping it inside was to control who gets to create objects. 12:58
m: my $t1 = Supply.new.tap; my $t2 = $t1.new; say $t2.^name; say $t1 === $t2
camelia rakudo-moar 2f5809: OUTPUT«Tap␤False␤» 12:59
masak seems you can already.
jnthn Yeah, it's not any real protection. 13:00
lizmat so ok if I take it out of the role ? 13:01
jnthn yeah, I guess it won't cause any problems... 13:02
lizmat ok, will check if it regresses anything
13:08 Vlavv joined
dalek kudo/nom: 071ee1a | (Elizabeth Mattijsen)++ | src/core/Supply.pm:
Move Tap class out of Supply role

Mainly so that we can easily check for Tappiness of a tap
lizmat no regresssions
jnthn: is there any reason why you didn't implement act as: 13:15
self.tap(&actor,|%_) 13:16
why the do, when the "more" on the tap would work just as well ?
and we wouldn't need a moreless tap anymore then 13:17
13:18 thou joined
jnthn lizmat: act promises actor semantics 13:20
lizmat: That is, you can be sure that you are only running the tap callback one at a time.
lizmat ah, and more doesn't
[Coke] still 2 segfaults in rakudo.moar spectests today (haven't pushed today's results yet) 13:21
jnthn lizmat: The things you pass in .tap can run on many threads potentially
[Coke] still 1 rakudo.parrot failure.
13:22 jnap joined, thou left
lizmat gotcha 13:23
13:26 jnap left
lizmat jnthn: the only reason for the "moreless" tap, was act, right? 13:27
jnthn lizmat: Yeah, though we may want a .wait() too 13:28
lizmat as in Supply.wait ? 13:29
jnthn Right
lizmat what would that do?
jnthn When you want to wait until a supply is done
lizmat ah, ok
jnthn Block until done or quit happens.
It's sometimes useful, when you primarily want to tap a supply for its side-effects
lizmat ack, will spec and implement and test :-)
jnthn though tbh I've used it mostly in demonstrations more than real code 13:30
13:30 Alula_ left
lizmat well, I guess the same goes for await() :-) 13:30
13:30 virtualsue joined
jnthn No, await is nice in real things :) 13:32
timotimo aye
jnthn Though we probably want to teach it to return the thread to the scheduler.
ala C#'s await
I almost made that happen once, but our continuations on JVM still hit too many barriers 13:33
Probably can do it on Moar
dalek kudo/nom: 0a4dad0 | (Elizabeth Mattijsen)++ | src/core/Supply.pm:
Leave some comments for future optimizers
13:36 virtualsue left, virtualsue joined 13:40 bluescreen10 joined 13:43 rurban joined, darutoko- left 13:44 Alula_ joined
dalek ast: 9c839e2 | (Elizabeth Mattijsen)++ | S17-supply/act.t:
Add basic tests for Supply.tap
13:50 darutoko joined
lizmat afk for a bit 13:51
13:55 xinming_ left, xinming_ joined 13:59 PerlJam left, thou joined 14:00 Alula_ left, Alina-malina left, PerlJam joined, Alula_ joined 14:02 Alina-malina joined
dalek rlito: 1bf5467 | (Flavio S. Glock)++ | / (3 files):
Perlito5 - string parser flags \E \L \U \Q (more)
14:06 logie joined
masak notices, not for the first time, how often he fails to follow his own advice in strangelyconsistent.org/blog/theres...-wrongness 14:07
it's not even spelled out in that post. no wonder. :)
"When testing that something fails, be sure to test for the *type* of failure."
14:09 bluescreen100 joined 14:12 bluescreen10 left 14:15 Rounin left
moritz that's why implemented typed exceptions :-) 14:16
masak :) 14:17
14:17 Rounin joined
masak moritz++ 14:17
moritz: did you know that Python 2 went through a similar improvement? 14:18
from strings to types.
moritz masak: no, I didn't
masak Python 3.x finally gets rid of the last vestiges of the string ways to throw exceptions.
moritz $ git grep throws_like|wc -l 14:19
$ git grep 'class X::'|wc -l
14:20 donaldh left
moritz the first one was in roast, the second in rakudo 14:20
seems like we're still a bit away from decent coverage here
14:21 kurahaupo left
masak the second insight, which jnthn++ taught me and which I haven't written a blog post about, is that exception objects are *objects*, representing the interesting state at the time of error, along with the interesting follow-up actions you can take from there (e.g. to fix it). 14:22
slogan: "good exceptions tell you what to do next"
moritz that's fine for high-level exceptions
14:22 jnap joined
masak right, my head is in application space ;) 14:23
moritz for low-level exceptions like permissin denied", there simply is no good, universal perspective of what to do next
masak no, those perspectives tend to emerge within a program, not inside the compiler or runtime. 14:24
14:24 donaldh joined 14:26 treehug88 joined 14:27 jnap left 14:29 xenoterracide joined 14:31 jnap joined
dalek rlito: 96ad233 | (Flavio S. Glock)++ | / (3 files):
Perlito5 - string parser flags \E \L \U \Q (more)
14:38 bluescreen__ joined
moritz masak: do you happen to remember that article on (weighted) dice rolling whose URL was floating around here a few times? 14:40
14:41 bluescreen100 left
PerlJam moritz: Are you talking about www.keithschwarz.com/darts-dice-coins/ ? 14:46
14:46 plobsing joined
masak that's the one. PerlJam++ 14:48
vendethiel shouldn't that improvement make perl6 really faster ?
moritz PerlJam++ 14:49
masak vendethiel: Perl 6 is a specification, without any inherent speed.
vendethiel -.-
masak vendethiel: by "that improvement", do you mean the above-linked article?
I don't believe weighted dice rolling is something that tends to be on hot paths... :)
14:49 bluescreen__ left
jnthn Only in .roll :P 14:50
masak oh, does .roll still do weighted?
jnthn No idea :)
vendethiel masak: ah, that's right, there's no mention of that MoarVM commit here
masak oh, that explains it.
vendethiel no, I meant lazily allocate $/ and $!
masak ah, yes.
14:51 daniel-s joined
timotimo i wonder if there's a similarly clever thing to make .pick more efficient when it has n > 1 14:56
moritz timotimo: there are lots of things :-) 14:57
timotimo: assume you have M elements in the list
timotimo: if M >> n, it makes sense to do n separate pics, with a blacklist of already picked elements, and retry if you hit the blacklist
timotimo oh 14:58
moritz timotimo: if n is close to n, you can do a fisher-yates shuffle, and pick the first n elements
timotimo ah, i was actually also thinking of bag semantics, but that can be done with a mapping from n to Bag.kxxv
jnthn r: sub l () { 1, 2 }; my %a; my @z = (%a{'x'} = l, l); say @z.perl 14:59
camelia rakudo-jvm 0a4dad: OUTPUT«(timeout)»
..rakudo-{parrot,moar} 0a4dad: OUTPUT«Array.new($((1, 2), (1, 2)))␤»
moritz and inbetween, you can make a copy of the array; pick one, delete it, move the last element its place, repeat
lizmat masak: fwiw, only scanning the article, I think that's how I implemented Baggy.roll and Baggy.pick 15:00
timotimo that does sound pretty nice and should probably be done at some point :)
#LHF 15:01
15:01 pecastro left 15:02 Alula_ left
jnthn m: sub l () { 1, 2 }; my %a; say l.perl 15:02
camelia rakudo-moar 0a4dad: OUTPUT«(1, 2)␤»
15:02 pecastro joined
jnthn m: sub l () { 1, 2 }; my %a; say (l, l).perl 15:02
camelia rakudo-moar 0a4dad: OUTPUT«((1, 2), (1, 2))␤»
jnthn m: sub l () { 1, 2 }; my %a; say (%a{'x'} = l, l).perl
camelia rakudo-moar 0a4dad: OUTPUT«$((1, 2), (1, 2))␤»
15:02 lvfjf joined
moritz timotimo: actually, List.pick already uses Fisher-Yates 15:04
timotimo: and a lazy one at that :-)
timotimo oh, very good
moritz timotimo: so the only optimization might be to not clone the array if there's a small number of elements picked
timotimo like a single one :) 15:05
moritz timotimo: not sure if that's work it
maybe for really large lists
timotimo already does that
15:05 Alula_ joined
timotimo return self.at_pos($elems.rand.floor) if $n == 1; - for list at least 15:06
PerlJam Just read a brief discussion on #perl regarding threads and the usual mantra of "don't use threads" was, of course, uttered. It is so nice to never have to say that for Perl 6. :-)
15:06 MilkmanDan left
timotimo okay, all that stuff seems to have already seen a slight optimization pass some time in the past 15:06
15:07 MilkmanDan joined
Ulti if I get "Error while compiling op call: Iteration past end of iterator" whilst working with a Grammar.parse() any protips on golfing? 15:07
moritz Ulti: run with --ll-exception, and nopaste the backtrace somewhere 15:08
timotimo that usually happens inside the QAST/Operations.nqp of nqp
moritz detects lighting and thunder, and disconnects his laptop from the power cord 15:10
Battery 0: Discharging, 99%, 03:41:34 remaining
that should suffice :-) 15:11
15:11 igorsutton left
Ulti pastebin.com/6f7eeCZq 15:11
code: gist.github.com/MattOates/0a0dac1fd96377da2c35 15:12
15:12 average joined
Ulti though a much simpler version with just the grammar and .parse had the same problem 15:12
15:12 igorsutton joined
Ulti slurp is all ok 15:12
also perl6 version 2014.04-117-gc9f2239 built on MoarVM version 2014.04-29-ga109e8d 15:13
dalek rlito: 8dda686 | (Flavio S. Glock)++ | / (4 files):
Perlito5 - string parser flags \E \L \U \Q (more)
PerlJam Ulti: What are all of those other letters for in dna/rna? 15:16
Ulti various confusion sets
timotimo bon marcher
Ulti where you aren't sure which of two nucleotides it is
15:16 igorsutton left
Ulti or they have some modification 15:17
masak lizmat: oh -- didn't know that, but very happy to hear it. lizmat++
Ulti like you are talking about weird functionalised short bits of RNA or DNA
PerlJam: if you are super interested en.wikipedia.org/wiki/FASTA_format#...esentation 15:18
masak Ulti: so, basically, any() semantics. :)
Ulti yeah
masak or one(), I guess.
moritz Ulti: now that I'm looking at the backtrace, I have no clue. Sorry :( 15:20
Ulti heh yeah
I'll try something insanely simple like a trivial grammar 15:21
masak pro tip: develop grammars using TDD. you'll thank yourself.
vendethiel is on an unity project and did not find the "tests" button 15:22
timotimo m: for <1 2 3> Z <a b c> -> $a Z $b { say "$a $b" }; # this could do with a better error message, IMO.
camelia rakudo-moar 0a4dad: OUTPUT«===SORRY!=== Error while compiling /tmp/lDELijvTtk␤Missing block␤at /tmp/lDELijvTtk:1␤------> for <1 2 3> Z <a b c> -> $a ⏏Z $b { say "$a $b" }; # this could do wi␤ expecting any of:␤ postfix␤ …»
timotimo m: for <1 2> Z <a b> -> $a Z $b { $a ~ $b } 15:23
camelia rakudo-moar 0a4dad: OUTPUT«===SORRY!=== Error while compiling /tmp/lgqoxfTObL␤Missing block␤at /tmp/lgqoxfTObL:1␤------> for <1 2> Z <a b> -> $a ⏏Z $b { $a ~ $b }␤ expecting any of:␤ postfix␤ infix stopper␤ …»
TimToady why are you putting an operator into a signature?
PerlJam TimToady: that would be the better error message ;) 15:24
TimToady well, unrecognized capitalized words in a sig are much likelier to be types
if it's a rare enough failure mode, it's not worth the dwim, and it does, in fact, point at exactly where the problem was 15:26
perhaps it could see that a { is nearby, and say "Unrecognized stuff before the {" or some such
or maybe "Missing block or malformed signarue" 15:27
we also don't know that they didn't intend => $a 15:28
15:28 Alula_ left
TimToady or suppose they said $a X $b, and really meant $a, X $b 15:28
15:28 Alula_ joined