»ö« 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.
hobbs Perlmonks is the pinnacle of 1997 web technology 00:28
Mouq lucas_: The community direction has been *toward* Pod6, rather than away from it. I believe that, historically, the issue, besides the slow conversion of pod6 to html, was that there was a feature to autogenerate links to roast that needed to be redone for Pod6 00:49
(As I recall. lue++ was the one doing the most work on this, and he's probably the best person to consult) 00:50
timotimo hey Mouq 00:51
Mouq hey timo! :) I've still been watching stuff, but I haven't had time to be on as often recently 00:52
timotimo that's fine :) 00:54
anything in particular you're up to next?
Mouq Uh, just now I was looking to see if I could make routine redeclaration errors occur sooner, just because it was bugging me while I was trying to do something else 01:05
m: sub foo { 42 }; sub foo { "Some really long subroutine definition" } 01:07
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!=== Error while compiling /tmp/bBTHJsw2gP␤Redeclaration of routine foo␤at /tmp/bBTHJsw2gP:1␤------> ome really long subroutine definition" }⏏<EOL>␤ expecting any of:␤ postfix␤ sta…»
Mouq That kind of simple redeclaration should happen before parsing the body
Mouq And... yeah.. that would require way more refactoring than is worth it to me at the moment 01:18
Mouq is kind of switching between Perl 6 and assignments and random people talking to him 01:19
timotimo mhm 01:24
i was just driving home from a friend's place
they have cats 01:25
i've discovered that i quite like cats
Tekk_ timotimo: cats are nice when they're nice 01:27
timotimo yes
these two are not perfect, of course
the male one thinks he's got a right to everything. like food on the table :)
he'll do an exhaustive search through the possible ways of approaching the table to find one that doesn't lead to us gently shoving him away 01:28
timotimo .tell japhb there's two problems with the string escape benchmark that i may solve myself soon-ish: 1) you have to give it a string to escape via @*ARGS[0], 2) it's trying to get that string from @*ARGV[0], which doesn't exist %) 02:02
yoleaux timotimo: I'll pass your message to japhb.
japhb .botsnack 02:52
yoleaux :D
02:02Z <timotimo> japhb: there's two problems with the string escape benchmark that i may solve myself soon-ish: 1) you have to give it a string to escape via @*ARGS[0], 2) it's trying to get that string from @*ARGV[0], which doesn't exist %)
japhb timotimo: Are you talking about perl[56]/string-escape? If so, I see @*ARGS[0] and $ARGV[0], and in both cases it's looking for a *length* as its first arg, not a string 02:53
Or where you talking about something else? 02:54
DelmoreTheDonkey Having issues understanding junctions. 04:09
perl6advent.wordpress.com/2009/12/1...junctions/
all(@a) == any(@b)
i suppose is the same as any(@b) == all(@a) 04:10
DelmoreTheDonkey however in english they are different. 04:10
all(@a) == any(@b) # All elements of @a present in @b?
any(@b) == all(@a) # Any elements of @b present in all elements of @a? 04:11
but for some reason in rakudo it all evaluates to the same. 04:12
r: my @a=(1,2); my @b=(1,2,3,4,5); all(@a) == any(@b 04:13
camelia rakudo-{parrot,moar} 315ec6: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/tmpfile:1␤------> 2); my @b=(1,2,3,4,5); all(@a) == any(@b⏏<EOL>␤ expec…»
DelmoreTheDonkey r: my @a=(1,2); my @b=(1,2,3,4,5); all(@a) == any(@b)
camelia ( no output )
DelmoreTheDonkey r: my @a=(1,2); my @b=(1,2,3,4,5); if all(@a) == any(@b) { say "Yes" }
camelia rakudo-{parrot,moar} 315ec6: OUTPUT«Yes␤»
DelmoreTheDonkey r: my @a=(1,2); my @b=(1,2,3,4,5); if any(@b) == all(@a) { say "Yes" } 04:14
camelia rakudo-{parrot,moar} 315ec6: OUTPUT«Yes␤»
DelmoreTheDonkey can someone explain why "all(@a) == any(@b)" is equivalent to "any(@b) == all(@a)" even though they are read differently 04:16
hobbs because changing the left and right hand side of == doesn't do anything
DelmoreTheDonkey In english though : "All elements of @a present in @b" is very different to "Any elements of @b present in all elements of @a" 04:18
hmm in the comments I see someone else asking the same question 04:19
hobbs you're not programming in english 04:20
and "Any elements of @b present in all elements of @a" is garbage in english anyway :)
hobbs at least I have no idea what it's meant to mean 04:20
DelmoreTheDonkey when @a has only 1 element, then the two are the same. 04:24
hobbs all(@a) == any(@b) comes out to "for all elements of @a, it is true that the element is equal to any element of @b" 04:25
DelmoreTheDonkey when @a has 2 unique elements, then "Any elements of @b present in all elements of @a" will always be false
hobbs I think it's an intentional choice that all always wraps any, because the other way around is almost always useless
DelmoreTheDonkey when @a has 2 non unique elements (say the result a function known only at runtime) then "Any elements of @b present in all elements of @a" has meaning 04:26
hobbs I still don't know what that meaning is, to you 04:27
DelmoreTheDonkey "does anything in here matches everything over there" to me is different to "does everything in here matches anything over there" 04:32
hobbs yes, you've said that
and they're different to me too 04:33
the difference is that the second one means something and the first one is impossible to interpret :)
in any case, it really has no bearing on what Perl does 04:34
and what it does I think is pretty clear. Junction.AUTOTHREAD explicitly makes sure that all() and none() get wrapped outside of any() and one(), for DWIM reasons 04:35
all(any(...), any(...), any(...)) is generally more useful, and aligns with the higher precedence of 'and' vs. 'or' 04:36
actually, I take back the second part. It is more useful though :)
raydiak m: say q(foo) 06:35
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!=== Error while compiling /tmp/8S4q1gHk9t␤Undeclared routines:␤ foo used at line 1␤ q used at line 1␤␤»
raydiak ^ should parens work as user-selected brackets?
FROGGS raydiak: no, an opening parenthesis after an identifier is *always* a routine call 07:37
m: if(42) { say 'something' }
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!===␤Word 'if' interpreted as 'if()' function call; please use whitespace instead of parens␤at /tmp/SJSxbXf1S3:1␤------> if⏏(42) { say 'something' }␤Unexpected block in infix position (two terms in a r…»
FROGGS that is just a neat way to say "undeclared routine 'if'" 07:38
raydiak ah, got it...thanks FROGGS++
m: class Foo {}; my $foo = Foo.new; my $bar = $foo but "bar"; say $bar ~~ $foo; 07:39
camelia rakudo-moar 315ec6: OUTPUT«False␤»
FROGGS m: class Foo {}; my $foo = Foo.new; my $bar = $foo but "bar"; say $bar ~~ ($foo but "bar");
camelia rakudo-moar 315ec6: OUTPUT«False␤»
raydiak ^ how could I compare those and get true, if you understand what I'm trying to accomplish...???... 07:40
FROGGS m: class Foo {}; my $foo = Foo.new; my $bar = $foo but "bar"; say $bar.isa($foo.WHAT);
camelia rakudo-moar 315ec6: OUTPUT«True␤»
FROGGS m: class Foo {}; my $foo = Foo.new; my $bar = $foo but "bar"; say $bar ~~ $foo.WHAT;
camelia rakudo-moar 315ec6: OUTPUT«True␤»
FROGGS is that okayish?
raydiak but I need to compare by the specific object I started with, not just the type 07:41
though sometimes this feels like a design smell...like I'm trying to use 'but' to squeeze extra information where it doesn't go 07:42
FROGGS yeah, that's probably true
masak morning, #perl6 08:19
moritz \o morning
raydiak morning masak and moritz 08:29
lizmat commute to London& 08:31
moritz can report that the response to perlgeek.de/blog-en/perl-6/2014-com...nding.html has been very positive and generous so far 08:32
arnsholt o/ 09:13
masak \o 09:14
masak I really like the approach taken to specification in spec.commonmark.org/0.7/ 09:44
there's something about it that feels very close to the core idea of unit testing.
I think if I end up writing a language spec, I will end up using something like that.
lucas_ good morning, #perl6 10:03
yoleaux 5 Nov 2014 22:59Z <tony-o> lucas_: pod is for writing documentation, yaml isn't. that isn't really a good comparison
lucas_ tony-o: You're right. The YAML comparison was more like a joke, sorry. 10:04
.tell Mouq Thank you for the note. 10:09
yoleaux lucas_: I'll pass your message to Mouq.
timotimo o/ 10:20
.tell japhb github.com/japhb/perl6-bench/blob/...ing-escape - the code says otherwise 10:25
yoleaux timotimo: I'll pass your message to japhb.
lucas_ So, the plan is to eventually merge the pod6ify specs branch into master in the future? So I guess my proposal to convert S15 and S26 to POD5 is rejected, right? It's ok. I didn't mean to go away from Pod6. I just think if those two documents were in POD5, they could be more reviewed, and so helping Pod6 specification progress. S15 is currently HTTP 404 on perlcabal. And S26 doesn't seen to have been generated recently. 10:39
moritz I've made pretty clear requirements for merging the pod6ify branch; nobody told me so far they they were met 10:41
nor do I know if anybody works on it
(the requirements are that the .html files can be generated fully automatically, including installing missing deps, like rakudo itself + modules) 10:42
timotimo so i'm wondering why GC seems so slow in my profiles 10:53
turns out i had a moarvm with --optimize=1 --debug=3 --asan
now "spinner" isn't hilariously slow any more. just "not very funny" slow. 10:59
azawawi hi #perl6 11:15
m: my $x = ( "a" => 1, "b" => 2 ); $x.perl; %$x<c> = 10; $x;
camelia ( no output )
azawawi m: my $x = ( "a" => 1, "b" => 2 ); $x.perl; %$x<c> = 10; say $x;
camelia rakudo-moar 315ec6: OUTPUT«"a" => 1 "b" => 2␤»
timotimo hey azawawi
azawawi m: my $x = { "a" => 1, "b" => 2 }; $x.perl; %$x<c> = 10; say $x;
camelia rakudo-moar 315ec6: OUTPUT«"a" => 1, "b" => 2, "c" => 10␤»
azawawi hmmm
timotimo azawawi: www.jetbrains.com/pycharm-educatio...rld@2x.png ← check this out :)
azawawi what am i doing wrong in this?
timotimo i'd love to see something like that in farabi6
you're doing $x.perl, but no .say? 11:16
azawawi interesting
m: my $x = ( "a" => 1, "b" => 2 ); $x.perl; %$x<c> = 10; say $x.perl;
camelia rakudo-moar 315ec6: OUTPUT«$("a" => 1, "b" => 2)␤»
timotimo usually, you'll use the hash assignment with a list of pairs to get what you want
if you assign to a scalar, it won't turn it into a hash for you, so you'd want .hash at the end or %(...) instead of just (...) 11:17
azawawi m: my $x = %( "a" => 1, "b" => 2 ); $x.perl; %$x<c> = 10; say $x.perl;
camelia rakudo-moar 315ec6: OUTPUT«{"a" => 1, "c" => 10, "b" => 2}␤»
azawawi a bit confusing lol
but i will live
azawawi fixed his AMD machine and got a new SSD drive on it :) 11:18
timotimo nice
azawawi timotimo: jetbrains makes the best IDEs...
timotimo: and they're fast
timotimo yes 11:19
azawawi timotimo: and they have an excellent inspect code (static analysis) for java code...
timotimo yes
azawawi timotimo: detects deadlocks...
timotimo i was refering only to the idea of "tasks"
azawawi timotimo: please see github.com/azawawi/farabi6/issues/6 11:20
timotimo oh, hmm
that's not really a structured introductory course kind of thing
azawawi I know but it is community driven 11:24
and it can serve as a data source for examples/recipes
timotimo sure
azawawi takes a look at the perl 6 book section on hashes 11:25
timotimo i'd also like to see inside-the-source annotation thingies
codemirror surely has flags you can add in the gutter
azawawi timotimo: yup
timotimo how about marking sections of the code? 11:26
azawawi codemirror.net/demo/lint.html
we're already using marktext for ascii sequences
ascii color sequences 11:27
timotimo oh 11:28
neato
now all we need is a little mock-up :)
does it move marked text around for us when the user edits?
azawawi the perl6 book just mentions %( inside the subroutine chapter #4 11:29
i dont think so 11:30
but then again it didnt test it
it = i
timotimo it does
you can test it in the linter demo where it marks up the "var i = 0"
removing text before it will properly move the markup with it 11:31
azawawi that's a js linter
timotimo what i mean is:
azawawi it recalculates...
timotimo that's not what i mean, though :)
when you remove text before it, it will move the sign even before the recalculation happens 11:32
as in: the mark doesn't slip into the space after the = or onto the 0
azawawi how about formalizing your idea in a nice github issue? :)
im working right now on the perl6 debug integration 11:33
nearly there
timotimo i probably should :)
timotimo it's kinda weird; last time i looked at farabi, i didn't really take it serious at all 11:35
timotimo but now i'm pretty hype about it 11:35
maybe it's the redesign? all the UI work you've done?
that must be it
azawawi timotimo: dont worry... when im focused on something interesting, it will be finished :) 11:37
timotimo that's a good property to have
i've had trouble with that pretty much my whole life
azawawi timotimo: we can start another proto.html...
azawawi what's better my @results = gather { ... } and then storing it inside a hash value 11:38
or
my $results = gather { ... }
azawawi is still new to Perl 6 types 11:39
timotimo it's almost the same thing
the list assignment will definitely cause the gather to be evaluated eagerly
i don't think the item assignment with my $results = gather { ... } will do that 11:40
azawawi which means @ it is more predictable in async code :)
timotimo fair enough
i was thinking about something: 11:41
how would you build an interface that'd let code that's run from a farabi interact with the farabi instance and the user's session?
timotimo the simplest thing would be to just use stdin/stdout, but that can very easily be "trampled" by user code 11:42
maybe the most robust way would be a TCP socket on the loopback network interface
azawawi im doing it right now with debug :)
timotimo have the port in an environment variable 11:43
azawawi but it is not 100% correct... i should use cookies
timotimo opening one port per running rakudo "subprocess"
you mean because it'd only ever understand a single running session?
azawawi right now, it is handing out incremental session ids.... not really robust 11:45
timotimo ah
azawawi but the work im doing on the perl6 debug integration will be useful in async output...
timotimo well, i suppose there could just be a single socket and it'd start off every connection with "hi; you gave me this here token on the environment variables, please let me in"
how important is it to make any async i/o stuff optional in farabi? 11:46
azawawi the fun thing begins when different editors can interact with the results of each other... :) 11:47
you're building code by simple blocks and testing each one at a time and then running them in different order 11:48
that's what scientific programming needs like PDL, ...etc
or that's at least what i understood from the PDL book :)
felher I just checked out rakudo star 2014-09 on MoarVM. And _this_ _is_ _AWESOME_. Startup now is really fast enough for most of my tasks and maybe even for using Perl6 to update information in my Shell prompt. Big thanks to everyone contributing to that. :) 12:03
azawawi felher: latest rakudo is also way faster lol 12:04
moritz felher: \o/ 12:05
felher azawawi: that's great news indeed. I can now start translating my perl5 scripts for prompt and interactive use to perl6 <3
And a few of my shellscripts too, probably 12:06
masak felher: memegenerator.net/instance/55998418 12:44
felher masak: :D 12:45
lucas_ Alternative proposal: While the pod6ify thing doesn't settle, keep two separate copies of S15 and S26 in the same master branch, in Pod6 and POD5 formats. The new POD5 versions can be named *.pod5 or the existent Pod6 versions can be renamed to *.pod6. The specification writers can continue to patch the original Pod6 version, while I'll try to keep the POD5 version in sync. Once Pod6 takes over, the POD5 versions can simply be dropped. 12:51
This is just in the interest of seeing them both rendered online and up-to-date. Do I have a "+1" from someone?
masak I'd try to avoid having "two masters". 12:52
dunno how close your proposal veers to that, though.
ribasushi (on a tangent) - is pod6 in a .pod file even valid...? 12:58
lucas_ masak: I don't know if I understood you correctly. But I think the original Pod6 versions should be official and the POD5 versions should be marked as a copy or stub or temporary...
masak is one generated from the other? 13:00
lucas_ masak: human-generated, yes :)
lucas_ ribasushi: I think the spec doesn't require any specific filename extension. 13:01
ribasushi lucas_: I mean in terms of "be nice to the world" - a lot of stuff (one notable example is github) expects .pod to contain p5 pod 13:02
lucas_ ribasushi: yes, I would prefer things to be named accordingly. That's why github doesn't know how to render those Pod6 files in *.pod extensions. It reports an error. 13:04
Tekk_ oh 14:24
timotimo m: slurp 14:54
camelia ( no output )
timotimo m: say slurp
camelia rakudo-moar 315ec6: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
timotimo m: say slurp.comb[0]
camelia rakudo-moar 315ec6: OUTPUT«C␤»
timotimo m: say slurp.perl
camelia rakudo-moar 315ec6: OUTPUT«"Céad slán ag sléibhte maorga Chontae Dhún na nGall\nAgus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;\nNuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí\nI mo dhiaidh bhí gleanntáin ghlas’ Gha…»
timotimo locally i get a deprecation warning for IO::Handle.slurp
argfiles.slurp should continue to be available, IMO 14:55
timotimo how is s/foo/$0/ currently done correctly? 14:58
apparently .subst(/foo bar/, -> $/ { ... $0 ... }) 14:59
moritz didn't we have that working at some point? 15:02
m: $_ = '42'; s/(.)2/500$0/; .say
camelia rakudo-moar 315ec6: OUTPUT«5004␤»
moritz works, no?
FROGGS moritz: you're mixing s/// and .subst 15:08
or timotimo
(or both)
:P
timotimo er 15:09
i tried s/ blah / $0 / and s[ blah ] = $0 and both gave "" for $0
i'm confused now.
moritz timotimo: well, bla doesn't capture 15:11
timotimo: so $0 is empty
FROGGS m: my $a = "timotimo"; say $a ~~ s[timo] = "blah"
camelia rakudo-moar 315ec6: OUTPUT«True␤»
FROGGS m: my $a = "timotimo"; say $a ~~ s[timo] = "blah"; say $a
camelia rakudo-moar 315ec6: OUTPUT«True␤blahtimo␤»
timotimo well, my original code did have ( ) in them
FROGGS m: my $a = "timotimo"; say $a ~~ s[(timo)] = "$0blah"; say $a
camelia rakudo-moar 315ec6: OUTPUT«True␤timoblahtimo␤»
FROGGS hui
works
moritz as did my example code above 15:12
m: $_ = '42'; s/(.)2/500$0/; .say
camelia rakudo-moar 315ec6: OUTPUT«5004␤»
timotimo m: my $_ = "r3(10)"; s/ r(<digit>+) '(' (<digit>+) ')'/ wee $0 yay $1 /; .say
camelia rakudo-moar 315ec6: OUTPUT«Potential difficulties:␤ Redeclaration of symbol $_␤ at /tmp/biAtYmHnOs:1␤ ------> my $_ ⏏= "r3(10)"; s/ r(<digit>+) '(' (<digit>+␤ wee 3 yay 10 ␤»
timotimo er ...
i'm confused now.
FROGGS m: $_ = "r3(10)"; s/ r(<digit>+) '(' (<digit>+) ')'/ wee $0 yay $1 /; .say
camelia rakudo-moar 315ec6: OUTPUT« wee 3 yay 10 ␤»
timotimo s:g/ r(<.digit>+) '(' (<.digit>+) ')' / r$0\($1){ colorblock($0, $1) } /; 15:14
that's what i wrote
colorblock gets Nil two times
and my result contains r() a bunch of times
moritz oh, then it might be a problem with code blocks in s///
timotimo m: sub colorblock($a, $b) { "" }; my $_ = "r5(1); r6(6)"; s:g/ r(<.digit>+) '(' (<.digit>+) ')' / r$0\($1){ colorblock($0, $1) } /; .say 15:15
camelia rakudo-moar 315ec6: OUTPUT«Potential difficulties:␤ Redeclaration of symbol $_␤ at /tmp/vhFl7gkUQ2:1␤ ------> sub colorblock($a, $b) { "" }; my $_ ⏏= "r5(1); r6(6)"; s:g/ r(<.digit>+) '(' ␤ r5(1) ; r6(6) ␤»
timotimo m: sub colorblock($a, $b) { "" }; my $_ = "r5(1); r6(6)"; s:g/ r(<.digit>+) '(' (<.digit>+) ')' / roar$0\($1){ colorblock($0, $1) } /; .say
camelia rakudo-moar 315ec6: OUTPUT«Potential difficulties:␤ Redeclaration of symbol $_␤ at /tmp/NJxn3fcAhR:1␤ ------> sub colorblock($a, $b) { "" }; my $_ ⏏= "r5(1); r6(6)"; s:g/ r(<.digit>+) '(' ␤ roar5(1) ; roar6(6) ␤»
timotimo m: sub colorblock($a, $b) { "" }; for "r5(1)", "r6(2)" -> $_ is copy { s:g/ r(<.digit>+) '(' (<.digit>+) ')' / roar$0\($1){ colorblock($0, $1) } /; .say } 15:16
camelia rakudo-moar 315ec6: OUTPUT« roar() ␤ roar() ␤»
timotimo there we go.
it happens in a loop and that breaks it?
FROGGS yes, there is an open RT ticket about that 15:19
timotimo OK 15:20
kinda weird, but i'll accept it for now
imgur.com/N1sbOYa ← i can now color the registers for the spesh log like that
imgur.com/hFNJ0VV - a bit better, i think 15:25
Ven o/, #perl6 15:32
timotimo ohai ven 15:33
Ven m: sub f(::T @list, :(T --> Any) &fn) { @list.map(&fn) }; f((1, 2, 3), *+1) 15:34
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!=== Error while compiling /tmp/nM6Ww7EMVT␤Missing block␤at /tmp/nM6Ww7EMVT:1␤------> sub f(::T @list, :(T --> Any) ⏏&fn) { @list.map(&fn) }; f((1, 2, 3), *+␤ expecting any of:␤ statement l…»
Ven mmh :/ I guess subsignatures NYI?
timotimo you want to put the subsignature after the &fn 15:35
this is perl6, not c :)
hoelzro Ven: is that spec'd? 15:36
Ven m: sub f(::T @list, &fn :(T --> Any)) { @list.map(&fn) }; f((1, 2, 3), *+1)
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: P6opaque, cs = 0)␤»
timotimo std: sub f(::T @list, :(T --> Any) &fn) { @list.map(&fn) }; f((1, 2, 3), *+1)
Ven whoops.
camelia std 14ad63b: OUTPUT«===SORRY!===␤Unable to parse signature at /tmp/YtBhSmznrU line 1:␤------> sub f⏏(::T @list, :(T --> Any) &fn) { @list.ma␤Couldn't find final ')'; gave up at /tmp/YtBhSmznrU line 1:␤------> sub f(::T @list, :(T -…»
Ven hoelzro: yes
timotimo oh
Ven I belive timotimo on which way it's supoposed to be, tho
hoelzro Ven: could you send me a link to the relevant synopses? I've never seen that!
Ven hoelzro: S06, sub (int $n, &g_fact:(Str, int, int --> Grammar) --> Str) { ... } and stuff 15:37
hoelzro neat, thanks!
timotimo but there the subsignature is after the argument name 15:38
FROGGS m: sub f(::T @list, &fn(T --> Any)) { @list.map(&fn) }; f((1, 2, 3), *+1)
camelia rakudo-moar 315ec6: OUTPUT«Too few positionals passed; expected 1 argument but got 0 in sub-signature of parameter &fn␤ in sub f at /tmp/1WMRyBqzBJ:1␤ in block <unit> at /tmp/1WMRyBqzBJ:1␤␤»
FROGGS ahh, that's the ticket masak opened just a few days ago 15:39
timotimo the one with a loop and s///?
FROGGS no, what I just did 15:41
timotimo ah 15:42
FROGGS the ticket about matches and $/ and $_ in loops is older
timotimo so ... ^^ is supposed to be "beginning of string", right? 16:17
hoelzro moritz: ping
timotimo both ^ and ^^ at the beginning of the regex seem to scan through the whole string ... 16:17
that's not very efficient 16:18
^ is bos, ^^ is bol 16:20
timotimo hum. the optimizer removes that 16:22
oh, maybe the optimizer can't handle the hooks the debugger throws in
yup. 16:24
timotimo sweet! now it optimizes even when the debugger is attached 16:33
dalek p: 8c3b818 | (Timo Paulssen)++ | src/QRegex/P6Regex/Optimizer.nqp:
ignore debugger-emitted code blocks in regex optimizer
16:34
tony-o is there an equiv in p6 to p5's `times`? 16:42
raydiak \o mornin #perl6
TimToady tony-o: not that I am aware of 16:44
presumably this is something a POSIX module would supply 16:45
if we had one
so maybe it's a nativecall thing for now
tony-o TimToady: thanks - i think i'm back to trying to figure out how to do a union struct :-) 16:46
timotimo tony-o: do you know about nativecast? 16:56
tony-o i don't
timotimo github.com/timo/SDL2_raw-p6/blob/m...aw.pm#L327 - this is how i turn a "generic" SDL_Event struct into a SDL_WindowEvent or SDL_KeyboardEvent depending on its flag value 16:57
dalek rl6-roast-data: 4f8d75a | coke++ | / (5 files):
today (automated commit)
[Coke] moar/moar-jit still the failingest backends. 16:59
parrot still clean with 0 failures.
tony-o timotimo: interesting - i'm presuming the ordering of the attributes in those classes matters 17:00
timotimo of course
CStruct will lay them out like your C compiler would
if you have different layouts, the values you'll read will be garbled
how do i import MAST::Ops? do i need an extra -I path that points at install/lib/MAST? 17:02
tony-o timotimo: i see, the problem i'm having right now is getting a Win32 HANDLE to pass back and forth. it seems to segfault but i can't really tell, i just have early termination with no message
timotimo $*VM.config<prefix> seems helpful 17:03
did you make sure to translate "int" from C to "int32" in perl6? 17:04
tony-o yea .. I've tried int and an empty OpaquePointer class, as well as a cstruct with an int32 $.unused (it exists that way in some of the .h i found) 17:05
i've tried various other types too 17:07
timotimo it seems like we're not installing MAST::Ops as a .moarvm file
just as the .nqp file :\
tony-o i'm trying to call GetCurrentProcess and then GetProcessTimes
for win32 17:08
timotimo oooh, *there* it is 17:08
hurm. 17:12
m: use MASTOps:from<NQP>; say MAST;
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!===␤Object of type MAST in QAST::WVal, but not in SC␤»
timotimo m: use MASTOps:from<NQP>; say MAST::.keys;
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!===␤Object of type MAST in QAST::WVal, but not in SC␤»
tony-o timotimo: github.com/tony-o/perl6-win32-time.../process.t 17:13
once i call 'GetProcessTimes', the script exits
'GetProcessTimes' is in github.com/tony-o/perl6-win32-time...rmance.pm6 17:14
timotimo you should .= new 17:15
er, wait
scratch that
what are _In_ and _Out_ defined as? 17:16
when you pass a CStruct to a parameter in a C function, it's like passing a pointer
japhb .botsnack
yoleaux :D
10:25Z <timotimo> japhb: github.com/japhb/perl6-bench/blob/...ing-escape - the code says otherwise
raydiak tony-o: where does Win32::Performance::LPFILETIME come from?
tony-o i think it's just letting the reader know that the function sets _OUT_ 17:17
timotimo github.com/tony-o/perl6-win32-time...nce.pm6#L5
tony-o raydiak: i pushed a non working repo, that signature should be FILETIME
japhb timotimo: Ah! I see the problem. I fixed it (and another such benchmark bug) in my stress branch, and hadn't cherry-picked them back to master
tony-o LPFILETIME is a ptr to FILETIME
timotimo ah :)
raydiak ah, okay
timotimo tony-o: oh, right "long pointer"
japhb (Frankly, I was hoping to have the last critical piece of stress done by now)
timotimo (lol)
tony-o: yeah, the Win32::Performance::FILETIME should all read just FILETIME? 17:18
tony-o yea
tony-o and it works great when i call GetSystemTimeAsFileTime 17:19
timotimo the HANDLE has the right type, too? 17:19
tony-o i believe so
timotimo i don't think so, tbh
it should probably be class HANDLE is repr('CPointer') { } 17:20
and the class PVoid ... i don't think that can work
CPointer should not have attributes
tony-o i had it that way yesterday and i have the same behavior with it 17:20
i pushed that up to the repo if you want to look 17:21
timotimo i'd like a definite version that's exactly the way it works
tony-o refresh
timotimo ah thanks
timotimo hm 17:22
it might be a 32bit vs 64bit problem?
TimToady wonders if we need an explicit notation to express the difference between a P6 int and a C int, since they are not specced to be identical
timotimo aye, that bit me when i built SDL2::Raw 17:23
star: use NativeCall; class Test is repr('CPointer') { has int $.test } 17:25
camelia ( no output )
timotimo i kind of think that should explode
timotimo star: use NativeCall; class Test is repr('CPointer') { has int $.test }; Test.new.test = 1 17:25
camelia star-p 2014.09: OUTPUT«CPointer representation does not support attribute storage␤ in method test at gen/parrot/CORE.setting:3204␤ in block <unit> at /tmp/tmpfile:1␤␤»
..star-m 2014.09: OUTPUT«This representation (CPointer) does not support attribute storage␤ in method test at src/gen/m-CORE.setting:3195␤ in block <unit> at /tmp/tmpfile:1␤␤»
TimToady it's specced to explode
timotimo tony-o: what's your C-level debugging tools you have available? 17:26
tony-o gcc on cygwin 17:27
do you want me to write t in c and get it to work?
timotimo can you gdb where exactly that explodes? use a moarvm that uses asan?
may be a good idea, just so we can rule out different weirdnesses
tony-o okay, ill test it out in c and if that doesnt dump then ill try to debug through moar 17:28
im limited to debugging moar through whatever the msi from rakudo star is though, i cant get perl6 to build from source 17:29
timotimo d'oh :(
TimToady S12:93 specs that things like int may only add behaviors, not change representations
synopsebot Link: perlcabal.org/syn/S12.html#line_93
timotimo i have pretty much zero experience with windows c development
TimToady and a CPointer is about as native as you can get... 17:30
tony-o TimToady: that was my initial thought . i could just use it as the pointer and just never worry about since i dont actually need its contents 17:33
timotimo roar
how do i get at the stuff that's defined in MASTOps.moarvm? :\ 17:34
timotimo hacked update_ops.pl to create a perl6 MAST/Ops.pm inside tools/ ... and feels bad 18:07
timotimo but afk now 18:07
raydiak m: say "√4=" ~ &infix:<**>.assuming(*, .5)(4) 18:53
camelia rakudo-moar 315ec6: OUTPUT«Too many positionals passed; expected 0 to 2 arguments but got 3␤ in sub infix:<**> at src/gen/m-CORE.setting:4511␤ in sub CURRIED at src/gen/m-CORE.setting:3479␤ in block <unit> at /tmp/pm4laQNcoW:1␤␤»
raydiak is skipping a positional when currying NYI, or just broken?
moritz raydiak: NYI, I think 18:56
raydiak thanks 18:57
timotimo yes :( 19:19
back at the keyboard 19:22
ugator Hello :) How to generate random whole numbers? say 10.rand.int is what the cookbook suggests, but that doesnt work... thx 19:33
[Coke] m: say 10.rand; say 10.rand.Int; 19:35
camelia rakudo-moar 315ec6: OUTPUT«6.74151883360017␤1␤»
[Coke] m: say 10.rand.int
camelia rakudo-moar 315ec6: OUTPUT«No such method 'int' for invocant of type 'Num'␤ in block <unit> at /tmp/nRvGfJyQOc:1␤␤»
ugator thx coke, that explains it^^ typo in cookbook then 19:36
PerlJam ugator: what is this cookbook of which you speak?
ugator: do you mean the Using Perl 6 book ?
ugator no... search.cpan.org/~szabgab/Perl6-Cook...umbers.pod 19:37
found with google...
raydiak 09, eh?
ugator so is this deprecated? 19:38
leont That's from 2009
PerlJam ugator: you could bug Gabor about it. Let him know that you're using his tutorial and could he update it. 19:40
alexghacker speaking of deprecated, I see that slurp($handle,...) is deprecated in favor of slurp($path,...), but that isn't a complete replacement for slurp($handle,...) 19:42
in particular, if you've already read some data from a handle, slurp will pull the remainder preserving newlines 19:43
alexghacker I've tried a few other ways to get the same effect, but haven't hit on one yet 19:45
PerlJam alexghacker++ good point.
alexghacker Actually, I can do $fh.lines.join("\n") 19:46
but that seems wrong
[Coke] f 19:49
ww 19:50
PerlJam I wonder why IO::Handle.slurp was deprecated ... anyone got a quick link to the disucssion about it? 19:51
dalek href="https://cpandatesters.perl6.org:">cpandatesters.perl6.org: ad94453 | (Tobias Leich)++ | / (3 files):
show dist quality in /dists
20:03
raydiak I see a deprecation on the same day for IO::Handle.spurt, with a commit message "In favour of IO::Path.spurt. Spurting on an opened handle is not really anything else but print/write on the handle." 20:14
guess the same train of thought was applied to slurp and lines/read?
alexghacker the closest I saw to discussion in the IRC logs was long after the commit: irclog.perlgeek.de/perl6/2014-10-30#i_9588620 20:15
I personally find the need for spurt to be dubious on any context, but think slurp could apply just as well to pipes and partially read files as it does to whole files 20:17
FROGGS well, I am in favour of Str.slurp and Str.spurt 20:18
raydiak is it either/or? 20:19
alexghacker shouldn't be 20:20
lucas_ Is Perl6::Perl5::Differences considered spec material or just aside material? Any chances of it moving from mu to specs and being maintained as a full "Perl 5 vs Perl 6 differences" spec file? Say S34 or S98? 20:21
moritz lucas_: just aside material
lucas_: and IMHO it doesn't belong into the synopsis 20:22
lucas_ moritz: ok, thank you.
[Coke] moritz++
alexghacker moritz++ I do see that you suggested maybe a .readall method for handles as an alternative to slurp 20:23
would that be functionally equivalent but named differently for aesthetic and expectation reasons? 20:24
moritz alexghacker: IMHO it would be fairly obvious that readall works on an opened file handle, reads everything from the current position onwards, and doesn't close the handle 20:25
alexghacker: whereas as a user I wouldn't have any idea what state my file handle would be in after a .slurp
alexghacker I'll buy that explanation
moritz would it be where I left it (and what if the handle wasn't seekable)? or at the end of the file, but still open? or closed? 20:26
or rewound to the start, if seekable?
timotimo we could have .slurp-rest 21:48
hm, that doesn't address the "does it close the file?" question, though 21:49
how do i get the path to the currently-being-executed source file?
FROGGS $?FILE ?
timotimo that does it 21:50
i haven't had to deal with paths a lot recently
timotimo ... do i really have to .path.method-for-path.path.method-for-path.path.method-for-path? 21:58
ah .parent gives me what dirname would do but as a path rather than a string 21:59
timotimo damn, even when / ... / { ... } will not set $/ correctly if it's in a loop? 22:30
um ... 22:31
raydiak RT #123005 22:34
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=123005
raydiak related, I guess 22:35
timotimo i might have been wrong, gimme a sec. 22:38
timotimo ah, i derped 22:39
good.
phew!
raydiak "the breakage was only in my brain, what a relief" :) 22:40
timotimo :) 22:44
that means i'm the only one who has that problem ;)
the problem was that i had ( ) around the submatch i was interested in, but i wasn't aware i put it there
raydiak you out-witted yourself :) 22:47
raydiak afk
pmurias we have a rady for production date of February 2015? 22:55
bbkr r: ["a", "b"] ~~ [ *, "b" ] 22:58
yoleaux 24 Oct 2014 02:27Z <tony-o> bbkr: couldn't duplicate moar build segfault on yosemite. was able to reproduce your bug @ rt.perl.org/Public/Bug/Display.html?id=122803
camelia rakudo-moar 315ec6: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏a' (indicated by ⏏)␤ in method Numeric at src/gen/m-CORE.setting:13670␤ in sub infix:<==> at src/gen/m-CORE.setting:4522␤ in sub infix:<==> at src/gen/m-C…»
..rakudo-parrot 315ec6: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏a' (indicated by ⏏)␤ in method Numeric at gen/parrot/CORE.setting:13609␤ in sub infix:<==> at gen/parrot/CORE.setting:4526␤ in sub infix:<==> at gen/par…»
bbkr is this behavior a bug? 22:59
r: [1, 2, 3] ~~ [ *, 2, 3 ] 23:00
camelia ( no output )
bbkr why rakudo wants to convert first array to numerics when it is matched against second array containing whatever? 23:01
timotimo m: say (1, 2, 3) ~~ (*, 2, 3) 23:03
camelia rakudo-moar 315ec6: OUTPUT«True␤»
timotimo i think you want this one instead
m: say <a b c> ~~ (*, "b", "c")
camelia rakudo-moar 315ec6: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏a' (indicated by ⏏)␤ in method Numeric at src/gen/m-CORE.setting:13670␤ in sub infix:<==> at src/gen/m-CORE.setting:4522␤ in sub infix:<==> at src/gen/m-C…»
timotimo oh, huh.
that doesn't seem right to me
bbkr++
bbkr reporting :)
bbkr r: say so ["a", "b", "c"] ~~ [ "a", "b", * ] 23:06
camelia rakudo-{parrot,moar} 315ec6: OUTPUT«True␤»
bbkr r: say so ["a", "b", "c"] ~~ [ "a", *, "b" ]
camelia rakudo-parrot 315ec6: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏b' (indicated by ⏏)␤ in method Numeric at gen/parrot/CORE.setting:13609␤ in sub infix:<==> at gen/parrot/CORE.setting:4526␤ in sub infix:<==> at gen/par…»
..rakudo-moar 315ec6: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏b' (indicated by ⏏)␤ in method Numeric at src/gen/m-CORE.setting:13670␤ in sub infix:<==> at src/gen/m-CORE.setting:4522␤ in sub infix:<==> at src/gen/m-C…»
raydiak !afk 23:13
raydiak so I need a name for the command-line interface for math::symbolic that gets installed in bin 23:31
how is 'ms'? it doesn't seem to be anything on my server or my laptop, or a very brief search 23:32
pmurias s/rady/ready/ 23:34
lucas_ raydiak: hi. isn't "ms" too short? don't you like mathsym or symmath? 23:35
raydiak lucas_: sure, that might be more appropriate...thanks 23:36
pmurias fosdem.org/2015/schedule/event/get..._to_party/ # that's what prompted my "ready date" question 23:37
raydiak pmurias: it doesn't directly imply that the talk will be taking place after the release 23:39
lizmat raydiak: wrt irclog.perlgeek.de/perl6/2014-11-06#i_9621580 , I hadn't considered your use of slurp 23:40
so I'll probably undeprecate that
wrt IO::Handle.spurt 23:41
I still think that should be deprecated
raydiak lizmat: what about moritz's 'readall' alternative suggestion to slurp?
raydiak irclog.perlgeek.de/perl6/2014-11-06#i_9621652 23:42
pmurias raydiak: do we have a release date? 23:43
raydiak pmurias: not that I've seen myself, but I've seen this question a lot lately...but I'm no authority on...much of anything :)
lizmat raydiak moritz: I'm not sure we need another name 23:45
IO::Path.slurp clearly closes the file afterwards, as there is no handle exposed at all
IO::Handle.slurp *doesn't* close the handle at the end, because it was handed a handle, and you need to close those explicitely 23:46
(as it is implemented now)
raydiak where does it leave the file reading cursor thing that I don't know the proper name of?
beginning? end? where it was before the .slurp? 23:47
lizmat file pointer
no, where it was at the end of the slurp
if you opened the handle in read/write, you *could* actually start writing again there
raydiak cool, makes sense 23:48
lizmat so the only thing that needs to be done, is undeprecate it 23:49
TimToady and possibly rename it to slurprest or so
lizmat TimToady: really? 23:50
pmurias TimToady: do we have an official "production ready" date?
lizmat pmurias: don't think so
TimToady no, merely that 2015 will likely contain that data :)
*date 23:51
pmurias got confused by a troll claiming that we do have one in February and pointing to this talk ;) 23:52
TimToady trolls cannot read
lizmat and it's actually in January (31st, but still :-) 23:56
tony-o is any of the author/module thing implemented yet? i have Benchmark module ported from p5 but there is already one in the landscape.. 23:56
lizmat tony-o: alas, still NYI :-( 23:57
tony-o or is that nyi?
maybe ill call it superbenchmark
BenGoldberg Perhaps instead of naming the method slurp or slurprest, "read-to-end" ?
Methods-with-hyphens are perl-sixy :) 23:58
tony-o slurp-rest
lizmat oddly enough, I think slurp() is one of the first Perl 6 things that got backported to p5
tony-o slurp is really nice 23:59