»ö« 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:01 gfldex left, rmgk left 00:02 eternaleye left 00:03 rmgk joined 00:08 perltricks joined 00:13 eternaleye joined
perltricks hey just polishing my advent article for tomorrow. Is it correct to say single adverb options can omit the ":"? Because qq:x// and qqx// seem to work. 00:16
psch m: say "AbCd" ~~ mi/abcd/ 00:17
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/px7eMn0I9J␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument␤at /tmp/px7eMn0I9J:1␤------> say "AbCd" ~~ mi/abcd/⏏[3…»
perltricks m: say qx/perl6 -v/ 00:18
camelia rakudo-moar 6345f4: OUTPUT«qx, qqx is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:1␤ in sub QX at src/RESTRICTED.setting:9␤ in block <unit> at /tmp/Oj29LqPXjD:1␤␤»
perltricks aww
psch in general "a single adverb doesn't need the colon" is wrong 00:19
perltricks psch: I think it only applies to quoting: "You may omit the first colon by joining an initial Q, q, or qq with a single short form adverb" 00:21
lue Is that in the spec?
psch if that's in the synopses somewhere you can probably say it like that
i wasn't aware of that :)
00:22 murthybalu_ left
lue 'cos as far as I know, stuff like qw is just assigning names to common usages of the quoting/regex langs. 00:22
psch huh, \qq inside \q is gone?
lue ? 00:23
psch it was specced once, but it also was kinda out-there
m: say \q[\o[40]]
camelia rakudo-moar 6345f4: OUTPUT«\(\o[40])␤»
psch m: say \qq[\o[40]]
camelia rakudo-moar 6345f4: OUTPUT«\( )␤»
psch ehh
perltricks psch: sorry yah I found it after I asked the question: perlcabal.org/syn/S02.html#Adverbs_on_quotes
psch m: say \q{\qq[\o[40]]}
camelia rakudo-moar 6345f4: OUTPUT«\( )␤»
psch perltricks: no worries, happens to me a lot 00:24
lue: it's apparently not gone, i just didn't invoke it correctly
lue psch: I have no idea what you're doing right now O_o
psch lue: we have \qq as a special quoting construct inside \q
lue Never in my life have I seen \qq *or* \q 00:25
psch m: say q["my literal text, except \qq{LATIN CAPITAL LETTER A}"]
camelia rakudo-moar 6345f4: OUTPUT«"my literal text, except LATIN CAPITAL LETTER A"␤»
psch something like that :/
lue m: say q["my literal text, except \qq{\c[LATIN CAPITAL LETTER A]}"] 00:26
camelia rakudo-moar 6345f4: OUTPUT«"my literal text, except A"␤»
psch ...exactly. sorry, i'm a bit unfocused atm
lue no worries :) .
psch i'm having fun with objectweb.asm and invokedynamic 00:27
trying to dynamically install a interopish-method that prints the types of the arguments it was called with 00:28
and something is amiss, but i'm not sure what
00:33 BenGoldberg joined
colomon psch: sounds like the story of my life. ;) 00:56
psch colomon: being unfocused and not knowing what's missing? or trying to install interopish methods? :) 00:57
colomon "something is amiss, but i'm not sure what" :) 00:58
psch well, i do get an error from the jvm, and it's kind of informative, but... 01:01
01:01 bcode left 01:11 rurban joined
japhb_ WIP macro idea, but I have to switch computers: gist.github.com/japhb/92442a22962c5156e102 01:18
masak, TimToady: ^^
01:22 rurban left
psch ugh 01:26
docs.oracle.com/javase/7/docs/api/...20boolean)
the bools doesn't convert the last param, it adds a param 01:27
*bool
that was missing
01:32 raiph left 01:58 bcode joined 02:00 prevost left 02:10 Akagi201 joined 02:15 Akagi201 left 02:17 Mso150 left 02:18 Mso150 joined 02:24 colomon left, colomon joined 02:31 prime left 02:33 erkan joined 02:38 eternaleye left 02:45 raiph joined
raydiak if I write 10 paragraphs into a comment box and the captcha is "prosodic", does it mean I'm being watched? :) 02:46
colomon the internet knows everything, raydiak 02:48
02:50 eternaleye joined
raydiak *shudder* 02:50
the internet was actually kinda a small part of my rant in a way, so I'm sure it's out to get me now if it wasn't before... 02:51
raydiak was thinking about growing the rant into a small book 02:52
03:03 eternaleye left 03:06 Mso150 left 03:07 Mso150 joined 03:09 eternaleye joined 03:17 noganex joined
perltricks ok, advent article is live perl6advent.wordpress.com/ 03:18
I guess it's Saturday in Europe
psch it's 4:19 am 03:19
so, yes, it is saturday :) 03:20
03:20 noganex_ left 03:22 Mso150 left 03:23 Mso150 joined
psch but then europe is actually bigger too... 03:26
bigger than one timezone that is
03:31 aborazmeh left 03:46 aborazmeh joined, anaeem1_ joined 04:07 raiph left 04:11 BenGoldberg left 04:12 Akagi201 joined, kurahaupo joined 04:16 Mso150_e joined, Mso150 left 04:17 Akagi201 left 04:32 Akagi201 joined 04:39 tinyblak joined 04:41 tinyblak_ joined 04:44 tinyblak left 04:46 perltricks left 04:51 tinyblak_ left 04:54 tinyblak joined 04:56 perturbation left, kurahaupo left 04:57 aborazmeh left 05:10 anaeem1_ left 05:13 anaeem1 joined 05:18 anaeem1 left 05:27 KCL_ joined 05:40 tinyblak_ joined 05:42 tinyblak left
psch hrm, the current hurdle is getting the GlobalContext from a static method (or un-static-ing the method which i might not be able to) to unbox SixModelObjects into their jvm equivalent :/ 06:13
but that's definitely beyond my current wakefulness, g'nite #perl6 \o
06:19 psch left 06:33 raiph joined 06:48 ChoHag left 07:12 raiph left 07:19 anaeem1_ joined 07:22 bjz_ left 07:24 bjz joined 07:25 vti joined 07:53 anaeem1_ left, anaeem1 joined 08:16 isBEKaml joined
[Tux] Slang::Tuxic broken? 08:17
===SORRY!=== Error while compiling test-t.pl
Two terms in a row
at test-t.pl:76
------> my $msg = $reason.sprintf ⏏(@args);
08:27 Alina-malina left 08:28 Alina-malina joined 08:32 Alina-malina left 08:33 darutoko joined 08:35 kaare_ joined 08:37 eternaleye left 08:41 eternaleye joined 08:42 Alina-malina joined 08:45 avar left, avar joined 08:46 avar left, avar joined 08:47 avar left, avar joined, avar left, avar joined 08:48 avar left, avar joined, avar left, avar joined 08:49 mvuets joined, avar left, avar joined, gfldex joined, rindolf joined 08:51 avar left 08:52 avar joined, avar left, avar joined, Sqirrel_ left 08:53 bjz left, bjz_ joined 08:55 Sqirrel joined 08:57 KCL_ left 09:00 Sqirrel left 09:07 Sqirrel joined 09:17 isBEKaml left 09:21 telex left 09:22 telex joined, rindolf left 09:30 vendethiel joined 09:31 rurban joined 09:39 kurahaupo joined
mvuets greetings #perl6 09:40
is it correct to think that «if $_ ~~ $foo» is equivalent to «when $foo»? 09:43
moritz mvuets: nearly; 'when $foo' also exits the outer given { } block 09:45
m: given 42 { when 42 { say 1 }; say 'outer' }
camelia rakudo-moar 6345f4: OUTPUT«1␤»
moritz m: given 42 { if $_ ~~ 42 { say 1 }; say 'outer' }
camelia rakudo-moar 6345f4: OUTPUT«1␤outer␤»
09:46 rindolf joined
mvuets oh i see. hmm. i was thinking how to match against $_ implicitly, like perl5's «say 1 if /42/» 09:48
realized 'when' can be used naked, w/o 'given' 09:49
moritz mvuets: also a regex in boolean context automatically matches against $_
m: $_ = 42; say 1 if /4/ 09:50
camelia rakudo-moar 6345f4: OUTPUT«1␤»
moritz m: $_ = 23; say 1 if /4/
camelia ( no output )
mvuets ENOTENOUGHCOFFEE (-:
m: sub x {42} say x() 09:57
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/pi80yFjsff␤Two terms in a row␤at /tmp/pi80yFjsff:1␤------> sub x {42} ⏏say x()␤ expecting any of:␤ postfix␤ statement end␤ statement modifi…»
mvuets m: sub x {42}; say x()
camelia rakudo-moar 6345f4: OUTPUT«42␤»
mvuets is semicolon really necessary?
...when written in a single line? 09:58
moritz std: sub x {42} say x()
camelia std 76ccee1: OUTPUT«===SORRY!===␤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/CYFTGSC9yg line 1:␤------> sub x {42}⏏ say x()␤ expecting any of:␤ horizontal whitespace␤ infix or meta-infix␤ infixed …»
mvuets perlcabal.org/syn/S04.html#Statemen...ing_blocks 10:00
moritz just wanted to see STD.pm's error message 10:03
mvuets shown he found the answer on his question 10:05
moritz then we're all a happy bunch, no? :-) 10:06
mvuets surely 10:08
if using naked 'when' is not discouraged, it is very tempting to write... 10:09
m: $_ = "happy"; say "surely" when "happy"
camelia rakudo-moar 6345f4: OUTPUT«surely␤»
10:12 Sqirrel left 10:13 Sqirrel joined 10:16 prevost joined 10:17 Sqirrel left 10:18 isBEKaml joined, ptc_p6 joined 10:30 prevost left 10:33 Ugator joined 10:35 anaeem1 left 10:36 anaeem1 joined, FROGGS joined 10:37 vendethiel left 10:40 anaeem1 left 10:47 onebitboy left 10:50 anaeem1_ joined 10:57 Alina-malina left 11:00 anaeem1_ left, anaeem1 joined 11:01 anaeem1 left, anaeem1_ joined 11:06 anaeem1_ left 11:19 Alina-malina joined 11:21 Mso150_e left, anaeem1 joined 11:22 onebitboy joined 11:26 anaeem1 left 11:27 isBEKaml left 11:39 vti left 11:43 bjz_ left, Roonin joined 11:44 pecastro left 11:46 pecastro joined 11:51 bjz joined 12:00 rindolf left 12:15 psch joined
psch hi #perl6 12:17
mvuets: RT #71368 exists
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...l?id=71368
psch i'm not entirely sure that's up-to-date enough to be definite about a sole when outside a topicalizer, though 12:18
mvuets oh, it's a forbidden construct )-: i thought it was a feature 12:19
psch: maybe semantic changed, see the very end of this section perlcabal.org/syn/S04.html#Switch_statements 12:24
masak oh hai, #perl6 12:25
psch mvuets: yeah, i was looking at S04 and didn't find "mortal sin" anywhere
mvuets ehm, well, that's a statement modifier though
m: $_=42; when 42 {say "yay"} 12:26
camelia rakudo-moar 6345f4: OUTPUT«yay␤»
psch hi masak o/
mvuets in repl i also get a warning "succeed without when clause"
m: $_=42; say "yay" when 42;
camelia rakudo-moar 6345f4: OUTPUT«yay␤»
mvuets and this one does not generate a warn, all good 12:27
psch m: for 1..10 -> $x { $_ = 3; when 3 { print "_" }; say $x } 12:29
camelia rakudo-moar 6345f4: OUTPUT«__________»
psch i'm not sure i could explain that... 12:30
colomon why not? 12:35
psch is it just "when as statement always breaks topicalizers, no matter what it matches against"?
might be i'm not awake enough yet.. :) 12:36
colomon …. breaks topicalizers?!?
mvuets i think 'when' is legit inside the 'for' loop
colomon absolutely when is legit inside a for loop
it's a great idiom, actually
mvuets it is, however in psch's example for does not really topicalize 12:37
psch colomon: "breakout semantics" is what S04 uses, so i probably should have written "breaks out of topicalizers" or something like that 12:38
i.e. "end the current iteration"
colomon I understand it as "it ends the current block" 12:39
so if it's iterating, yes, it goes to the next iteration 12:40
mvuets like 'next', right?
colomon right
psch right, that's probably more correct
mvuets seems to be DWIM-y 12:41
colomon m: for 1..10 { when 3|4|9 { print "_" }; when * %% 2 { print "$" }; print $_; } 12:42
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/QSuJohKGOm␤Non-variable $ must be backslashed␤at /tmp/QSuJohKGOm:1␤------> 4|9 { print "_" }; when * %% 2 { print "⏏$" }; print $_; }␤ expecting any of:␤ arg…»
colomon m: for 1..10 { when 3|4|9 { print "_" }; when * %% 2 { print "\$" }; print $_; }
camelia rakudo-moar 6345f4: OUTPUT«1$__5$7$_$»
mvuets wait what? 12:44
«when * %% 2» === «when $_ %% 2», huh?
psch mvuets: topicalized, yes. the WhateverCode gets $_, because that's what when takes 12:45
mvuets bizarre [= 12:46
psch m: say (^10).grep({ $_ %% 2 }); say (^10).grep(* %% 2); # think of it like this
camelia rakudo-moar 6345f4: OUTPUT«0 2 4 6 8␤0 2 4 6 8␤»
psch or @_[0] or even $^a instead of $_ if you want 12:47
mvuets re 'for', topic, and 'when': S04 reads "If the smart match succeeds, when's associated block is executed, and the innermost surrounding block that has $_ as one of its formal parameters (either explicit or implicit) is automatically broken out of." - maybe 'broken out' is ambiguous here?
psch: cool! * is still a new beast to me. 12:48
psch hm, i think in my example the "has $_ as one of its formal parameters" is what's not working as designed
i.e. the for doesn't use $_ implicitely or explicitely, but the when still breaks it
*breaks out of it
mvuets yeah, i wasn't sure about that behavior either. that's what i meant saying your example does not topicalize 12:49
like 'for' is used as an excuse to set the topic by hand and then use 'when' 12:50
psch i'm not sure there's situation where not breaking there actually makes sense, though
colomon (sorry for disappearing there) If you smartmatch against a WhateverCode, it runs the WhateverCode against the item you are trying to smartmatch -- in the case of "when", that's $_ 12:53
12:56 vti joined
colomon doesn't like explicitly saying $_ if he can avoid it 12:57
mvuets colomon: yeah, makes perfect sense now. psch's example demonstrates that well 12:58
13:05 anaeem1_ joined 13:07 BenGoldberg joined 13:08 anaeem1_ left, anaeem1 joined, anaeem1 left, anaeem1_ joined 13:17 spider-mario joined 13:19 Ugator left, denis_boyun_ joined 13:20 Alina-malina left, FloLo joined, Alina-malina joined
[Tux] whoever fixed Slang::Tuxic, thanks! 13:26
13:29 rindolf joined, kurahaupo left 13:32 aborazmeh joined 13:35 aborazmeh left
masak can't have been a fix to the repo itself -- that was 26 days ago. 13:36
[Tux] panda did not pull. I think that was why it failed 13:37
I had to go into the repo to pull again
by now, I am so used to 'rakudobrew build moar' doing everything by itself
tadzik :) 13:38
it should make panda re-pull all the things though
[Tux] well, it didn't :/
tadzik weird 13:39
I don't think it even keeps the old repos around these days
(I'm pretty sure it does not)
13:51 rurban left 13:52 rurban joined 13:55 rurban left 13:56 rurban joined 13:58 vendethiel joined
vendethiel o/, #perl6 14:01
psch \o vendethiel 14:03
FloLo Hello #perl6,
I'm dreaming of something like Inline:R - it would be so handy to have all the cran packages available, how hard would that be to achieve?
does anyone here know R? 14:04
psch FloLo: did you have a look at Inline::Perl5 or Inline::Python for inspiration?
arnsholt R saved my butt about a year back
So nice for stats 14:05
FloLo I looked at python - but that kinda scared me :D
I'd propably need some help ;) 14:06
psch fwiw, i don't know R
arnsholt: can you take a look at my jvminterop stuff? i'm not quite sure how to continue from where i am right now 14:10
FloLo is there some blog posts about inlining?
psch FloLo: you probably want to look at NativeCall at github.com/jnthn/zavolaj/
arnsholt: github.com/peschwa/rakudo/blob/jvm...p.java#L56 around here specifically 14:11
FloLo ah :) thx psch
FROGGS o/
psch \o FROGGS 14:12
14:16 raiph joined 14:20 mvuets left
dalek ake: 956b7e2 | (Arne Skjærholt)++ | README:
Add a README.
14:34
arnsholt psch: I'm not terribly familiar with the JVM stuff. What's going wrong? 14:37
psch arnsholt: the main problem i'm having is that i'm not sure how to get a P6Opaque into the right java type
i've asked you 'cause i remembered the offer to help with ASM.jar and this is in the same ballpark, i think 14:38
afaiu, the installation of the invokedynamic callsite works 14:39
but inside the targetted method i have no clue how to get the java types from the P6Opaque, to test for the right MethodHandle 14:40
i think i'd need the GlobalContext to unmarshal, but i don't think i can easily get at it
if at all
arnsholt The GlobalContext should be possible to get at 14:41
Being global, and all
But you may have to thread it in from the calling code somewhow 14:42
*somehow
psch optional arguments for indy bootstrap methods are limited in the types the can accept, so i can't pass it through to the callsite-generating code and install it with together with the target 14:44
arnsholt Set it as a property on one of the parameters perp 14:45
*perhaps?
psch "Each argument must be an Integer, Float, Long, Double, String, Type or Handle value." 14:47
i don't know how i would set a property on any of those
arnsholt Hmm 14:48
FROGGS psch: why do you want to pass a SMO to java anyway? 14:49
14:51 zakharyas joined
arnsholt psch: Maybe you can extend the Handle class to have a parameter you can use? 14:51
psch FROGGS: so i'm (trying to) convert wrongly? i do want to pass the corresponding java-ish type with its value 14:52
RuntimeSupport.unboxJava is what marshalOut uses to get the value to java 14:53
oh hm 14:54
but it does more too, and i have to do the same 14:55
hoelzro o/ #perl6
psch so i guess i actually want to dynamically call marshalOut instead of trying to replicate its behavior..?
FROGGS hi hoelzro 14:56
psch hoelzro \o
FROGGS what type do you want to pass to Java in your test case right now? 14:57
14:57 Ben_Goldberg joined
psch FROGGS: i'm testing with a (String, int) method 14:58
i have another overloaded with (int, int)
that's why i'm installing a varargs method with (Object[]) Object 14:59
15:00 smls joined
psch uh, the first one is (int, String), the second one is only (int) 15:00
confused my test cases...
15:00 BenGoldberg left
FROGGS so you just want to get the String or int out of an P6opaque? 15:02
psch right, i just want the value out of the P6opaque
FROGGS you could look at nqp/src/vm/jvm/runtime/org/perl6/nqp/runtime/NativeCallOps.java:266 15:04
in combination with line 154 15:06
15:06 rindolf left 15:07 rindolf joined 15:08 usernotexists joined
psch FROGGS++: thanks, that does look like it could help (also arnsholt++ for suggestions) 15:10
smls posted rant in perl6advent comment section 15:11
Is it too late to rethink/improve Perl 6's built-in "running external commands" support? 15:13
FROGGS no
we know that there is a need to change/improve certain things 15:14
smls Would something like the Perl 5 function I posted (perl6advent.wordpress.com/2014/12/0...m-perl-6/) be possible to do in a cross-platform way?
And somehow get the exit status into the return value, so we don't need "$?" ? 15:15
moritz I wonder of IO::Handle.pipe can do that
FROGGS well, pipe() goes in that direction
moritz but I'd really prefer a run('command', @args, :capture) 15:16
FROGGS and is quite new (just a month old)
moritz and it'd capture the output streams from the process it spawns
FROGGS one would just have to look at proc_exec from php... we should be in a position to what it does in a even nicer way 15:17
to do*
smls What moritz said. 15:18
FROGGS would be nice if pipe(), shell() an run() would share a common interface 15:19
moritz maybe run(:shell :capture/:pipe) 15:20
smls Maybe instead of returning a Proc::Status, run() could return a Proc::Result that stringifies to captured STDOUT (but otherwise behaves like Proc::Status)
moritz smls: or more explicitly, $res = run($prog, :capture); $res.out; $res.err; $res.return-code 15:22
15:22 mvuets joined
smls yeah 15:22
moritz bonus points for :async, which will start the program, but doesn't wait for its completion 15:23
and then $prog.{in,out,err} would be handle 15:24
s
smls ++ to that 15:26
FROGGS you should also consider what should happen when you mess with $*OUT and so on 15:27
hoelzro I was thinking about determinate return values again yesterday (ie. sub foo(--> $var) { ... }), and something occurred to me 15:30
the spec says to indicate that if you --> $var, it will use an existing variable as the return value
but if you use a *non-existing* variable, it will create a variable local to your sub for you 15:31
I was thinking that the latter being implicit could result in odd behavior, so I was thinking that maybe the right thing to do would be to force a user to explicitly declare a new variable via sub foo(--> my $result) { ... } 15:32
any thoughts?
FROGGS m: sub foo($x = my $y = 42) { say $y }
camelia ( no output )
FROGGS m: sub foo($x = my $y = 42) { say $y }; foo()
camelia rakudo-moar 6345f4: OUTPUT«42␤»
FROGGS m: sub foo($x = my $y = 42) { say $y }; foo(); say $y 15:33
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/NsEbtHqXOc␤Variable '$y' is not declared␤at /tmp/NsEbtHqXOc:1␤------> = my $y = 42) { say $y }; foo(); say $y⏏<EOL>␤ expecting any of:␤ postfix␤»
FROGGS hoelzro: yeah, that sounds sane :o)
since the signature seems to be part of the routine
's body anyway
hoelzro: so quick! respec it! :o) 15:38
moritz / smls: I'd like to see the following: run('foo', @args, :env({ foo => 42 }), :$out, :$err, :$in), and then I could read from $out/$err and print to $in 15:41
and since the nqp::openpipe is new and not used in nqp's stage0, we are free to change its signature 15:42
like passing filehandles...
hmmm, this could actually work... I was thinking about that quite for a long time, problem always was that an op can only return one thing, but if we provide filehandles from P6 world, we can do whatever we like 15:43
smls but then you would have to declare a variable for STDOUT in your lexical scope each time I want to run a command and get its output 15:44
s//you/
15:46 tinyblak_ left 15:47 tinyblak joined
smls with a Proc::Result return value that stringifies to STDOUT and and boolifies to return status, I could elegantly write: 15:47
my $result = run('foo', @args) || die "Program foo reported failure\n";
FROGGS smls: passing :$out would be just one way to do it 15:48
moritz and if it's not passed, it can always be captured automatically
FROGGS in case to let the child process print to an already opened handle
betterwo1ld if you make stdout and stdin more flexible, it might be worthwile to have an option to combine several processes into one pipeline, like a bash pipeline
that's what python does with the Popen interface 15:49
moritz yes, a :merge or so
FROGGS if you don't pass :out but :capture, the method/sub in perl 6 would open a handle, and pass that down to the vm, and return it as part of the Proc::Something
smls FROGGS: good point re "already opened handle"
mvuets m: $mul = * * *; say $mul(3, 4); # zomg! (-:
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/V84xVTKaMD␤Variable '$mul' is not declared␤at /tmp/V84xVTKaMD:1␤------> $mul⏏ = * * *; say $mul(3, 4); # zomg! (-:␤ expecting any of:␤ postfix␤»
FROGGS m: 6; $mul = * * *; say $mul(3, 4); # zomg! (-: 15:50
camelia rakudo-moar 6345f4: OUTPUT«12␤»
FROGGS betterwo1ld: can you paste an example code here?
I'm not even a python beginner
mvuets FROGGS: huh! how come that 6 matters?
betterwo1ld FROGGS: i think so.. it might take a while to come up with a nice example
FROGGS mvuets: that '6' is a shorthand of 'no strict' 15:51
mvuets FROGGS: errrr....
15:51 tinyblak left
FROGGS betterwo1ld: but the idea is to pass the $out of the first process as the $in of the second? 15:51
mvuets FROGGS: REPL and -e are 'no strict', when running from a file and the bot are 'strict', correct? 15:52
betterwo1ld FROGGS: yes. Like in a bash command, e.g. tail file.txt | grep foobar
FROGGS mvuets: correct
betterwo1ld: k
betterwo1ld: I dunno if we can let pipes to that for us... run('foo') ===> run('bar') 15:53
betterwo1ld actually I came up with that fantasy some months ago (the pipe operators for commands :)
FROGGS my problem is that I have no idea how thes pipe ops work, nor what they are supposed to do :o) 15:54
moritz the problem with the feed syntax is that it assumes only one stream
FROGGS .oO( ≡≡≡> ) 15:56
unicode to the rescue /o/
15:56 tinyblak joined 15:57 rurban left
smls FROGGS: Or instead of separate «:out» and «:capture», «:out($handle)» and «:out(True)» 15:57
15:57 BenGoldberg_ joined
moritz smls: that sounds good too 15:58
FROGGS :out(True) would be :out in short
15:58 rurban joined
FROGGS which is not bad at all 15:58
16:00 Guest40300 left
psch Proc::Status could .list() to { $status ?? $out.read !! $err.read } or something like that i guess 16:01
16:01 Ben_Goldberg left
moritz .list to a single item? sounds wrong-ish to me 16:01
FROGGS yeah
that sound like a misuse :o)
so, the smallest steps we could take are: 16:02
1) allow to pass opened fhs to pipe(), which are passed down to the vm, if these are omitted the current way is kept (inheriting the handles)
2) extend Proc::Status by .in, .out, .err
psch i'm not firm on what exactly Handle.read does, i might mean .lines
FROGGS I have the feeling that 1) and 2) are clashing slightly
psch but that falls into the same troublesome spot for m:g/$pat/ { } falls as i implemented it 16:03
i.e. "how do we know we want to .list() if something also .Str()s"
moritz psch: it's not really a problem; we can just return an object that knows its stuff 16:04
psch moritz: right, but that currently doesn't work
m: class A { method Str() { "foo" }; method list() { <a b c> } }; for A.new { .say } 16:05
moritz psch: with m:g// and s///, the problem is that people have firm expectations
camelia rakudo-moar 6345f4: OUTPUT«A.new()␤»
psch hrm, i'd have to look up the exact example...
betterwo1ld FROGGS: a python example for a pipeline is at docs.python.org/2/library/subproce...l-pipeline
moritz psch: if we design a Proc::Status from the ground up, we can make a good API that people won't feel the need to abuse
betterwo1ld the code does the same as the bash code output=`dmesg | grep hda` 16:06
that might be tricky in perl
16:06 Akagi201 left
psch irclog.perlgeek.de/perl6/2014-08-15#i_9188844 around here 16:07
betterwo1ld if you want to avoid calling the shell completely (which is the case if have user input to pass around)
psch anyway, +1 to "a good API that people won't feel the need to abuse"
16:08 pmurias joined
pmurias hi 16:08
FROGGS betterwo1ld: ahh yes, we can make that work with the model we just discussed
hi pmurias
dalek p-js: 23ff160 | (Pawel Murias)++ | src/vm/js/bin/run_tests:
Add test 69 to list of passing tests.
nqp-js: cb0e297 | (Pawel Murias)++ | src/vm/js/mini-setting:
nqp-js: Export all the HOWs from the mini-setting
16:08 dalek left
psch pmurias o/ 16:08
vendethiel pmurias++
moritz I think I'd prefer run('dmesg', :out, :async).pipe-to('grep')
pmurias dalek needs to be made more resilent 16:09
16:09 dalek joined, ChanServ sets mode: +v dalek
vendethiel pmurias: well, chanserv punishes harshly 16:10
16:10 mr-foobar joined
bcode eh, it's not ChanServ; that's the ircd going all "EXTERMINATE" 16:10
(sorry, I do some dev on IRC stuff so tend to be extra pedantic about that :P)
betterwo1ld if you need help, I should be able to come up with the low-level code to implement that piping stuff on Linux. Don't know about Windows, though 16:15
FROGGS betterwo1ld: we use libuv for that on moarvm, and plain C for parrot... and then there is the jvm :o) 16:16
doing it for moarvm shouldn't be that hard... 16:17
except that I don't know how to merge stdout and stderr
moritz listen on out and err, open another stream and write to taht 16:18
smls lets get the design right first, though
FROGGS smls: well, the low level op is quite decoupled from what we expose in Perl 6 land 16:19
smls right
FROGGS and we do not have many options about what to do in the low level op
smls then, feel free to implement away... :)
mvuets RFC: S24, make skip($reason, *) behave like skip_rest($reason) 16:21
moritz mvuets: and then deprecated skip_rest 16:24
16:24 FloLo left
vendethiel bcode: sorry, was joking. I've done some myself, I can identify anope services etc 16:24
16:24 araujo left
mvuets moritz: yes! (didn't dare to say that) (-: 16:24
16:26 araujo joined
smls FROGGS, moritz: Would it be useful if I compiled a structured overview of what the different potential use-cases and demands for running external commands are, what our «shell/open/pipe» currently support, what Python's «subprocess» module supports, and what would be possible with the ideas for extending «run» mentioned by everyone above? 16:27
Do we have a wiki for that kind of thing?
FROGGS smls: ohh yes, please do
no, we don't have a wiki anymore
smls a mailing list might be good for this too, but perl.perl6.language doesn't seem to be used much except by the commit bot... 16:31
So gisthub it is, I guess ;) 16:32
hoelzro FROGGS: maybe I should get TimToady's input? or is that not really necessary these days? 16:33
moritz smls: gisthub would be fine 16:34
FROGGS hoelzro: he'll review and can talk to you 16:36
smls Ok, though I won't finish it today. (There's no hurry, is there?)
FROGGS smls: no
smls btw. I might have mentioned this before, but I think it might be a good idea to start moving some of the Perl 6 design/development discussion to a more structured medium like a mailinglist 16:40
in IRC, things can get lost in chatter or if the "right" person wasn't online at the time and doesn't backlog diligently 16:41
and it makes it difficult for new people to find what was already discussed on a certain topic, and what the conclusions were
mailing lists provide a separate thread for each topic, so people don't need to "backlog" through unrelated noise to read up on the diuscussion on things they're interested in 16:43
Of course, the benefit of IRC is that it facilitates more personal/fun and also faster communication
So I wouln't want to discourage that either 16:44
psch i think the problem is that replicating irc discussions on some structured medium is tedious and as unfun as it gets
you won't ever get people to not discuss things on irc, so we'd need a scribe to order it by topic etc. 16:45
but then, we have the synopses on one hand and the clog on the other
smls Qt manages to do it
psch maybe a case could be made for "let's write down results in perl6/spec branches and see about merging them after implementations show usefulness" or similar 16:46
where "results" == "results from discussion that lead to implementable proposals"
smls they have people discussing things on IRC channels, or in person (if they work for the same company), but if no write-up was posted to the mailing list, any decisions reached are not official.
psch but then, i also have a feeling that these kinds of things have been discussed before...
which kind of proves the point of "structured write ups would be nice" :) 16:47
moritz smls: perl6-language was masterful in the discipline of drowning useful discussion in chatter
smls i.e. they use the motto "if the mailing list wasn't told, it didn't happen"
psch afaik we're working towards "what roast expects is what's official" 16:48
i.e. if there's no tests it didn't happen
moritz where "chatter" mostly meant overreaching discussions which didn't help the slightest
I remeber asking about how a few methods should be named, and some answers proposed a far-reaching change to the object model itself
16:49 M_o_C joined
smls Well but now that Perl 6 is much closer to converging on 6.0, maybe the discussions would be more focused and useful? 16:50
moritz not on p6l
maybe on a new mailing list that starts from scratch
smls fine by me :) 16:51
hoelzro hmm, now that I re-read that section of S06, it looks like a return parameter *always* declares a new variable
Ulti smls have you seen irclog.perlgeek.de/perl6 ?
hoelzro kind of like for @values -> $var { ... } 16:52
smls psch: "if there's no tests it didn't happen" only works for actual, final design changes.
"if the mailing list wasn't told, it didn't happen" also works for setting not-yet realized plans and goals
Ulti: Of course, but that's not the same :) 16:53
Ulti I dunno I find it about as easy to find something in there as I do mailing list logs :S 16:54
psch smls: right, but discussion (hopefully) leads to someone championing the implementation. i'm proposing that the branch that implements also features a branch on perl6/spec that adjusts the synopses and of course the branch on perl6/roast 16:56
Ulti plus there is all the discussion that happens on bug tickets and github
psch in my perception lizmat++ is the most diligent about adjusting the synopses to her changes on roast and rakudo
but that's mostly because she's actually working on things that aren't quite spec
i for example am guilty of not writing a perl6/spec branch for changes to commandline parsing... :) 16:57
16:57 Ben_Goldberg joined
psch (there is the advent post thingy at the moment, though...) 16:58
17:01 BenGoldberg_ left
psch hm, there's the obvious gap in the "hopefully"... i think i'm convinced that there should be a grouping of discussions and their result 17:05
smls++
smls btw I also wouldn't let bugtracker/commit bots post to the list, as that just adds noise 17:06
FROGGS hoelzro: so it is consistent with every other variable name in a signature
hoelzro FROGGS: right, that makes a lot of sense to me
FROGGS yeah, to me too :o) 17:07
hoelzro I'm just wondering if one would ever want to use an outer variable as a return variable, *without* shadowing it
that seems kind of evil to me
17:07 Akagi201 joined
smls One mailinglist thread per topic, starting with a link to a pre-existing discussion if applicable, followed by replies/discussion, and ending with a link to a commit, would be ideal 17:07
FROGGS hoelzro: there's still OUTER::<$foo> and CALLER::<$bar> 17:08
smls When a commit happened, the discussion is (ideally) already over, so it seems silly for a bot to start a thread about it *then*.
hoelzro ah, good point
FROGGS hoelzro: which already look a bit suspicious as they should :o) 17:09
hoelzro I think that that level of explicitness is good
indeed
moritz smls: we're operating on "foregiveness is beter than permission" 17:10
smls: so that's not quite right
17:12 Akagi201 left 17:18 kurahaupo joined, lucas_ joined
lucas_ hi 17:19
I agree with some of the things smls++ is saying about IRC vs. mailing list
Have you peolpe saw the PHP RFC voting process? Having a web form like "Do you agree? Yes/No" really works for them... 17:20
I've proposed having a MediaWiki instance, but that doesn't seem to be of interest to some. 17:21
*people 17:22
17:23 rindolf left 17:24 rindolf joined
moritz except that a majority vote on individual features won't lead to cohesive design 17:24
it's the old "design by comittee" fallacy
hoelzro m: my sub foo(Str $) {}; my sub call-stringy(&f(Str)) { f(''); }; call-stringy(&foo) 17:30
camelia rakudo-moar 6345f4: OUTPUT«Too few positionals passed; expected 1 argument but got 0 in sub-signature of parameter &f␤ in sub call-stringy at /tmp/Fl84QLq_aG:1␤ in block <unit> at /tmp/Fl84QLq_aG:1␤␤»
hoelzro rakudo bug?
or am I doing it wrong?
FROGGS bug and already ticketed lately 17:32
hoelzro ok, thanks FROGGS
hoelzro searches
wow, over a month ago 17:34
FROGGS rt.perl.org/Public/Bug/Display.html?id=123116
dalek ecs: caacd06 | (Rob Hoelz)++ | S06-routines.pod:
Clarify return variables' behavior wrt. shadowing
17:40
masak moritz: Haskell was designed by committee. it turned out quite well. but that's the only case I know. 17:41
moritz: oh, and the EcmaScript 6 committee, TC-something, is doing fairly well too. 17:42
17:44 M_o_C left
hoelzro m: my sub foo(Str $) {}; my sub call-stringy(&f:(Str)) { f(''); }; call-stringy(&foo) 17:48
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: P6opaque, cs = 0)␤»
hoelzro huh
is it &f(Str) or &f:(Str) in the signature?
roast/specs seem to indicate the latter
moritz m: say &f(Str).^name 17:49
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/CP60J69q40␤Undeclared routine:␤ &f used at line 1␤␤»
moritz m: sub f(&a(Str)) { }; say &f.signature.params[0].perl
camelia rakudo-moar 6345f4: OUTPUT«&a (Str)␤»
17:51 rindolf left 17:52 rindolf joined
pmurias lucas_: I'm not sure PHP is something we should take design advice from ;) 17:52
lucas_ pmurias: Open source development issues are common to all projects. I'm not talking about the language. :) 17:54
17:56 FROGGS left, mayuresh joined
mayuresh hello :) 17:56
anyone around? 17:58
japhb_ masak, any thoughts on the (admitedly nebulous) macro idea I had last night?
mayuresh okay.
any rationale for using the virtual machine + compiler approach for perl6?
instead of the old style interpreter based one?
17:58 xinming_ joined
pmurias speed? 17:59
mayuresh of execution! or development? 18:00
pmurias executiom
* execution
mayuresh hmnn
psch doesn't perl5 also run on what is essentially a vm?
pmurias yes
japhb_ psch: It's a well-tuned interpreter.
mayuresh well, in the same vein, everything on a computer is always interpreted by the processor. 18:01
;)
smls pmurias: Well, Perl 6 isn't exactly beating Perl 5 when it comes to speed... :P
pmurias I think we are beating bash
mayuresh :D
pmurias which is an example of an old-style interpreter ;)
smls oh
psch japhb_: right, so there is a distinction that i would recognize if i was more familiar with both terms
mayuresh would the community be averse to accepting a Perl6 interpreter? 18:02
psch s/$/?/
18:02 xinming left
mayuresh written in c89? 18:02
japhb_ mayuresh: Are you planning to write one?
mayuresh portable.
japhb_, yes
psch mayuresh: the official position is "if it passes the spectest it's perl6"
mayuresh sounds fair enough
psch mayuresh: see those at github.com/perl6/roast
japhb_ You're quite welcome to write a new implementation of Perl 6. That's been officially OK since the start.
mayuresh oh, i thought parrot + rakudo 18:03
pmurias mayuresh: what do you regard as the distinction between a vm and an interpreter?
mayuresh are the only official stuff
psch that reminds me, there was someone who was implementing perl6 in c/c++ some weeks/months back..?
mayuresh pmurias: oh, someone's already started?
dang
no worries
i will still start work as soon as i finish my training in comp sci 18:04
japhb_ Warning: implementing all of Perl 6 is A LOT OF WORK.
pmurias moarvm is written in c
mayuresh which is just 18 months away
somehow, VMs make me feel very uncomfortable
a machine layered upon another machine
japhb_ mayuresh: Probably easier to write an interpreter that can run NQP code. 18:05
mayuresh nqp? is that "not quite perl"?
pmurias mayuresh: and how will your interpreter run? in clockwork?
mayuresh i have already been told to write an interpreter as a rite of passage at the end of my training
am still 18 months away from starting off 18:06
japhb_ mayuresh: yes. It's another layer. :-) Basically it's a restricted version of Perl 6 that's smaller, easier to optimize, and tuned for writing compilers.
mayuresh so we go from code, execute
to code, compile, run in a VM approach
sounds very painful to mme
similar to java and c# 18:07
pmurias and any sane language
japhb_ jnthn++ has some good presentation slides on why this layering is a good thing.
psch heh, WhateverCode in c++ *shudder*
mayuresh hey, even i shudder about c++ now-a-days 18:08
c++ 11/14 is so big
c89 still rocks. :)
japhb_ mayuresh: Think of the network layering model, that means e.g. that applications don't have to write raw ethernet frames. We're doing the same for compilers.
mayuresh hmnn
does that land in the same category as a the .net approach? 18:09
japhb_ It's about trading off different forms of complexity at each layer.
mayuresh don't layers add in trauma, by way of excessive computations?
japhb_ .net had closer to JVM type reasons for existance.
We're closer to talking about PyPy. 18:10
mayuresh just read up about pypy
looks very interesting
pmurias mayuresh: the layers allow doing things efficently and correctly
mayuresh though not all that different from java hotspot vm
japhb_ Sure, and any situation in which you have a JITting interpreter written in the same language it interprets. 18:11
The distinction is between an interpreter written in a separate language, and a bootstrapped interpreter (written in the language it implements, or a close variant like RPython or NQP) 18:12
mayuresh or Squeak (Smalltalk) 18:13
japhb_ (C by the way being an example of a bootstrapped *compiler* instead of bootstrapped *interpreter*) 18:14
mayuresh yeah
hmnn 18:15
i have to do that project any ways
would prefer to work on perl6
psch hm, can't find them
mayuresh: you can work on perl6 for fun on the side :)
mayuresh yes, but i typically take things too seriously 18:16
TimToady hugs mayuresh
mayuresh :)
TimToady hugme: hug mayuresh
hugme hugs mayuresh
mayuresh hug timtoady
hugme: hug TimToady 18:17
hugme hugs TimToady
mayuresh mayuresh: hug TimToady
heh, this IRC thing is neat :)
though, mailing lists are nicer. ;)
TimToady we take our fun way too seriously :)
mayuresh :) 18:18
okay
so see you people around
need to hit bed, almost close to mid-night
japhb_ TimToady: Any thoughts on my (nebulous and potentially crazy) macro idea from last night?
o/ mayuresh
TimToady \o 18:19
mayuresh :)
TimToady japhb_: made me want to rewrite them as slang tokens, but I fell asleep
18:19 mayuresh left 18:20 kaare_ left
japhb_ Hmmm. So either too simple examples to properly motivate the idea, or already existing syntax works better. Dang. 18:20
TimToady it might be okay for the intermediate macro stage where we assume a macro is always passed in function call form 18:22
it's sort of a C macro interface
it's like it's allowing an implicit 'is parsed' on each argument, but then requiring the name(a,b,c) form around those 18:23
we might well want some sugar for that form 18:24
18:24 FROGGS joined 18:25 BenGoldberg joined, rindolf left 18:26 rindolf joined
TimToady but to my mind it's sugar for something like slang token { <identifier> <args> { quasi { ... } } where we provide some easy way to tear into args 18:27
18:27 Ben_Goldberg left
psch ah, found it at last 18:27
github.com/BizarreCake/Arane 18:28
18:28 Ben_Goldberg joined
japhb_ I was trying to muster by thoughts for a non-C-style macro form, but I got stuck in trying to figure out how it would fit into the parse stream if e.g. it didn't act as a unified term, or could appear in a place that we've otherwise tightly constrained. That was the WIP part 18:28
TimToady: Yeah, gotcha
*my thoughts
psch .tell mayuresh github.com/BizarreCake/Arane is the previous project i mentioned. it's written in C++11 though, not C89
yoleaux psch: I'll pass your message to mayuresh.
18:30 BenGoldberg left 18:31 lucas_ left 18:34 bowtie joined, bowtie is now known as Guest98101 18:36 Mso150 joined
TimToady well, if we had a helper macro like slang token argh { <identifier> <args> { make \($<identifier>, <args>.list) } then you could use that in another slang token interval { <argh> { given $<argh>.made -> ¤base, ¤range { quasi { ... } } } } 18:37
that's what it'd be sugar for, really
18:37 rindolf left 18:38 kaare_ joined, rindolf joined
TimToady of course since <args> is looking for comma-separated expressions, you can't use that sugar for other syntax, but I said that already 18:40
In the Perl 6 context, "sugar" is not always pejorative. :) 18:41
mvuets re mayuresh' initiative on an interpreter in c: i think there was a c compiler in the very beginning, even before pugs, no?
masak I'm still largely unconvinced about the need for a new sigil. seems to me with them we still have all the problems we did without them. 18:42
TimToady fine use \base, \range to show it's not a sigil, then use ¤ inside the quasi as an escape char, since it's not really a sigil
masak what we do need is (a) a way to make any syntactic category a macro argument, and (b) a way for any syntactic category to figure as an unquote. 18:43
TimToady but I kind like the consistency
*kinda
yes, we also want that sugar
without forgetting that it *is* sugar 18:44
macros are to make up for stupid compiler writers: "Darn it, why didn't the standard compiler provide this capability already!?!" 18:45
japhb_ Hmmm, thinking about your comments at 10:37 TimToady, I kinda like that desugaring. And also having the sugar, because I wouldn't want to write the desugared form all the time. :-)
18:48 rindolf left
TimToady the argh rule is, of course, standing in for a more general ability to query the syntax tree for the bits we just parsed, and returning those bits in a form that can easily be bound to unquotey things 18:48
18:48 rindolf joined
TimToady that is, what the current compiler is doing via QAST manipulations, but we want to make easier, for some definition that excludes things that should merely be possible. 18:49
masak I'm still grappling with the QAST/Qtree thing. 18:50
we're definitely serving two masters with that one. 18:51
both QAST and Qtree are primary, "master models", for what they do.
TimToady wonders if it's the same issue as not having a compiler that's actually written in P6 yet
masak it's made slightly easier by QAST being read-only. but Qtree keeps a live bidi connection to its source. 18:52
18:53 rindolf left, rindolf joined
TimToady QAST is largely used read-only, but then that's true of pretty much anything sane 18:54
QAST can be annotated, and can have chidlren added/removed
so I don't think of it as read-only
masak there's a particular degree of squinting that can be applied to be able to claim that Qtree is similarly read-only. 18:55
TimToady the main problem with QAST as far as I'm concerned is that it's very hard to get good error messages out of it in nqp when things go wrong
but that's more of an nqp thing than a QAST thing
TimToady should study up on Qtree; do you have a good ref? 18:57
masak I haven't published anything on it yet.
expect things to trickle out in December.
TimToady trickle is about all any of us can manage, except for jnthn++ somehow :) 18:59
masak I'm using github.com/JetBrains/intellij-comm...tellij/psi as a bit of an inspiration. p6-is-not-java caveats apply, though. 19:01
so it might be better to look at github.com/JetBrains/intellij-comm...python/psi actually. I plan to look at that next. 19:02
19:03 anaeem1_ left
masak but this is my main insight/inspiration with the kind of introspection/analysis/manipulation of source we want to make from macros -- it's an awful like what state-of-the-art IDEs do with refactors and the like. 19:03
19:05 rindolf left
moritz wonders if rakudo's Action.pm would benefit in readability from a Q-Tree 19:07
currently we go from parse tree straight to AST
but that makes some things difficult
like, introspecting the AST if some piece is what we think it should be
dunno if that's still the case, but I remember when dynamic variables were not emitted as a QAST::Var, but rather as a subroutine call 19:08
which means that any checks for a variable needed special-casing for dynamic vars 19:09
19:09 pmurias left
masak moritz: I'm kinda glad you say that. looking forwards, what I feel the most trepidation about is how Actions.pm will be affected by Qtree. 19:09
19:11 gfp joined
moritz the QAST-level optimizer might be a bit less awkward on Q-Trees too 19:11
TimToady it's true that QAST has to do a lot of introspection of strings at the moment, which might (or might not) be improved by using the type system more heavily 19:17
ugexe like a bright raspberry tang, followed by that strong coffee bite 19:18
masak well, QAST has one advantage that Qtree doesn't have, and never will have: QAST optimizes for uniformity. it has surprisingly few node types.
kind of like binary has surprisingly few types of digit. :)
19:20 gfp left
TimToady the other advantage of QAST is that you don't have to evolve your AST types in parallel with your Grammar and your Actions, so it's more easily extensible in that sense, at the expense of requiring more introspection later 19:20
19:20 gfp joined, gfp left
masak +1 19:21
though "evolve your AST types" really only happens if you're a slang settler.
TimToady it's all slangs, this is Perl 6 19:22
moritz it's all about the slang, 'bout the slang, no reparse 19:24
moritz hums
TimToady long term, I still see nqp/QAST largely as scaffolding
but that's post 6.0, so I'm fine with Qtrees sitting in the laboratory for now 19:25
masak nqp/QAST=scaffolding is a thrilling view. I just hope it works out performance-wise. 19:26
araujo should get some time today to play with perl6 19:27
masak araujo! \o/
TimToady my gut feeling is that we have a much better chance at optimizing polymorphism than we do introspection
araujo question: do we have already some http-request/methods lib?
dalek Heuristic branch merge: pushed 39 commits to panda/CPAN by FROGGS
araujo masak, hello! :)
masak araujo: I'm toying with a mini-language, and that made me think of you! :)
TimToady but that's because it's more work to build the extensible type system that would replace the introspection of nodes 19:28
araujo masak, hahah really? :D
19:28 BenGoldberg_ joined
masak ya. 19:28
araujo masak, what is that mini language all about? and where can I clone that repo? ;)
FROGGS araujo: github.com/sergot/http-useragent/
masak araujo: not a repo yet, just a secret gist. stay tuned.
araujo FROGGS, thanks!, checking....
masak, \o/
masak, keep dropping updates here, so I can check it later :P 19:29
psch FROGGS: i didn't quite get anywhere with the nativecallcast stuff. for some reason i get P6Opaques that don't support positional access, which means i can't get to their typeinfo and thus don't know what to cast them to 19:30
additionally, the runtime type of the args seems to actual be Object, not SixModelObject, which might be from invokedynamic somehow 19:31
19:31 Ben_Goldberg left
FROGGS psch: do you get your hands on the StorageSpec of the input object? 19:32
psch i need the STable for that, which i haven't found out how to get either 19:33
FROGGS hmmmm
psch there's like 3 layers of indirection at work here hah
FROGGS I guess casting the thing to an SixModelObject does not do the trick? :o) 19:34
:/
19:34 Ugator joined
psch i'm writing bytecode that calls a static method that parses argument types from runtime and tries to dispatch to a method that's been written before as well... 19:34
or somewhat like that, i'm actually losing focus a little for the past half hour
19:34 colomon left
psch casting directly from Object to SixModelObject gives me the same trouble with at_key_boxed 19:35
19:37 colomon joined
masak I think I'm going to change the subject of tomorrow's Advent post. 19:40
I put in there "best of RT". I might still write about that, if I claim another Advent post day.
but for tomorrow I want to write about .roll, which apparently never got a blog post.
does that sound OK? :)
19:41 Ugator left
dalek : 75af2f1 | masak++ | misc/perl6advent-2014/schedule:
[advent-2014/schedule] change topic
19:43
raydiak good morning #perl6 19:45
masak top o' the evening to you, raydiak
perl6: enum Die <⚀ ⚁ ⚂ ⚃ ⚄ ⚅>; say Die.roll
camelia rakudo-moar 6345f4: OUTPUT«⚃␤»
..rakudo-parrot 6345f4: OUTPUT«⚀␤»
psch raydiak \o 19:46
raydiak masak++ # teaching me the word "antipodal" :)
masak perl6: enum Die <⚀ ⚁ ⚂ ⚃ ⚄ ⚅>; say Die.roll xx 2
camelia rakudo-parrot 6345f4: OUTPUT«⚃ ⚄␤»
..rakudo-moar 6345f4: OUTPUT«⚀ ⚄␤»
raydiak o/ psch
masak raydiak: wow, I have no memory of that. 19:47
raydiak: maybe you're confusing me with someone on the other side of the planet? :P
raydiak masak: irclog.perlgeek.de/perl6/2014-11-26#i_9721899
masak ah :D
raydiak granted, I'm a few days behind...I kinda like it back here though :) 19:48
19:49 ingy left, ingy joined
raydiak I am likely to start another major revision of math::symbolic soon, and was wondering if anyone had any suggestions or ideas in general, that I might factor in as I do so 19:50
mainly it needs better-defined structure and a real api more than features atm, but I figured it'd be smart to try to look towards the future as I re-lay the groundwork 19:51
19:52 telex left
TimToady m: say ('⚀' .. '⚅').roll xx 5 19:53
camelia rakudo-moar 6345f4: OUTPUT«⚁ ⚃ ⚂ ⚄ ⚄␤»
psch FROGGS++: casting to SixModelObject actually lets me get the STable... thanks :) 19:54
FROGGS \o/
19:54 telex joined
psch i think i should leave it at that for today :) 19:54
TimToady ooh, small straight
FROGGS *g*
psch just checking if getting the StorageSpec works as expected right now and then i'll do something less brain-intensive :D 19:55
TimToady masak: ^^ note a simple range works here
masak TimToady: yes. 19:56
TimToady: I just like .roll on enums :>
TimToady: and I liked the look of `Die.roll` ;)
TimToady m: say ('⚀' .. '⚅').roll(5) # more efficient
camelia rakudo-moar 6345f4: OUTPUT«⚅ ⚄ ⚂ ⚅ ⚁␤»
TimToady doesn't recalculate the range
masak perl6: enum Die <⚀ ⚁ ⚂ ⚃ ⚄ ⚅>; say Die.roll(5) 19:57
camelia rakudo-moar 6345f4: OUTPUT«⚂ ⚂ ⚅ ⚁ ⚅␤»
..rakudo-parrot 6345f4: OUTPUT«⚁ ⚂ ⚀ ⚁ ⚀␤»
TimToady though in theory that range should constant fold
masak aye. thanks.
19:58 usernotexists left
psch welp, not quite... "__P6opaque__66 cannot be cast to org.perl6.nqp.sixmodel.reprs.P6Opaque" 20:01
but yeah, no more today o/ 20:02
20:02 psch left, Ugator joined
hoelzro is there a way to express &:(Str, Int, ...) as a distinct type? something like my subset StartTagHandler of &:(TagName, TagAttrs) where True 20:10
dalek kudo/nom: 6b53d38 | (Tobias Leich)++ | src/core/CompUnitRepo/Local/Installation.pm:
fix last .IO.path.basename leftover
20:11
Heuristic branch merge: pushed 26 commits to panda/eleven by FROGGS
vendethiel hoelzro: you don't need a where 20:13
TimToady how come pl6anet carried the first two advent entries, but none since?
geekosaur hm? I saw more than two
raydiak I'm looking at all of them right now
TimToady hmm, maybe my feed is busted somehow 20:14
FROGGS TimToady: you're looking at /test, right?
hoelzro vendethiel: ah, ok
20:14 darutoko left
TimToady oh, I'm looking at /test 20:14
FROGGS :o)
hoelzro I'm guessing that example wouldn't work, though?
m: my subset StartTagHandler of &:(Str)
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/G3NNWf6tYO␤Missing semicolon.␤at /tmp/G3NNWf6tYO:1␤------> my subset StartTagHandler of ⏏&:(Str)␤ expecting any of:␤ scoped declarator␤»
masak tomorrow's advent post draft: gist.github.com/masak/b0d9fdb8e7ac9802f63d 20:16
feel free to review and comment.
masak writes a md->wordpress converter
FROGGS lizmat: I can rebootstrap panda/eleven into a json blob using that config: gist.github.com/FROGGS/e9ef49b8fd8aab1a1149 20:18
lizmat: now I try to unborke installing a module
20:20 Ugator left, Ugator joined
dalek nda/eleven: 06a0f2f | (Tobias Leich)++ | META.info:
add Panda::Reporter to META.info
20:22
20:22 Ugator left 20:23 Ugator joined
TimToady masak: I wonder if you skip to the bag/enum magic a bit too soon; maybe you should demo a list roll for those who were too lazy to click through to the old blog 20:24
raydiak m: sub foo (Int $, Str $) { }; sub bar () {}; my subset StartTagHandler of Code where {.arity && .signature ~~ :(Int, Str)}; say &foo ~~ StartTagHandler; say &bar ~~ StartTagHandler
camelia rakudo-moar 6345f4: OUTPUT«True␤False␤»
masak ah, yes.
TimToady: good suggestion. I'll see what I can do.
20:28 Ben_Goldberg joined
dalek kudo/nom: 4a9ebae | (Tobias Leich)++ | src/core/CompUnitRepo.pm:
fix CompUnitRepo.files

When asking for an installed file (i.e. a script) then we basically ask for a filename, and optionally for distname/auth/version. In contrast to asking for packages where we tend to ask for packagename, and optionally for a filename/auth/version.
20:28
TimToady raydiak: surely the .arity check is redundant
masak TimToady: updated with example: gist.github.com/masak/b0d9fdb8e7ac9802f63d
raydiak TimToady: I'm golfing the bug now, gives an error without it about trying to shift off a parcel when it hits bar 20:29
m: sub foo (Int $, Str $) { }; sub bar () {}; my subset StartTagHandler of Code where {.signature ~~ :(Int, Str)}; say &foo ~~ StartTagHandler; say &bar ~~ StartTagHandler
camelia rakudo-moar 6345f4: OUTPUT«True␤No such method 'shift' for invocant of type 'Parcel'␤ in method ACCEPTS at src/gen/m-CORE.setting:11123␤ in block <unit> at /tmp/AKzNdXtk2P:1␤␤»
20:30 sqirrel joined
TimToady cool bug 20:30
but only 'cuz bugs are cold-blooded...
masak surely it can be golfed further... :) 20:31
20:31 denis_boyun_ left
FROGGS \o/ 20:31
panda/eleven works again
raydiak oh yeah, I just don't know all the little corners of the syntax for type constraints is mainly whats slowing me
FROGGS with not much effort
lizmat: I can install modules now with panda/eleven 20:32
colomon \o/
20:32 BenGoldberg_ left
raydiak m: sub bar () {}; say &bar ~~ (Code where {.signature ~~ :(Int, Str)}) # should this work? 20:32
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/hQK2Ow1BVu␤Two terms in a row␤at /tmp/hQK2Ow1BVu:1␤------> sub bar () {}; say &bar ~~ (Code ⏏where {.signature ~~ :(Int, Str)}) # sho␤ expecting any of:␤ pos…»
FROGGS @all: with panda/eleven one gets *-m, *-j and *-p executables (scripts) for free for every script that gets installed
TimToady m: sub foo (Int $, Str $) { }; sub bar () {}; my subset StartTagHandler of Code:(Int, Str); say &foo ~~ StartTagHandler; say &bar ~~ StartTagHandler 20:33
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: P6opaque, cs = 0)␤»
raydiak ooh FROGGS++ :)
TimToady say Code:(Int, Str).WHAT 20:34
FROGGS and one also gets .bat files on windows that DTRT :o)
TimToady m: say Code:(Int, Str).WHAT
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/W7WNKxrLzO␤You can't adverb that␤at /tmp/W7WNKxrLzO:1␤------> say Code:(Int, Str)⏏.WHAT␤»
TimToady that form is supposed to work someday
20:35 Ugator left
raydiak m: sub bar () {}; say &bar ~~ :(Int, Str) # this, however, isn't broken 20:35
camelia rakudo-moar 6345f4: OUTPUT«False␤»
20:36 Ugator joined
TimToady m: sub foo (Int $, Str $) { }; say &foo ~~ :(Int, Str) 20:36
FROGGS m: sub bar () {}; say &bar.signature ~~ :(Int, Str)
camelia rakudo-moar 6345f4: OUTPUT«False␤»
rakudo-moar 6345f4: OUTPUT«No such method 'shift' for invocant of type 'Parcel'␤ in method ACCEPTS at src/gen/m-CORE.setting:11123␤ in block <unit> at /tmp/74y7tklnQG:1␤␤»
raydiak m: sub bar () {}; subset Foo where :(Int, Str); say &bar ~~ Foo # works
camelia rakudo-moar 6345f4: OUTPUT«False␤»
raydiak m: sub bar () {}; subset Foo where .signature ~~ :(Int, Str); say &bar ~~ Foo # doesn't 20:37
camelia rakudo-moar 6345f4: OUTPUT«No such method 'shift' for invocant of type 'Parcel'␤ in method ACCEPTS at src/gen/m-CORE.setting:11123␤ in method ACCEPTS at src/gen/m-CORE.setting:3146␤ in any accepts_type at src/gen/m-Metamodel.nqp:2890␤ in method ACCEPTS at src/gen/m-CORE.…»
TimToady ain't broken, but ain't fixed either :)
at the moment signatures only bind to Captures, not other signatures 20:38
raydiak m: sub bar (Int $, Foo $) {}; subset Foo where :(Int, Str); say &bar ~~ Foo 20:39
camelia rakudo-moar 6345f4: OUTPUT«===SORRY!=== Error while compiling /tmp/PoC6M05RMB␤Invalid typename 'Foo' in parameter declaration.␤at /tmp/PoC6M05RMB:1␤------> sub bar (Int $, Foo⏏ $) {}; subset Foo where :(Int, Str); sa␤»
raydiak m: sub bar (Int $, Str $) {}; subset Foo where :(Int, Str); say &bar ~~ Foo
camelia rakudo-moar 6345f4: OUTPUT«False␤»
raydiak ^ but then it doesn't match at all
TimToady note that the form you say "works" is returning returning false
as I said, it ain't fixed
raydiak okay I'm catching up :)
masak m: $_ = "AB"; s[(\w)(\w)] = "$1$0"; say $_ 20:40
camelia rakudo-moar 6345f4: OUTPUT«BA␤»
TimToady it's only return False because it says I dunno how to match that...
raydiak so yeah it's just broken when you do it right I guess
TimToady it at least shouldn't blow up instead of producing the wrong answer :) 20:41
20:42 raiph left
TimToady keeps backlogging unsuccessfully, and now it's past lunchtime :| 20:43
y'all keep saying things that are too interesting
smls
.oO( Dwarfs.roll: i.imgur.com/TJY8tOj.jpg )
nwc10 as in, lunch has been and gone, without you? 20:44
mvuets The 1st advent post on the state of Perl 6 has been featured in the recent issue of thechangelog.com/
20:45 Akagi201 joined
mvuets Also this podcast with Ovid on Perl 5 and Perl 6 thechangelog.com/133/ (haven't listened to yet) 20:45
El_Che mvuets: I just did :) 20:48
20:49 Akagi201 left
masak a short converter script for people who want to write their post in Markdown but convert it to Wordpress broken HTML: gist.github.com/masak/0636c964eb17725da38b 20:50
raydiak m: sub foo (Int $, Str $, Num $) { }; sub bar () {}; my subset StartTagHandler of Code where {.signature.params[0,1]».type eqv (Int, Str)}; say &foo ~~ StartTagHandler; say &bar ~~ StartTagHandler; # since the original question included a ", ...", this is what I ended up with 20:51
camelia rakudo-moar 6345f4: OUTPUT«True␤False␤»
masak (I know it's incomplete. it's just enough to convert tomorrow's post)
Necessity-Driven Development :)
moritz just writes in pod and uses pod2html; good enough 20:52
masak to each his own.
I find Pod quite verbose, too.
mvuets El_Che: did you like it? 20:53
moritz I mostly use prose and code blocks; not too much verbosity there
smls I wrote mine in HTML 20:54
masak Post scheduled for: Dec 7, 2014 @ 0:01
mvuets masak: he we go - an another useful Perl 6 program unrelated to the language!
smls and wrote a Perl 6 script to help syntax-highlight it: github.com/smls/undef/blob/master/...de-tags.p6
masak smls: did you mean: 'broken Wordpress HTML' ?
smls :P
masak tomorrow's advent post is scheduled. 20:55
smls yes, "HTML that keeps in mind that Wordpress will still add <p></p> and <br> tags and prettify quotes/dashes"
what else does it "break"? 20:56
El_Che mvuets: I think he did a good job marketing perl[56] for non-perl people
masak smls: that's about it, I think. 21:02
smls: it also auto-converts smilies, IIRC.
21:03 Mso150 left
kurahaupo it would help if WordPress' editor had paragraph spacing turned on, to discourage people from the awful habit of hitting <enter> twice to make paragraph breaks 21:03
masak here's a thought that just struck me: I know we are Not Done Yet with programming, because I'm using a once-only script to convert md->html, but it's really a "lens problem", and it's kinda silly that after the conversion, the two copies start to diverge.
moritz we're not done yet by far :-) 21:04
21:06 tinyblak left
masak that's also true. 21:07
21:07 Mso150 joined, tinyblak joined
FROGGS masak: why don't you release your converter? I guess the effort to do that is not that huge, and somebody else can improve it if needed 21:07
masak FROGGS: dunno. I feel it's too niche. 21:08
21:09 tinyblak_ joined
FROGGS hmmm, yeah, maybe 21:09
masak I mean, I see what you're saying. wrap it in a module. ship it. 21:11
someone else is welcome to. ;)
FROGGS *g*
masak consider the code to be in the public domain. anyone can take it and relicense it.
moritz what pod and markdown have in common is that I can't remember their link syntax after a few weeks of not using it 21:13
s/it/them/
21:13 tinyblak left
FROGGS true 21:13
masak moritz: Markdown is probably the first one that I internalized. but I agree it's completely arbitrary.
for me, the mnemonic became "I could perfectly credibly put (...) with a url in them in ordinary text, after a description" 21:14
moritz was (link)[text] or [link](text) or [text](link) or (text)[link] ?
masak which helps me remember both the order of text vs link, and where the parens go.
Markdown has the nice design principle that it should "look like an email". that works in its advantage here for the link syntax. 21:15
21:16 Ugator1 joined, Ugator left 21:18 tinyblak_ left 21:19 tinyblak joined 21:21 Ugator1 left 21:23 tinyblak left
mvuets is it doable and sensible to parse markdown with grammars? 21:26
21:28 BenGoldberg_ joined
FROGGS I'd say so 21:28
moritz probably with a mixture of grammars and paragraph-based processing 21:31
(though I don't know markdown enough)
21:31 Ben_Goldberg left
raydiak what kinds of things are less sensible to parse with grammars? 21:39
masak moritz: I'd parse CommonMark, as it looks very regular and like a good target for a grammar. 21:40
FROGGS raydiak: html 21:42
raydiak FROGGS: why? 21:43
FROGGS raydiak: because it is usually invalid html 21:45
raydiak ah excellent point
FROGGS libxml does a good job of building a dom based on that
21:47 BenGoldberg_ left
raydiak mase sense...guess it's often a bad idea to roll your own in any form when there is a more specialized solution available 21:47
raydiak has a habit of reinventing wheels...more for the experience points wrt wheels than for the resulting product 21:50
21:51 ptc_p6 left
FROGGS yeah, me too 21:52
you just need to know when to stop :o)
raydiak aye, I suspect I spend well more than half my time chasing my tail in circles around my less-than-perfectly-circular wheels :) 21:53
smls FROGGS: Sometimes you don't need (or want) to build a DOM though
my script (which I linked above) finds <code></code> elements using a pretty simple grammar, and yet it can deal with a lot of broken HTML 21:54
by simply ignoring it :)
21:55 Ugator joined
FROGGS ohh yes, that's fine of course 21:56
gnight 22:00
22:00 FROGGS left
smls night 22:01
22:01 Ugator left 22:03 colomon left 22:06 araujo left
masak 'night, #perl6 22:09
22:09 araujo joined 22:11 smls left 22:13 sqirrel left 22:15 spider-mario left 22:16 BenGoldberg joined, mvuets left 22:19 denis_boyun_ joined
vendethiel doesn't like refactoring 2004 code 22:34
22:34 KCL_ joined 22:35 Ben_Goldberg joined 22:39 BenGoldberg left 22:41 colomon joined 22:42 kaare_ left 22:44 rurban1 joined 22:48 rurban left, denis_boyun_ left 23:06 kurahaupo left 23:07 Ben_Goldberg left 23:08 BenGoldberg joined 23:13 rurban1 left 23:26 denis_boyun_ joined 23:30 zakharyas left 23:33 djanatyn left 23:34 djanatyn joined 23:35 Ben_Goldberg joined 23:39 BenGoldberg left 23:41 aborazmeh joined 23:53 Roonin left