»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by moritz on 25 December 2014.
grondilu std: infix:«->» 00:00
camelia std efd2de0: OUTPUT«5===SORRY!5===␤Undeclared routine:␤ 'infix:«->»' used at line 1␤Check failed␤FAILED 00:00 134m␤»
grondilu std: &infix:«->»
camelia std efd2de0: OUTPUT«5===SORRY!5===␤Undeclared routine:␤ 'infix:«->»' used at line 1␤Check failed␤FAILED 00:00 138m␤»
grondilu lol we could even define C's -> operator. That'd be cool. 00:01
something like &infix:«->»(Pointer $, Capture $) {...}
grondilu realizes that'd be actually more complicated. 00:03
00:14 vendethiel left 00:19 vendethiel joined
masak grondilu: wouldn't &prefix:<*> collide with term:<*> ? 00:19
grondilu m: sub &prefix:<*>($) { "ok" }; say *pi, *; 00:20
camelia rakudo-moar 4659f3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/prurxBo_4N␤Missing block␤at /tmp/prurxBo_4N:1␤------> 3sub 7⏏5&prefix:<*>($) { "ok" }; say *pi, *;␤ expecting any of:␤ new name to be defined␤»
00:20 dolmen left
grondilu m: sub prefix:<*>($) { "ok" }; say *pi, *; 00:20
camelia rakudo-moar 4659f3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/np1fRgb9I2␤Preceding context expects a term, but found infix * instead␤at /tmp/np1fRgb9I2:1␤------> 3sub prefix:<*>($) { "ok" }; say *pi, *7⏏5;␤»
grondilu m: sub prefix:<*>($) { "ok" }; say *pi; 00:21
camelia rakudo-moar 4659f3: OUTPUT«ok␤»
grondilu m: sub prefix:<*>($) { "ok" }; say *pi; say *;
camelia rakudo-moar 4659f3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kPPU9RDdXz␤Preceding context expects a term, but found infix * instead␤at /tmp/kPPU9RDdXz:1␤------> 3b prefix:<*>($) { "ok" }; say *pi; say *7⏏5;␤»
grondilu hum 00:22
apprently it does collide.
I'm not sure it should, frankly. Yet I vaguely remember having already talked about that and TimToady gave an explanation as why it should collide indeed. 00:23
00:24 muraiki_ left
masak they collide. 00:24
the only reason I asked is that it's very clear to me that they do. ;)
grondilu unfortunatly I'm unconvinced. if we see * and no term after it, then we're talking about the term, not the prefix, don't we?
masak you're not allowed to reason like that. 00:25
that's the problem.
grondilu :/
masak the parser reasons based on information it has in the now, not information from the future.
grondilu oh yeah, no backtracing, right?
masak we tend to flaunt most conventions, but we take time travel seriously.
grondilu indeed that's the reason TimToady gave, I remember now.
as S02 puts it: « To the extent allowed by sublanguages' parsers, Perl is parsed using a one-pass, predictive parser. That is, lookahead of more than one "longest token" is discouraged. 00:26
»
it's a bit of a bummer, though. IMHO 00:27
masak there are four types of things. terms, prefixes, infixes, and postfixes. term: (T -> O), prefix: (T -> T), infix: (O -> T), postfix: (O -> O). since term and prefix both happen in a T state, they collide.
(Perl 6 also talks about circumfixes and postcircumfixes. but these are simply fancy terms and postfixes, respectively.) 00:28
I got a better appreciation for all this while developing 007.
grondilu well, I guess we could use a unicode character that looks like * 00:30
masak .oO( now you have two problems. )
grondilu ? 00:31
m: say \u{BLACK STAR} 00:32
camelia rakudo-moar 4659f3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QcgzxshMbZ␤Undeclared names:␤ BLACK used at line 1␤ STAR used at line 1␤Undeclared routine:␤ u used at line 1␤␤»
00:32 grettir joined
grondilu ah I never remember the syntax for named characters 00:32
m: say "\c[BLACK STAR]" 00:33
camelia rakudo-moar 4659f3: OUTPUT«★␤»
masak as long as you pick something distinct enough, you should be fine.
grondilu I'm not sure why it has to be distinct and not just different. A human will always tell the difference. 00:34
(humans are not restricted to this "no time travel" rule) 00:35
masak maybe. 00:36
grondilu I really think an operator would be nice because "deref" is eeek
00:38 Hor|zon joined
grondilu m: print "there is also: \c[ASTERISK OPERATOR]" 00:38
camelia rakudo-moar 4659f3: OUTPUT«there is also: ∗»
grondilu m: say "\c[ASTERISK OPERATOR] * \c[BLACK STAR] (just looking them all next to one another)" 00:39
camelia rakudo-moar 4659f3: OUTPUT«∗ * ★ (just looking them all next to one another)␤»
grondilu likes the asterisk 00:40
00:43 Hor|zon left 00:44 echowuhao left
grondilu m: sub prefix:<∗>($) { 1 }; say pi * ∗4; 00:44
camelia rakudo-moar 4659f3: OUTPUT«3.14159265358979␤»
grondilu really likes it: it looks a hell lot like the C operator and yet it's clearly different than infix:<*> so that it's hard to confuse it. 00:46
00:47 skids joined
masak well, as long as you're happy. :) 00:47
grondilu module Asterix { multi prefix:<∗>(Pointer $p) is export { deref $p } }; 00:48
now instead of defining a pointer to an int as 'my Pointer[int] $n' we could even consider write it 'my int ∗$n;' 00:52
I think that would be cool, but I suspect you guys will not agree.
masak :)
if you can make it work, knock yourself out. 00:53
but it's starting to sound slang-y to me.
grondilu I'm a user, not an implementator :)
class int∗ is Pointer[int] {} # wouldn't that do the job, though? 00:54
masak can't have non-alnums in an identifier like that. 00:55
grondilu std: class foo∗ {}
camelia std efd2de0: OUTPUT«5===SORRY!5===␤Unable to parse class definition at /tmp/t3rKvonhpj line 1:␤------> 3class foo7⏏5∗ {}␤ expecting any of:␤ name␤ trait␤Parse failed␤FAILED 00:00 134m␤»
grondilu oh ok
masak also, that's not how you wrote it.
you had a space in between.
grondilu in C it would be accepted. 00:56
masak then maybe you should write it in C instead ;)
ShimmerFairy While I can see the appeal in having the syntax match C, I feel I should point out that Perl 6 specifically *isn't* C. :)
grondilu but since the native types are so close to their C meanings, it makes sense to use the same notations for them. 00:57
I mean, translating (*p)[0] into (deref $p)[0] would be a bit dull. 00:59
'deref' is so much more verbose than '*' 01:00
ShimmerFairy I think I actually prefer "deref", since it's more descriptive.
dalek jo6/mojolicish: b221c9b | hoelzro++ | TODO.md:
Add Mojolicish TODO
01:01
jo6/mojolicish: c14d0ca | hoelzro++ | mojo-tests/ (172 files):
Add tests from Mojolicious 5.79
jo6/mojolicish: 628ffd9 | hoelzro++ | TODO.md:
Start documenting differences from P5 Mojolicious
jo6/mojolicish: 2a32a76 | hoelzro++ | t/mojolicious/lite_app.t:
Start on Mojolicious tests
jo6/mojolicish: a3b5467 | hoelzro++ | lib/Mojolicious/Lite.pm:
Stub Mojolicious::Lite bits
jo6/mojolicish: bc7d48d | hoelzro++ | lib/ (3 files):
More stubbing
jo6/mojolicish: 1213487 | hoelzro++ | lib/Mojolicious.pm:
Implement defaults method
jo6/mojolicish: ecc922b | hoelzro++ | lib/Mojo (3 files):
Add logging stuff
01:02 vendethiel left
ShimmerFairy grondilu: like I said, I don't have a problem with C-like notation, but I'm not convinced it needs to be in standard Perl 6. 01:02
01:03 vendethiel joined
grondilu well, NativeCall is not exactly standard Perl 6 (otherwise we would not have to specify 'use NativeCall') 01:03
TimToady well, that's also negotiable :)
but we can't have something that is both a term and a prefix 01:04
ShimmerFairy IIRC NativeCall was just an implementation of something in the spec.
TimToady it would actually be easier to have a * postfix, but I wouldn't recommend that either 01:05
grondilu TimToady: you don't like my suggestion of using the asterix symbol (unicode 0x2217)? 01:06
TimToady too confusing
in any case, it's probably a much more p6y thing to define a postfix for deref 01:07
ShimmerFairy $pointer.deref seems like an obvious candidate (though it's not exactly a postfix, of course) 01:08
grondilu wonder if $$pointer would make sense 01:09
dalek kudo-star-daily: 8c29e41 | coke++ | log/ (11 files):
today (automated commit)
ShimmerFairy r: my $a = 5; say $$a; 01:10
camelia rakudo-moar 4659f3: OUTPUT«5␤»
TimToady r: my $a = 5; say $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$a
camelia rakudo-moar 4659f3: OUTPUT«5␤»
grondilu it does nothing special for normal variables, but could it have a special mening for natives?
TimToady possibly
but if "pointer" gets complicated, better to have a postfix 01:11
01:11 raiph left, jschulz left
ShimmerFairy we could have a $ postfix :P 01:12
grondilu I got to admit I'm a bit frustrated by not being able to convince you about the asterix, for I'd love to write 'my int ∗$p;'
raydiak yay slangs :)
TimToady never gonna happen
grondilu :(
ShimmerFairy Not only is it too similar to the ASCII asterisk, but standard Perl 6 also likes having texas variants of Unicode things.
TimToady it's formally ambiguous
01:13 raiph joined
TimToady oh, you mean the unicode one 01:13
but that also proves my point that you confused me :)
grondilu yes, that's the unicode I typed.
my int *$wrong; my int ∗$ok
it does not matter if they look the same, as long as they are different for the parser. 01:14
TimToady the reader matters every now an again too
we are not completely autistic
grondilu the reader will know what it's about.
masak this is an interesting discussion. I agree with TimToady, but I feel for grondilu, who wants to turn his Perl 6 into C. 01:15
TimToady but certainly you can define your own prefix if you like, as long as it's not ambiguous
grondilu 'my int ∗$ok' would require more than a prefix definition, unfortunately. 01:16
TimToady we've had a firm policy of not turning Perl 6 into any particular language, though we've been accused of it from time to time :)
TimToady thinks the inside-out declarations of C can stay in C
masak grondilu: that's why I said it looks slang-y.
grondilu I don't want to turn Perl 6 into C, just the part that uses natives.
'my Int ∗$p' would be a compile error, for instance. 01:17
masak .oO( I don't want to turn you all into lizards, just your brains and your tails ) 01:18
grondilu 'my ∗$p' would actually mean: 'my Pointer[void] $p'
TimToady would trot out a slippery slope argument here if he believed in slippery slope arguments :)
masak TimToady: problem is, once you start believing in one slipperly slope argument... :P
geekosaur I could imagine a slang for interfacing with C that looked more like C... in a module 01:19
grondilu
.oO( use C-style; )
I'd be fine with that, if slangs can deliver.
a better name would just be asterix, I guess. 'use asterix; my ∗$p;' 01:21
TimToady that's my grandson you're talking about 01:23
geekosaur wonders what obelix does
TimToady who doesn't want me typing right now, since I'm holding him 01:24
grondilu ouch, asterisk indeed. 01:25
come on, don't you think 'my ∗$p;' would be more elegant than 'my Pointer[void] $p;'? 01:26
ShimmerFairy In Perl 6, I think we should have type names look like type names. 01:27
grondilu m: my $x; say $x.WHAT 01:28
camelia rakudo-moar 4659f3: OUTPUT«(Any)␤»
grondilu yet we don't write my Any $x
geekosaur m: my Int $x; 01:30
camelia ( no output )
masak grondilu: I think 'my Pointer[void] $p;' looks a whole lot clearer than 'my ∗$p;' 01:31
grondilu what about 'my void ∗$p;'? 01:33
it looks a lot like the C code, so it would make a C-programmer feel at home.
masak it feels like you're conflating operators (which belong in expressions) and type declarations.
grondilu it feels both perlish and C-ish. 01:34
I began with talking with operators, which made me think of declarations.
masak C does that -- conflate them. 01:35
I don't necessarily feel that's a good thing.
grondilu well in perl 6 we would not have to.
oh wait, I see what you mean. 01:36
that's an issue indeed.
but again, that kind of syntax would only be used for native types, so that should help. 01:38
(hopefully)
ShimmerFairy Not to repeat myself, but Perl 6 isn't C. It's OK if the syntax between the two languages don't match (they don't match in plenty of places already ☺)
masak the extent to which I agree with ShimmerFairy is that the rationale for a syntax should come from within the language itself. not from within some other language the reader is expected to feel comfortable with. 01:40
grondilu ok, good point.
masak 'my ∗$p;' does not make sense from a Perl 6 perspective. maybe it could be made to work with sufficiently advanced slang, and maybe some C programmers would appreciate the thought. 01:41
but it would be departing from Perl 6 syntax and probably from Perl 6 ideals, too.
raydiak not that I think we *should*, but you'd probably have more success allowing * as a postfix on native typenames; then you at least get 'my void* $p', easy to type, and isn't likely to be used in ambiguous contexts off the top of my head 01:42
grondilu can you define an operator to act on Types? 01:43
masak operators occur in expressions.
that's not an expression.
raydiak idk if that'd be an operator or something more slangish
and now I do :) 01:44
grondilu could it be the kind of things that could be done with a macro? 01:45
raydiak regards the * in C more as part of the type than the name anyway
masak grondilu: not as the macro spec stands today.
grondilu well, I hope I did not bother you too much with those heretic ideas ;) off to bed for me now. 01:52
01:52 grondilu left
masak grondilu++ # heresy 01:53
'night, #perl6 02:10
02:19 fhelmberger joined
alpha- nn 02:19
02:20 telex left 02:22 telex joined 02:23 fhelmberger left 02:26 laouji joined 02:27 Hor|zon joined 02:31 laouji left 02:32 Hor|zon left
timotimo nn 02:40
02:45 ilbot3 left 02:47 ilbot3 joined 02:52 grettir left 03:01 fernand__ left 03:06 fernand__ joined 03:07 fernand__ left 03:08 noganex_ joined 03:11 noganex left 03:18 Patterner joined 03:22 Psyche^ left
raydiak dunno if anyone is around, but...in spite of the docs claim that " lua_createtable $L, 0, 0; 03:37
heh
Capture doesn't do Positional or Associative
why?
I'd ask why subscripting things which don't implement those roles is even valid, but I guess the answer is probably autovivification 03:43
03:43 leont left
TimToady m: say “I'm ”, ‘“client-friendly”.’ 03:44
camelia rakudo-moar 4659f3: OUTPUT«I'm “client-friendly”.␤»
raydiak TimToady++ 03:45
flussence m: say ”foo“ 03:51
camelia rakudo-moar 4659f3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6hZOITsTiK␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument␤at /tmp/6hZOITsTiK:1␤------> 3say 7⏏5”foo“␤ expecting any of:␤…»
flussence neat
well, weird error but I expected one there.
04:07 davido___ left 04:08 davido___ joined 04:09 FROGGS left, davido___ left, FROGGS joined 04:11 davido___ joined 04:16 Hor|zon joined 04:20 Hor|zon left 04:30 echowuhao joined 04:32 rmgk_ joined, rmgk is now known as Guest77697, Guest77697 left, rmgk_ is now known as rmgk 05:19 davido___ left 05:21 davido___ joined
raydiak \o/ the Inline breakage is indeed gone, at least 3 more modules should work again; FROGGS++ 05:22
TimToady std: say ”foo“ 05:27
camelia std efd2de0: OUTPUT«5===SORRY!5===␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/da4WBZWPFz line 1:␤------> 3say7⏏5 ”foo“␤Confused at /tmp/da4WBZWPFz line 1:␤------> 3say 7⏏5”foo…»
TimToady huh, I guess it's my fault 05:28
should probably say "Bogus term" or so
06:03 laouji joined 06:04 Hor|zon joined 06:08 laouji left 06:09 Hor|zon left 06:18 mr-foobar left 06:21 bjz joined
dalek ast: 9394e7e | TimToady++ | S02-lexical-conventions/one-pass-parsing.t:
don't be overspecific on parsefail error
06:22
kudo/nom: 629f5a4 | TimToady++ | src/Perl6/Grammar.nqp:
bare say now complains about no valid arg

  (since it might be an invalid arg rather than a missing arg).
The help message for bare say et al. is demoted to a worry.
06:24
c: 99e560d | moritz++ | lib/Type/Cool.pod:
fix output example, pippo++
06:27
06:28 bjz left 06:33 gfldex joined
dalek d: 28329a7 | TimToady++ | STD.pm6:
demote bare say message in case of bogus term
06:37
06:38 risou is now known as risou_awy, risou_awy is now known as risou 06:42 FROGGS[mobile] left 06:50 bjz joined 06:53 BenGoldberg left
dalek kudo/nom: f84e536 | TimToady++ | src/Perl6/World.nqp:
don't claim TTIAR if 2nd term failed to parse

It's just a bogus term if it can't parse it...
06:59
kudo/nom: 546000b | TimToady++ | src/Perl6/Grammar.nqp:
don't panic, just be sorry (on bare say etc.)

This allows the new bogus term message to show when appropriate.
07:02 wicope joined
dalek ast: d39c6dc | TimToady++ | S32-exceptions/misc.t:
don't overspecify error message on bare ord
07:06
TimToady m: list ` 07:08
camelia rakudo-moar 629f5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/sbO3EbvOFN␤Two terms in a row␤at /tmp/sbO3EbvOFN:1␤------> 3list 7⏏5`␤ expecting any of:␤ argument list␤ prefix or term␤ prefix or meta-prefix␤ postfix␤ …»
TimToady if it was expecting a prefix or term there, you can't call it a term...
so that situation now produces "Bogus term" instead 07:09
07:12 rindolf joined, ribasushi left 07:13 diana_olhovik joined 07:18 FROGGS left
nine_ .tell moritz the No such method '' for invocant of type 'Foo' is not new. I've seen it appear in Inline::Perl5 as well but ever since I wanted to invest time into it, I've been unable to reproduce it. 07:20
yoleaux nine_: I'll pass your message to moritz.
07:20 ribasushi joined 07:21 echowuhao left
TimToady m: list ` 07:23
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Yk99bluLvg␤Bogus term␤at /tmp/Yk99bluLvg:1␤------> 3list 7⏏5`␤ expecting any of:␤ argument list␤ prefix or term␤ prefix or meta-prefix␤ postfix␤ inf…»
TimToady m: say;
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5===␤No valid term seen where one is required␤at /tmp/QOg0H5T28K:1␤------> 3say7⏏5;␤ expecting any of:␤ argument list␤Other potential difficulties:␤ Unsupported use of bare 'say'; in Perl 6 please use .say if …»
TimToady m: say ”foo“ # reversed quotes 07:24
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5===␤No valid term seen where one is required␤at /tmp/1lkeHrxvBB:1␤------> 3say 7⏏5”foo“ # reversed quotes␤Bogus term␤at /tmp/1lkeHrxvBB:1␤------> 3say 7⏏5”foo“ # reversed quotes␤ expecting any of:␤ …»
raydiak nine_++: thanks for all your work on the Inline modules...they inspired Inline::Lua 07:29
07:34 gfldex left
nine_ raydiak: :) 07:39
07:40 Rounin joined 07:43 tengignick joined, tengignick left 07:46 tengignick joined 07:50 anaeem1 joined 07:51 anaeem1 left, anaeem1_ joined
TimToady m: say “foo" # mismatched quotes 07:52
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YBRwruT0eE␤Unable to parse expression in smart double quotes; couldn't find final '”' ␤at /tmp/YBRwruT0eE:1␤------> 3say “foo" # mismatched quotes7⏏5<EOL>␤ expecting any of:␤ argu…»
07:53 laouji joined, Hor|zon joined
raydiak nine_: that native(&sub) trick lets you detect and switch libraries at runtime? 07:55
07:57 laouji left 07:58 Hor|zon left, FROGGS joined 08:04 prime left
TimToady m: my $href = { A => 98, Q => 99 }; 08:12
camelia ( no output )
08:14 prime joined, darutoko joined, zakharyas joined
FROGGS m: my class Coffee is repr<CStruct> { has uint8 $.milk }; say Pointer[Coffee] 08:15
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5=== Error while compiling /tmp/wGsglBIVwd␤Undeclared name:␤ Pointer used at line 1␤␤» 08:16
FROGGS m: use NativeCall; my class Coffee is repr<CStruct> { has uint8 $.milk }; say Pointer[Coffee]
camelia rakudo-moar 546000: OUTPUT«(TypedPointer[Coffee])␤»
08:16 larion left
FROGGS m: use NativeCall; my class Coffee is repr<CStruct> { has uint8 $.milk }; say Pointer[Coffee].new 08:16
camelia rakudo-moar 546000: OUTPUT«TypedPointer[Coffee]<NULL>␤»
FROGGS m: use NativeCall; my class Coffee is repr<CStruct> { has uint8 $.milk }; say Pointer[Coffee].new.deref
camelia rakudo-moar 546000: OUTPUT«(Coffee)␤»
FROGGS m: use NativeCall; my class Coffee is repr<CStruct> { has uint8 $.milk }; say Pointer[Coffee].new.of
camelia rakudo-moar 546000: OUTPUT«(Coffee)␤»
FROGGS m: use NativeCall; my class Coffee is repr<CStruct> { has uint8 $.milk }; say Pointer[Coffee].of
camelia rakudo-moar 546000: OUTPUT«(Coffee)␤»
FROGGS :o)
the 'TypedPointer' will be shown as 'Pointer' once the ^how-method support get merged from native-ref 08:18
so it can .perl.EVAL nicely
raydiak FROGGS++ :) 08:19
FROGGS :o)
the native stuff really is fun to implement 08:20
and the reason for that is that Perl 6 is that powerful... everything is potentially fine grained typed, which helps a lot to create a nice api
08:21 _mg_ joined
raydiak the idea came up earlier about a Slang::Cish or something which could allow e.g. 'int*' as sugar for 'Pointer[int]' 08:23
FROGGS that should be doable
I mean, I made this: github.com/FROGGS/p6-Slang-Piersing 08:24
which allows identifiers to end with <[?!]>
raydiak I saw, it's neat :)
FROGGS so, int* (or better int32*) could be implemented in about 50 loc 08:25
raydiak could maybe do some other neat nativecall sugars in ::Cish too, if someone wanted to make a project out of it...grondilu++ seemed excited about his * idea 08:29
dalek c: 88bfdf0 | TimToady++ | lib/Language/5to6.pod:
mention Zen slice, need for parens in P5's list x
c: baf99a8 | TimToady++ | lib/Language/5to6.pod:
-> should be <->
08:32
TimToady actually, ending identifiers with ! interferes with a factorial operator, and it's easy enough to define a postfix:<?> that passes through a boolean 08:34
if you really want one
and the ! is not necessary because mutating methods are used with .= generally
@array.=sort; 08:35
"All things are possible, but not all things are expedient." --St Paul
FROGGS I was just asked to allow said identifiers, I do not know why masak want to have that... 08:37
I just thought: hey, I can release that within 15 minutes! :o)
08:40 anaeem1_ left, anaeem1 joined
moritz TimToady: not all mutators can be exposed as returning a modified copy instead 08:41
yoleaux 07:20Z <nine_> moritz: the No such method '' for invocant of type 'Foo' is not new. I've seen it appear in Inline::Perl5 as well but ever since I wanted to invest time into it, I've been unable to reproduce it.
TimToady masak doesn't particularly want it, it was grondilu that was hankering for C syntax
moritz also there's the slight question of performance 08:42
TimToady sure, but ! is a low-luminance feature, as far as I'm concerned 08:43
moritz fwiw I'm of two minds here
I kinda like the explicitness of !
TimToady rather have a general way of turning normal methods into mutators, and then optimize from there
08:43 tengignick left
moritz otho it always looks like angry code for me :-) 08:43
TimToady you really wanna put ! on every push
?
moritz not sure; I'd have to try it 08:44
TimToady anyway, this was definitely one feature we decided not to borrow from ruby
08:44 _mg_ left 08:45 tengignick joined
TimToady should probably go to bed before he gets grouchy :) 08:45
moritz good night, TimToady, and dream of unpoisoned identifiers 08:47
08:54 Hor|zon joined 08:57 Ven joined 09:04 vukcrni left 09:05 Rounin left, bolangi left 09:10 virtualsue joined 09:15 virtualsue left 09:16 tengignick left
dalek c: f741837 | moritz++ | util/update-and-sync:
Enable Inline::Python again

I have installed a version of Inline::Python that nine++ fixed
09:16
09:17 kjs_ joined 09:18 tengignick joined
jnthn morning, #perl6 09:18
raydiak good morning jnthn 09:19
09:20 tengignick left
moritz \o * 09:21
raydiak hi moritz
09:22 Ven left 09:26 dakkar joined 09:36 larion joined 09:40 rurban joined
[ptc] o/ moritz 09:43
09:50 espadrine joined 09:51 coffee` joined 10:00 larion_ joined 10:01 larion_ left
raydiak good night, morning people o/ 10:06
10:11 _mg_ joined, _mg_ left
masak good antenoon, #perl6 10:12
10:12 _mg_ joined
masak I think mandating ! on every mutator will ultimately fail, because we don't have a solid model for restricting writes to the "insides" of objects, arrays/hashes, etc. 10:13
that's why this works, for example: 10:14
m: sub foo(@a) { @a.push(5) }; my @b = 1, 2, 3; foo(@b); say @b.perl
camelia rakudo-moar 546000: OUTPUT«Array.new(1, 2, 3, 5)␤»
masak note that I didn't mark `@a` as `is rw`.
also note that the spec stubbornly forbids this kind of behavior -- it's just that reality refuses to listen. 10:15
10:15 diana_olhovik left, virtualsue joined 10:16 diana_olhovik joined
FROGGS .oO( Lalalala I can't hear you! -- rakudo ) 10:20
tadzik /o\ LALALALA 10:21
masak more generally, I'm not convinced that it's possible to build a consistent model of what contains what, without doing something drastic like splitting `has` up into `has` (containment) and `knows` (inter-object link) or something. 10:24
and I've been over in those parts, and I haven't seen a local optimum there either. 10:25
sergot hi #perl6
tadzik hello sergot
moritz: huh, I think the move to subtrees broke 'git pull' in panda :| 10:26
dalek perl6-examples: 4783208 | paultcochrane++ | euler/prob029-gerdr.pl: 10:37
perl6-examples: Add sigils to prob029-gerdr.pl
perl6-examples:
perl6-examples: Maybe this code only used to work in pugs? Anyway, it runs again now and
perl6-examples: its result matches the expected Euler project answer.
10:37 dalek left 10:38 dalek joined, ChanServ sets mode: +v dalek 10:47 kjs_ left
dalek rakudo/cpp: 80a5135 | lizmat++ | src/core/Str.pm: 10:51
rakudo/cpp: Make substr() a lot faster, make substr-rw() work
rakudo/cpp:
rakudo/cpp: Highlights:
rakudo/cpp: - substr("foo",1) 2.5x faster
10:51 dalek left 10:52 dalek joined, ChanServ sets mode: +v dalek
dalek c: e3c8333 | (Salve J. Nilsen)++ | lib/Language/functions.pod:
Remove superfluous 'for' in example
10:53
10:53 virtualsue left 10:54 _mg_ left
sjn \o 10:58
10:59 tengignick joined
tadzik o/ 11:02
sjn++ # deserved karma
sjn oh?
jnthn ooh, an sjn!
tadzik A wild sjn appears!
sjn: yeah, some (Salve J. Nilsen)++ stole your karma for doc commit 11:03
sjn tadzik: ah, how do I fix that?
11:03 baest left
tadzik I don't know anymore :D 11:03
jnthn Yes. And a wild jnthn will appear in Oslo and be free on evening of 9th and/or 10th March
tadzik at some point it involved being in parrot's CREDITS file
sjn assumes that comes from the user.name setting in git-config
jnthn: oh, cool!
jnthn: you're missing Damian by a week though! :-( 11:04
11:04 virtualsue joined
jnthn sjn: Aww! 11:04
sjn oh well
jnthn sjn: Anyway, I'll be about if anybody wants to go take a beer one of those evenings.
sjn would love that
We can invite to an emergency beer rescue or something :) 11:05
jnthn
.oO( Much better than an emergency bear rescue )
sjn hehe 11:06
11:12 MadcapJake left, MadcapJake joined 11:18 laouji joined 11:22 kjs_ joined 11:23 raiph left 11:24 larion left 11:25 grondilu joined 11:26 adu left
dalek c: 5b60067 | paultcochrane++ | lib/Language/5to6.pod:
Add vim coda to 5to6.pod

Now vim knows how to highlight and indent the file
11:26
c: 77d2a9c | paultcochrane++ | lib/Language/5to6.pod:
Mention :delete and :exists on hashes in 5to6
11:27 laouji_ joined 11:28 virtualsue left 11:31 laouji_ left 11:35 Kristien joined
sjn jnthn: hey, about your Oslo trip... would you be up for showing off some cool Perl 6 stuff at Hackeriet (a hackerspace I'm involved with) on that tuesday evening? 11:35
(just a crazy idea, but I think there are a lot of clever people there, and it's nice to get outside of the "usual" Perl bubble now and then :) 11:36
jnthn sjn: Perhaps so. I'm not goig to have a lot of free time to prepare something, otoh I can improvise quite easily... :) 11:38
sjn jnthn: also, 2015.flatmap.no/ (a conference about functional programming on the JVM, with focus on Scala; CfP is now)
11:38 tengignick left
sjn jnthn: a tour-de-force of Cool Stuff would be quite sufficient :D 11:38
btyler ls 11:40
jnthn sjn: 'fraid I'm taken in April
sjn: So won't be able to make flatMap
sjn: I've kept the OSDC.no dates in May free, however :)
sjn ok, cool 11:41
btyler: No such file or directory 11:43
btyler doh 11:45
11:45 tengignick joined
btyler closes the window 11:45
tadzik fun idea: have an irc bot that detects when someone enters a shell command, and then for the rest of the day it replies to that person evaling everything they say 11:46
11:46 virtualsue joined, tengignick left
tadzik perhaps until they write 'exit' or so :D 11:46
moritz annoybot 11:47
11:48 tengignick joined, tengignick left 11:49 baest_ is now known as baest 11:53 Kristien left
FROGGS m: use NativeCall; class Foo is repr<CStruct> { }; Foo.new 11:55
camelia rakudo-moar 546000: OUTPUT«(signal SEGV)»
FROGGS sergot: it even happens for CStructs :o)
sergot: and it is a LHF to fix that actually
sergot: I guess something in here has to be tweaked: 11:57
MoarVM/src/6model/reprs/CStruct.c:303:static void compose(...
sergot: err, no, I think initialize is to blame, not compose
but yeah, gdb will know
sergot FROGGS++ 12:03
:)
FROGGS no, ++sergot 12:04
:P
[ptc] tadzik: you mean like eliza? 12:08
tadzik [ptc]: is that how eliza works? :)
[ptc] tadzik: basically eliza takes everything you say, turns it around and makes a question out of it 12:09
tadzik: but it's been *years* since I've played with it
12:09 larion joined
[ptc] believes it was still in the 90's 12:09
tadzik heheh 12:10
moritz is that how Eliezer works? :-) 12:12
colomon remembers reading Eliza source code in Creative Computing in the early 80s… 12:13
www.manifestation.com/neurotoys/eliza.php3 12:17
(not what I read then)
[ptc] omg! in PHP!
12:19 Ven joined
colomon javascript, I think 12:20
[ptc] colomon: yup, you're right 12:21
[ptc] needs to stop typing faster than he thinks
12:32 kjs_ left 12:33 telex left 12:34 telex joined, leont joined 12:38 Ven left 12:40 kaare_ joined 12:43 Sysaxed joined 12:44 diana_olhovik left, diana_olhovik joined, skids left
Sysaxed I've just read this pypi.python.org/pypi/regex and found out that it kinda supports fuzzy matching (search for "fuzzy" on that page). Is there something like this in perl 6? 12:45
12:46 larion left, larion joined
moritz not built-in 12:47
DrForr_ Someone had a lot of time on their hands. 12:48
moritz and I think it would be pretty hard to do
since perl 6 regexes are much more geared towards parsing
though of course you can always write your own regex engine :-)
nine_ raydiak: it's not been my idea, but yes. 12:49
Sysaxed moritz: well, but why cannot it be speced first? The implementation will come some day, even if it takes 15 years, you know :) 12:51
12:52 larion left
Sysaxed not seeing any fuzziness in perl 6 sounds like there is a deeper reason behind it 12:52
moritz Sysaxed: some things are better done exactly :-)
Sysaxed: and some things are better prototyped/implemented first, and later specified 12:53
12:53 larion joined
moritz most of them, in fact 12:53
jnthn On the page, I only see it being applied to literals 12:54
oh no
Alternations of literals too
jnthn wonders exactly how it's implemented
Quite possibly do-able as a module, with sufficient amounts of cunning/evil :) 12:55
nwc10 shell out to one of these? :-) 12:58
en.wikipedia.org/wiki/Agrep
13:00 pecastro left
lizmat just hacked something together: gist.github.com/lizmat/c54a35f3002ff0eee070 13:02
the idea is that substr-fields gives you positional access to fields in a string
sort of like a substr-rw on steroids
13:02 Ven joined
lizmat comments / suggestions ? 13:02
should this live in core, or in a module ? 13:03
Ven "Videos are being processed at the moment. They are added here as they are approved." 13:04
(for fosdem)
13:07 anaeem1 left
DrForr_ Nothing for perl yet, but a few directories are getting populated. 13:08
13:09 kjs_ joined 13:10 pecastro joined
nine_ lizmat: can this be then aliased to an object property? So I could parse a config file into an object tree and instead of strings, the properties are substr-fields and I can transparently and non-destructively edit the original configuration through the object tree? 13:11
13:12 Ven left
lizmat if the configuration is a single string, and you can identify the necessary fields by offset / original length, then yes 13:13
no object tree involved, though
internally, it just splits out the parts that are not in a field
keeps them in a list, interspersed with the fields
you update a field, and the string is recreated by joining all elements of the list 13:14
the fixed parts are on even elements in the internal list
nine_ lizmat: Match objects to contain the start/end pos. So when making the object tree, instead of assigning the Match object's fields to object attributes, I could assign substr-fields.
lizmat the variable parts (fields) are on the odd elements of the list
sure, I guess that could be another candidate, that takes a Match object ? 13:15
jnthn lizmat: It's a cool idea; feels more module like to me 13:16
lizmat I've also considered making it named fields 13:17
but getting a Str to listen to postcircumfix{} is a bit more tricky :-) 13:18
Ovid__ A Pythonista who’s been working with Perl for 2 years wrote a blog post about Perl 6: ceronman.com/2015/02/23/perl-6-givi...the-other/
lizmat anyway, I put it out here so if anybody wants to run with it, that's fine by me :-)
13:20 Ven joined 13:27 Ven left
btyler re Ovid__'s link: ab5tract and I had pretty similar reactions to the context stuff. we're both pretty familiar with perl 5, and both excited about/have written some perl 6, and the context stuff bit us repeatedly in surprising ways over the course of ~6 hours of tandem p6 hacking 13:29
more than once somebody muttered "hopefully that just stops being so surprising after the GLR" 13:30
jnthn Well, the GLR simplifies flattening rules a good bit
Ovid__ I hope so. They mystify me (not that this is a hard thing to do) :) 13:31
nine_ +1 for simplifying flattening rules
jnthn Also Parcel and List get unified 13:32
13:32 laouji left
nine_ \o/ 13:32
btyler a lot of our surprise had to do with flattening (or not flattening) of things in sub signatures. we didn't really grok destructuring, so it was surprising when (for example) tossing some []s around a sub argument suddenly got us the flattening behavior we were expecting to receive based on the sigil
dalek kudo/cpp: 5057b18 | sergot++ | / (3 files):
add mangling tests
13:33
tadzik sergot++ 13:34
dalek c: 928c6c5 | paultcochrane++ | lib/Language/5to6.pod:
Purge trailing whitespace in 5to6.pod
13:35
c: 92d7bd5 | paultcochrane++ | lib/Language/5to6.pod:
Move :exists and :delete to new Data Structures section
c: 7aff36d | paultcochrane++ | lib/Language/5to6.pod:
Wrap overly-long lines to aid readability
13:39
FROGGS sergot++ 13:41
13:42 dj_goku left 13:43 _mg_ joined, Ven joined 13:44 _mg_ left 13:49 diana_olhovik left 13:50 diana_olhovik joined
Ven DrForr_, thanks 13:57
DrForr_ Nod. Being at least half responsible for the videos I have some interest in when they go up. 13:59
rjbs I should re-read what I read about the GLR. 14:00
To me, it looked like it didn't go far enough.
but I'm still a bit of an outsider
[Coke] anyone seen pmichaud? 14:05
rjbs I saw him three weeks ago. Does that help??
moritz [Coke]: last on Feb 21st 14:07
14:07 andreoss joined
[Coke] just tried to build nqp-js, got this error: 14:10
gist.github.com/coke/d1c3d4926d0159972381
looks like a bug in the moarvm build? 14:11
oh. Might have just stepped on my own toes. 14:12
jnthn ...wat...
[Coke] what are the odds that I would run the nqp.js build -while the cron job was running-
14:13 laouji joined
[Coke] so that's what the build fail looks like when you remove the entire build dir out from under yourself. :) 14:14
pmurias++ # nqp.js now included in the daily runs. 14:15
hoelzro: any idea why "make js-test" still has building left to do? 14:16
jnthn [Coke]: haha...and phew :)
[Coke] (did a "make -j all" before that, but "make js-test" is still building things.
14:17 laouji left 14:19 _mg_ joined 14:20 xfix joined, _mg_ left, _mg_ joined 14:22 Ven left
hoelzro [Coke]: I'm not really sure, but I've noticed that too 14:22
I just haven't been bugged by it enough to fix it =)
[Coke] well, it's now going to show up in the daily test output, if that matters> :) 14:25
hoelzro not to me! 14:26
14:27 Ven joined 14:28 _mg_ left
moritz [Coke]: don't use -j for nqp-js 14:30
[Coke]: I think its Makefile is still too immature for that
14:32 lizmat left, anaeem1_ joined 14:35 skids joined
[Coke] well, the 'make js-test' catches anything it missed. might be nice to leave it as a canary? 14:40
14:43 fhelmberger joined
timotimo o/ 14:44
14:44 lizmat joined
timotimo p6weekly.wordpress.com/2015/02/17/...omment-293 - someone found a nice little benchmark for us 14:44
timotimo looks into how <wb> is implemented 14:45
jnthn timotimo: May be worth timing it with just ".say" also 14:46
[Coke] or say ~$0 14:47
timotimo ah, to find out how slow we iterate over the file?
14:48 andreoss left
timotimo our -n implementation should possibly pass :eager to the lines() method? 14:52
timotimo is just checking out how much faster that ends up being
hm, except that may not at all be what the user wants 14:53
lizmat yeah... :-(
timotimo also, i was thinking we could perhaps do something quite like boyer-moore if we see something like \w**5
but that can also be bad for performance depending on the input data
so in order to be worth anything at all, that'd require some self-tuning code 14:54
lizmat have you tried \w\w\w\w\w to see whether that makes a difference
jnthn Well, it's not sinking properly, watching the memory use.
timotimo not yet
that's true also, jnthn
tadzik jnthn: you have a T430, right?
lizmat fwiw, I think we need to remember this one and visit post-GLR 14:55
dalek kudo/cpp: dd53c36 | sergot++ | / (3 files):
repair mangling tests and add one
jnthn tadzik: T430s
tadzik jnthn: okay. The funny symbols on F-keys, the lock, moon etc, what colour are they on yours? 14:56
jnthn Um, blue iirc
tadzik cos I just bought my 3rd replacement keyboard for T430, and each of them has different colour: first had blue, second had black, this new one has white
jnthn Oh!
tadzik I wonder how many more variants there are :D
jnthn :D
FROGGS time perl6 -n -e 'say $0 if m/(<!>)/' perl6-debug-p.c # real0m4.063s
time perl6 -n -e 'say $0 if m/(<<\w**5>>)/' perl6-debug-p.c # real0m4.528s
jnthn You've had to replace the keyboard?
tadzik yeah, I poured water over the one with black labels 14:57
muraiki does the latest rakudo include nativecall, or has that not yet gone into master? I looked at the release notes and didn't see mention of it
tadzik as for the first one, with blue.... have you seen the way I type? :D
FROGGS time perl6 -n -e 'say $0 if m/<!>/' perl6-debug-p.c # real0m2.971s
tadzik I wrecked the scissors in it
jnthn muraiki: Yes; it was mentioned in the announce 14:58
lizmat muraiki: the 2015.02 compiler release states:
+ The NativeCall module (for incorporating external libraries as Perl 6
subs) is now part of the compiler distribution. To activate it, one
must still do a "use NativeCall", but it does *not* have to be installed
with panda anymore. If you are a module developer, you can now remove
NativeCall as a prerequisite from the meta information of your distribution.
muraiki this announce? rakudo.org/2015/02/21/announce-raku...e-2015-02/
FROGGS muraiki: seems the compiler release states it but not the star release 14:59
muraiki oh, that explains things :)
moritz it intentionally doesn't
muraiki sorry, I should have checked that too
jnthn muraiki: Star always came with NativeCall anyway
moritz if you use star, you have NativeCall
timotimo masak: can you explain the "octopus mayor (?)" thing in that tweet you RT'd?
moritz and you don't have to care where it comes from
jnthn FROGGS: What's the difference between that last timing and the first one you posted? 15:00
tadzik IO::Socket::SSL still fails tests for me, hrm
FROGGS jnthn: it does not capture 15:01
masak timotimo: it's just a hilarious situation.
timotimo jnthn: i suppose it just shows that the iteration itself is taking the biggest chunk of time?
jnthn FROGGS: Ah
masak timotimo: the "octopus mayor" thing doesn't quite measure up to the first thing he wrote.
jnthn timotimo: Seems so 15:02
timotimo at first i thought it said /(<|>)/ because of my somewhat poor font and/or size and i was wondering "what the heck is that regex" %)
jnthn timotimo: I guess lines() will be a LoopIter after GLR
timotimo yeah
or maybe even use LinesAsync
so i just tested :eager vs no :eager 15:03
and the time difference is
FROGGS let's add that microbenchmark to pmichaud's ticket
timotimo m: say (152 + 5) / (162 + 6)
camelia rakudo-moar 546000: OUTPUT«0.934524␤»
timotimo 7%
the loop itself is just doing print "."
15:04 [Sno] left
lizmat wonder how much of the real time delay is caused by just printing... 15:05
timotimo lets the loop do nothing instead 15:06
this is a 50mb file, btw
jnthn lizmat: Well, at the moment say isn't the most efficient thing 15:08
lizmat: Though that's fixable.
15:09 larion left
timotimo yeah, the overhead say has seems to be pretty severe 15:14
with "1 + 1 for lines()" vs "1 + 1 for lines() :eager" i don't get a noticable difference at all 15:15
but now it takes only 117 seconds rather than 160
15:20 laouji joined 15:28 Ven left
dalek kudo/newio: 4659f32 | lizmat++ | t/04-nativecall/01-argless.c:
Fix compiler warnings on OS X / JVM backend
15:32
kudo/newio: 9b00cce | lizmat++ | /:
Merge branch 'nom' into newio
kudo/newio: 629f5a4 | TimToady++ | src/Perl6/Grammar.nqp:
bare say now complains about no valid arg

  (since it might be an invalid arg rather than a missing arg).
The help message for bare say et al. is demoted to a worry.
kudo/newio: f84e536 | TimToady++ | src/Perl6/World.nqp:
don't claim TTIAR if 2nd term failed to parse

It's just a bogus term if it can't parse it...
kudo/newio: 546000b | TimToady++ | src/Perl6/Grammar.nqp:
don't panic, just be sorry (on bare say etc.)

This allows the new bogus term message to show when appropriate.
kudo/newio: 6ea2a6f | lizmat++ | src/Perl6/ (2 files):
Merge branch 'nom' into newio
15:36 Ven joined
lizmat commute to NR.pm meeting& 15:39
15:39 lizmat left 15:43 FROGGS left 15:47 [Sno] joined 15:48 mr-foobar joined
dalek c: a646a74 | paultcochrane++ | lib/Type/IO.pod:
Link run, shell subs to non-internal location

This is because when viewing the per-routine file (e.g. run.html), the location of the "sub shell" link doesn't exist. By linking to the full location one is always able to reach the linked documentation.
15:49
15:56 Ven left 15:57 Ven joined 16:05 gfldex joined
[ptc] did spurt-ing to an open IO::Handle only become deprecated recently? 16:05
timotimo like three months ago or something? 16:06
maybe two
[ptc] it's just I'm getting deprecation warnings with (documented0 code which worked a couple of weeks ago
hrm
[ptc] wonders why he didn't see that before
timotimo: thanks. I'll update the docs where necessary
timotimo thank you, i'll find the appropriate commit in the mean time 16:07
* | | | | | | 9a6501a - Deprecate IO::Handle.spurt (5 months ago) <Elizabeth Mattijsen>
that should be it, right?
moritz when you have a handle, you can just .print to it, no? 16:08
[ptc] timotimo: that's weird! I tried out the code I documented (in IO.pod) and didn't get this warning until starting to work with it again today
moritz: that was going to be my next question :-) 16:09
I'm just really confused as to why I didn't see this before...
timotimo did you try it in the REPL perhaps? :)
[ptc] timotimo: that's probably it 16:10
do the warnings not appear in the REPL?
timotimo they appear when the program exits
[ptc] ah
timotimo we want them to not disturb programs that are running 16:11
16:11 FROGGS joined
PerlJam S32/IO:201 needs to be updated looks like 16:11
synopsebot Link: design.perl6.org/S32/IO.html#line_201
[ptc] moritz: should one .print to an IO::Handle, or .write to it? 16:12
moritz: I don't find .print in the IO::Handle docs
moritz [ptc]: .write would be for Blob/Buf, iirc 16:13
[ptc]: and .print for Str
16:13 Ven left, Ven joined
[ptc] moritz: k, thanks :-) 16:13
PerlJam oh, that's the spurt function, not the method. 16:14
16:15 Ven left 16:16 Ven joined
muraiki I'm trying to install Inline::Perl5 via panda, but when tests are run I repeatedly get: "Cannot locate native library '/usr/home/staff/muraiki/.panda-work/1424794724_2/blib/lib/Inline/p5helper.so'" 16:21
sorry if this isn't the right place to ask about this... but I figure it's related to nativecall?
16:21 laouji left
timotimo LibraryMake is supposed to compile that for you 16:22
muraiki hrm
timotimo maybe you lack a perl-dev package?
dalek c: ec25269 | paultcochrane++ | lib/ (2 files):
Replace spurt with print when writing to an IO::Handle
c: 2a0049a | paultcochrane++ | lib/Type/IO/ (2 files):
Mention print method in IO::Handle
16:25 lucas__ joined
lucas__ Hey there o/ 16:25
timotimo hi lucas 16:26
lucas__ So, a "my" declaration acts like the same thing as a subroutine signature, right?
timotimo you mean in terms of "unpacking" aka "destructuring"? 16:27
lucas__ I mean in terms of allows values in addition to variables, so that it can pattern match
Since signatures allow this, my declarations too:
m: my (True, False); say 'alive' 16:28
camelia rakudo-moar 546000: OUTPUT«alive␤»
muraiki timotimo: ah, looks like my p5 version is too old :(
lucas__ but using just one value instead of a list, it gives an error:
m: my (True) = 42; say 'alive'
camelia rakudo-moar 546000: OUTPUT«alive␤»
lucas__ m: my True = 42; say 'alive'
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5===␤Type 'True' is not declared␤at /tmp/PDaBLTD9D6:1␤------> 3my True 7⏏5= 42; say 'alive'␤Malformed my␤at /tmp/PDaBLTD9D6:1␤------> 3my True 7⏏5= 42; say 'alive'␤␤»
16:29 mjreed joined, prammer joined
lucas__ I've already brought this up some weeks ago 16:30
Is there any chances that things like this can become an error? 16:31
m: my (True $x, False $y, Inf, NaN) = 1,2,3; say 'alive'
camelia rakudo-moar 546000: OUTPUT«alive␤»
timotimo ouch
that's a bit weird
mjreed trying to destructure in a pointy block and getting an error; what am I doing wrong with the syntax? 16:32
m: [1,2,3].kv.grep(-> ([$k,$v]) { $v%2 })
camelia rakudo-moar 546000: OUTPUT«Unhandled exception: Too few positionals passed; expected 1 argument but got 0 in sub-signature␤ at <unknown>:1 (/home/camelia/rakudo-inst-1/languages/nqp/lib/Perl6/BOOTSTRAP.moarvm:bind_sig:4294967295)␤ from /tmp/MFsbXAn8Ku:1 (<ephemeral file>::12…»
16:34 zakharyas left
japhb m: [1,2,3].pairs.grep(-> (:$key, :$value) { $value%2 }) 16:35
camelia ( no output )
timotimo oh
japhb m: [1,2,3].pairs.grep(-> (:$key, :$value) { $value%2 }).say
camelia rakudo-moar 546000: OUTPUT«0 => 1 2 => 3␤»
timotimo it must be because grep doesn't know how many arguments to pass
japhb mjreed: ^^
skids Is that a bug, should grep sense arity? 16:36
mjreed should it need to?
timotimo grep is supposed to sense arity, like map and for and such
japhb skids: If it did, which argument would it return?
mjreed kv produces an array of pairs
skids japhb: both
mjreed so the block should get an array of two elements
I just want to pull them into separate vars
japhb skids: Are you sure that DWIMs?
timotimo so ... unexpected flattening? 16:37
skids Well, obviously the current way doesn't do anything useful.
japhb m: [1,2,3].kv.grep(-> ($key, $value) { $value%2 }).say
camelia rakudo-moar 546000: OUTPUT«Too few positionals passed; expected 2 arguments but got 0 in sub-signature␤ in block <unit> at /tmp/dHpkLXwDSG:1␤␤»
mjreed if grep sensed arity, then { -> $k, $v } would work. But I’m fine with having to destructure. I just need to know how to make that work. :)
japhb m: [1,2,3].kv.grep(-> $ ($key, $value) { $value%2 }).say
camelia rakudo-moar 546000: OUTPUT«Too few positionals passed; expected 2 arguments but got 0 in sub-signature␤ in block <unit> at /tmp/0CDE3sQPkg:1␤␤»
japhb m: [1,2,3].kv.grep(-> $key, $value { $value%2 }).say 16:38
camelia rakudo-moar 546000: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤ in block <unit> at /tmp/FudGXhudM0:1␤␤»
japhb Hmmm
skids mjreed: the .kv produces a list of k,v,k,v so grep is run once on each k and once on each v
mjreed oh, kv flattens
japhb mjreed: Yes
mjreed ?
skids So to destructure you need to use .pairs.
mjreed doens’t look like it 16:39
flussence m: [1,2,3].pairs.grep(-> :(:$key, :$value) { $value%2 }).say #?
camelia rakudo-moar 546000: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in block <unit> at /tmp/bSj4w3w4Ng:1␤␤»
japhb ... which is what I showed at the top
mjreed m: [1,2,3].kv[0]
camelia ( no output )
mjreed 0 1
japhb m: [1,2,3].kv[0].say
camelia rakudo-moar 546000: OUTPUT«0 1␤»
japhb m: [1,2,3].kv[2].say
camelia rakudo-moar 546000: OUTPUT«2 3␤»
PerlJam mjreed: the error you got was probably from grep running off the end of your list 16:40
japhb That's ... not what I expected
timotimo .kv is a way to get the value that you've calculated inside the [ ] back
japhb m: {a => 12, b => 42}.kv.perl.say 16:41
camelia rakudo-moar 546000: OUTPUT«("a", 12, "b", 42).list␤»
japhb m: [1,2,3].kv.perl.say
camelia rakudo-moar 546000: OUTPUT«((0, 1), (1, 2), (2, 3)).list␤»
japhb OK, that's just confusing
skids OK so it must be grep that's flatenning?
mjreed my understanding is that .kv produces ( [k,v], [k,v], [k,v] ) as an array, while .pairs produces ( k => v, k => v, k => v ) as a hash.
timotimo not as a hash 16:42
[Coke] rakudo moar and moar-jit failing differently.
(in daily spectest run)
flussence m: [7,4,9,1].pairs.grep(-> (:$key, :$value) { $value%2 }).say # looks correct to me
camelia rakudo-moar 546000: OUTPUT«0 => 7 2 => 9 3 => 1␤»
dalek rl6-roast-data: ad86ae6 | coke++ | / (9 files):
today (automated commit)
japhb I always saw .kv as producing (k, v, k, v), but clearly Array.kv disagrees 16:43
But whatever it does, it really ought to produce the same structure for both Associative and Positional objects
16:44 diana_olhovik left
mjreed m: (*.kv, *.pairs).map( { [1,2,3].$_.WHAT.say } ) 16:45
camelia rakudo-moar 546000: OUTPUT«(List)␤(List)␤»
mjreed m: (*.kv, *.pairs).map( { [1,2,3].$_[0].WHAT.say } )
camelia rakudo-moar 546000: OUTPUT«(Parcel)␤(Pair)␤»
mjreed anyway, ran across this while trying to solve this more general problem: what’s the perl6ish way to find the indexes of all array elements matching a condition? 16:48
PerlJam mjreed: grep-index?
mjreed oh. 16:49
well, that’s far too easy.
TimToady grep-index may go away in favor of grep with a :k modifier 16:50
PerlJam (though, personally, I don't like any of the *-index routines)
[ptc] moritz: have analysed how many lines of documentation have been added to the doc repo over time: roughly 10000 lines since this time last year!
moritz: the trend is also exponential :-)
PerlJam TimToady: I assume the same for first, last, and map? 16:51
timotimo TimToady: that'd also mean we coul dhave a :kv and :pairs modifiers
TimToady probably not map
PerlJam (yeah, maybe the hobgolbin of foolish consistency got me there :) 16:52
TimToady: when we get user-defined indices, will grep :k give the user-defined indices or the "real" indices? (and how would you specify which you want?) 16:56
(or is that post 6.0 enough to not think too much about yet) 16:57
TimToady for arrays that take both [] and {}, it could well depend on which of those you choose
that doesn't help grep
it's also not entirely clear which way the user would want as default 16:58
16:58 Ven left
PerlJam I would guess that if the user went through the trouble to create their own indices, they did so because they want to use them "by default" 17:00
TimToady that's my gut feel too, but it's also still possible that user-defined indices are more trouble than they'll be worth 17:01
PerlJam (i.e. it helps in thinking about the problem domain in terms of itself)
TimToady we'll have to prototype 'em after we get the S
and they can be post 6.0 if we're not sure 17:02
17:02 perl6_newbee joined
timotimo the S? 17:05
TimToady of NSA
timotimo ah 17:06
of course
raydiak strings? :)
TimToady shapes 17:08
there's a problem with our declarative syntax for user-defined indices though 17:09
it only works at the top level of @foo{@keys}
what if you want your second-level of @foo[3,*] to have user-defined keys? 17:10
we'll have to ponder that
jnthn wonders if user-defined keys really need to be in 6.0
TimToady we do have the notion of @foo[3]{@keys}, but that would only make a hash, not an array with hash aliases
we just said that :) 17:11
PerlJam jnthn: I don't think they do.
TimToady just don't want to mess up our declarative syntax in advance
jnthn Good point. :)
I'm focusing on the N for now. Then will likely focus on NFG. Then come to the S :) 17:12
PerlJam Right now, I get a general feeling similar to P5's $[ or BASIC's option base ... it seems like a good feature until you start to use it :)
jnthn By the way, the answer to "does the order of codepoints matter" has an interesting answer.
Order of combining ones, that is.
The Unicode spec actually defines a sorting algo. 17:13
TimToady you sure that's not just for collation?
'cause certainly within certain categories, order will matter for stacking 17:14
jnthn It's described in the normalization docs.
For how is NFC formed
www.unicode.org/reports/tr15/tr15-4...quivalence 17:15
leont What's the name of the principle of putting the most important bits of a line at the start (in code or prose)?
TimToady end-weight is close to right
except the "heavy" end is kinda wrong 17:16
I don't think we have a name for that one really
PerlJam TimToady: "perspective" :) 17:17
flussence call it "semantic centre of gravity" if you want to sound smart
TimToady Important Words First--Argh!
"I have to tell you who the murderer is...<bang>" 17:18
(courtesy of Connie Willis)
japhb
.oO( "This isn't that kind of movie." )
TimToady as opposed to "Steve done it! <bang>"
17:19 Kristien joined, _mg_ joined
TimToady or we could think of it as marginalization of the less important stuff to the right 17:19
Kristien hi 17:20
TimToady \o
17:21 lizmat joined 17:22 laouji joined
Kristien What do you think of significant newlines? 17:22
PerlJam Kristien: you just want to elide some trailing semicolons? 17:23
Kristien For example. 17:24
PerlJam sounds like we lose a synchronization point
(or there's just more guessing involved)
timotimo a synchronization point many "modern" languages have decided against, fwiw 17:25
i haven't forgotten a semicolon in a loooong time, though
Kristien I guess the argument is similar as the one for significant indentation: you do it anyway (newlines and indents).
17:26 _mg_ left
Kristien I've been thinking of an alternative to S-expressions which depends on significant newlines. 17:26
A superset.
17:26 laouji left
TimToady
.oO(now you have two problems)
17:27
PerlJam timotimo: many modern languages don't have or require the moral equivalent to "my" either :)
TimToady human languages need redundancy
a language without redundancy forces the user to think like a computer 17:28
17:28 raiph joined
timotimo hehe 17:28
TimToady some people don't mind thinking like computers, of course
Kristien my introduces a declaration, which is good.
PerlJam yeah, but it also has to balance against DRY. Language design is a fiddly business.
TimToady so you make the repetitive bits Very Short 17:29
like "my"
or {}
or ;
Kristien As much as possible must be specified in code, including parameter and return types, preconditions, postconditions and throwable exceptions.
huf eh, my isnt repetitive or something you do _for_ the compiler
TimToady that's why I don't like begin/end
timotimo Actually the difference between those two is that the “list assignment” version of = has looser precedence that the comma operator, while the “scalar assignment” version of = has tighter precedence than the comma operator.
i don't understand this -^
TimToady when I first saw C, I said to meself, "They get these lovely tiny begin and end brackets, and then they ruin it all by making them *optional* on single statements?" 17:30
which is why they're not optional on if/else in Perl 17:31
huf TimToady: but they'd need an elseif keyword then!
if the {} were mandatory
17:31 _mg_ joined
TimToady not really 17:31
but I'm glad we never made them optional, because it's the () that wanted to be optional all along
huf what, you'd put a space in the middle of a keyword?
PerlJam TimToady: amen!
huf yeah, they already had ?: if you wanted to drop the {} :) 17:32
Kristien huf just like SQL! 17:34
huf sorry, i cant just like sql 17:35
timotimo i can't. just like sql. 17:36
TimToady timotimo: the difference in precedence is mainly so you can say loop (my $i = 1, my $j = 'a'; $i; $i++, $j++) {}
alpha- sql is good
Kristien Go solves that problem by defining else clause as: 'else' <compound-stmt> | 'else' <if-stmt>
huf alpha-: sql is pretty neat yeah, except for the language :)
Kristien Although I find else–if incredibly ugly (conditions don't line up), and I want cond/switch true instead.
alpha- huf I love writing sql
so much I won't ever touch any ORM stuff 17:37
Kristien SQL is shit. You need coalesce everywhere you use sum, because sum returns null instead of 0 for the empty sum.
TimToady some designers don't understand the need for well-behaved degenerate cases... 17:38
Kristien Introducing arbitrary special cases is a bad idea.
PerlJam Kristien: that's what Date and Codd said about NULL :)
Kristien I've seen people return null instead of the empty array for functions like fetchAllProducts() when there are no products :(
TimToady they don't think of it as special, they think of it as nobody in their right mind would do that, so make it illegal
timotimo fair enough, i guess
17:40 rurban left
raydiak m: my @list = 1, my $scalar = 2, 3; say $scalar; say @list # precedence of = vs = 17:40
camelia rakudo-moar 546000: OUTPUT«2␤1 2 3␤»
xfix Kristien: You would think that it's because aggregates in SQL work like that, but...
SELECT count(*) FROM empty_table; -- returns 0, properly
Like, I don't understand why aggregates other than count cannot do this properly.
But I guess the idea was that if there are no elements, then there is no data. 17:41
TimToady well, nobody expects consistency from a committee, or if they do, they shouldn't...
lizmat let's put that to a vote :-)
17:42 amaliapomian joined
xfix In SQL, NULL means "unknown". It has confusing name, but SQL uses it pretty consistently. 17:43
Kristien SQL shouldn't have null. It should've had an option type constructor. 17:44
mjreed Hasql
Kristien And it should have been much more modeled like set theory and relational algebra.
xfix I may agree here, because NULL introduces open world assumption into closed world assumption.
Kristien aggregates can just be functions that take bags and return values 17:45
and you could call them like sum(map(user => age(user.birthday), users)) 17:46
17:46 kjs_ left
Kristien that's the kind of SQL I'd like 17:46
xfix Although, compared to alternatives, SQL is not bad. It does what it meant to do.
Kristien (lol, summing the age of all users) 17:47
17:48 adu joined
xfix SELECT sum(age) FROM users WHERE favorite_language = 'Perl 7' -- we don't know... uhm... return NULL? 17:48
I guess this is sort of insanity that convinced them that aggregates of nothing should return NULL.
Kristien even in PHP array_sum([]) returns 0 :P 17:50
xfix Even if it doesn't make sense. If you work under open world assumption, you may as well return NULL everytime, because you don't have enough data.
17:52 lucas__ left
TimToady maybe we should talk about lists as natural, flat, or sharp 17:53
a natural list is what any method gets as its invocant after GLR
17:54 grettir joined
TimToady functions can decide what kind of list they get 17:54
and we need to do a better job of explaining why context is lazy, unlike in Perl 5 17:55
.oO( but I'm too lazy to explain now :)
17:56
perl6_newbee hi guys 17:58
sorry for silly newbee questions: But why are the variadic parameter shown at the end of the USAGE message? Bug? 17:59
Usage: pdms.p6 [--file=<Str>] [--category=<Str>] [--tags=<Str>] [--date=<Str>] add
mjreed so what would constitute a ♭ or ♯ list? 18:00
18:01 dakkar left 18:02 Quom is now known as Mouq 18:04 _mg_ left
Sysaxed TimToady: Hi! I have asked this question a bit earlier today, but got something like "nah it's too hard" as an answer. Have you thought about fuzziness in perl 6 rules? There is something like that in python "regex" module, so it shouldn't be too hard, I guess. I'm just curious if there are any other fundamental reasons not to have fuzziness 18:06
jnthn perl6_newbee: I think it's by design rather than a bug
PerlJam
.oO( bug by design? )
18:07
perl6_newbee lol
jnthn PerlJam: Possibly :P
perl6_newbee I don't like the design :-) and hoped it wis a bug
Sysaxed TimToady: the python thing I am talking about is here pypi.python.org/pypi/regex
jnthn Better put: I think Rakudo implements the current design correctly in this regard. I also know folks wanting to do subcommand-y interfaces find this a pain. 18:08
18:08 fernand__ joined 18:10 virtualsue left
PerlJam Sysaxed: That seems an odd fit for regex to me (as part of the language proper). But we *can* execute arbitrary perl code, so the fuzzy match could happen there if needed. 18:10
timotimo hoelzro has been working on a module named "subcommander" 18:12
hoelzro needs to finish that module
hell, /me needs to pick one thing to help with and stick with it.
18:12 fernand__ left
skids Something akin to "partial" match feature listed at that URL is also something I'd like to see in an rx enhancement module. For parsing un-tab-completed cli input where you know the tab-completion rules (e.g. cisco config snippets) 18:13
18:14 kjs_ joined 18:16 diana_olhovik_ joined 18:19 locsmif left, mjreed left 18:20 raiph left
TimToady -> pick up his 90yo mom from ferry to show off her great-grandkid 18:22
colomon TimToady++
dalek ast/newio: caf44a2 | lizmat++ | S32-io/chdir.t:
Get chdir() test up to (newio) spec
18:23 laouji joined 18:28 laouji left, Rounin joined
Kristien can't bear children :v 18:29
18:29 wicope left, Kristien left 18:32 wicope joined 18:38 larion joined 18:39 jluis joined
Mouq moritz++ # lots of stuff 18:44
18:48 geekosaur left 18:50 geekosaur joined 18:52 mohij joined, telex left 18:54 telex joined 18:58 dolmen joined 18:59 espadrine left 19:00 perl6_newbee left 19:13 echowuhao joined 19:18 _mg_ joined 19:23 ilbot3 left, ilbot3 joined 19:28 dwarring joined 19:29 xfix_ joined, xfix left, xfix_ is now known as xfix 19:31 colomon left 19:32 pecastro left, rurban joined, dolmen left, espadrine joined 19:35 Sir_Ragnarok left, Kristien joined
Kristien hi there 19:36
raydiak hello
Kristien I have yet to find a Freenode channel with people as kind as the ones in this one. 19:37
<3 19:38
19:38 Sir_Ragnarok joined
raydiak #perl6++ :) 19:39
moritz updated www.openhub.net/p/p6doc a bit 19:41
Kristien people in #scala and #clojure tend to be muh functional 31337zor :[ 19:43
moritz: nice
moritz Kristien: I've heard good things about the Haskell community too
Kristien I know nothing about it. :P
19:46 colomon joined
timotimo trolling people on #haskell seems to have no side-effects 19:48
19:48 __zug__ joined
Sysaxed :)) 19:49
timotimo SCNR
Kristien timotimo: I have a solution for that
19:50 Pleiades` left
jnthn
.oO( You can safely complain on #haskell under a moanad... )
19:50
Kristien id $! unsafePerformIO troll 19:51
unsafePerformIO is impure!
raydiak if only more dev communities understood the value of humanity...attitude in #perl was one of my primary motivations for coming to #perl6 and adopting Perl 6...if that isn't shooting yourself in the foot, idk what is :) 19:52
vendethiel #perl6++ :P
Kristien that's a comment 19:53
the increment is ignored
vendethiel nope, in this land, identifiers are allowed to contain pounds
IT'S PERL6, WHACHUGONNADO :P.
Kristien that's sharp
vendethiel
.oO( not scream, to start with )
19:54
19:55 Pleiades` joined 19:57 raiph joined
moritz in #perl6, nobody can hear you SCREAM 19:58
timotimo in #perl6 nobody can hear you MONKEY_TYPING 20:04
Kristien fun fact: in Scala, List(1, 2, 3).toSet() returns false 20:06
20:07 diana_olhovik_ left
Kristien Since .toSet is a parameterless method, this is actually parsed as (List(1, 2, 3).toSet).apply(()) 20:09
where () is the instance of Unit, and apply on a Set[T] returns whether the set contains the argument (hence false)
since () is a different type than Int, the set is upcast to Set[Any] and then the element is looked up, that’s why it’s not a type error
s/()/Unit/ 20:10
hobbs joy? 20:11
Kristien It's a nice thing to confuse newcomers with. :) 20:13
geekosaur scala's scary
vendethiel *g* 20:14
dalek c: 559c22c | moritz++ | CONTRIBUTING.md:
start file CONTRIBUTING.md

inpired by #51
20:15
20:15 kjs_ left
vendethiel Kristien: auto-tupling is terrible :)= 20:17
Kristien vendethiel: fun fact: in Scala, { for (Seq(x, y, z) <- xs) yield x + y + z } and { xs map { case Seq(x, y, z) => x + y + z } } can have different results, even though for uses map internally. :)
vendethiel flatMap
isn't it?
Kristien for ignores match errors, but map doesn't, so the former skips Seqs that aren't of length 3 and the second one will throw a match error 20:18
20:20 echowuhao left
vendethiel Kristien: through typelevel/Scala fixed that :) 20:20
japhb .tell perl6_newbee I implemented (the first version of) the MAIN parser and USAGE generator, as close as I could manage to spec at the time. I am also one of the people that thinks we really should natively support subcommand interfaces, since I think that's actually what people expect now. I was overruled. 20:21
yoleaux japhb: I'll pass your message to perl6_newbee.
20:22 virtualsue joined 20:26 darutoko left 20:27 bjz left
Kristien m: sub singleton($x) } 20:27
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5=== Error while compiling /tmp/JfjiRvW7hq␤Missing block␤at /tmp/JfjiRvW7hq:1␤------> 3sub singleton($x) 7⏏5}␤ expecting any of:␤ new name to be defined␤»
Kristien stupid keyboard
20:27 fhelmberger left
vendethiel *g* .oO( always blame the keyboard ) 20:27
Kristien m: sub singleton($x) { my \U = $x.WHAT; subset T of U where * === $x } 20:28
camelia rakudo-moar 546000: OUTPUT«===SORRY!===␤No compile-time value for U␤»
Kristien :(
vendethiel Kristien: :( 20:29
subsets are BEGIN-time
Kristien can you create them dynamically? 20:30
vendethiel m: sub singleton($x) { my \U = $x.WHAT; my \T = subset of U where * === $x }
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5=== Error while compiling /tmp/0_974imfBW␤Two terms in a row␤at /tmp/0_974imfBW:1␤------> 3x) { my \U = $x.WHAT; my \T = subset of 7⏏5U where * === $x }␤ expecting any of:␤ postfix␤ infix stopper␤ …»
vendethiel m: sub singleton($x) { my \U = $x.WHAT; my $sig = :(U where * === $x); } 20:31
camelia rakudo-moar 546000: OUTPUT«===SORRY!===␤No compile-time value for U␤»
vendethiel uhm.
20:31 _mg_ left
jnthn Probably using Metamodel::SubsetHOW somehow. 20:31
20:34 kjs_ joined
jnthn hoelzro: ping 20:41
hoelzro jnthn: pong 20:42
jnthn hoelzro: Was it you who worked a lot on the declarator-attaching leading/trailing doc stuff?
Or am I mis-remembering? 20:43
hoelzro no, you're correct
that was me
jnthn OK, cool
hoelzro what'd I break?
=P
jnthn Well, it's more that I'm breaking something... :P
Previously, we've constructed signature objects after we've parsed the whole body of a routine/method/block 20:44
That isn't working too well over in the land of native-ref, where it's really helpful to know as we build AST if we're looking at readonly native lexical or a rw one.
So, I've started switching over to constructing sig objects and sorting out all the param info ahead of parsing the block 20:45
hoelzro ah ha
jnthn I've changed it for routine_def already, and all is well...except I now fail a load of POD decl doc tests.
And then I see a bunch of %*PARAM_INFO<dummy> :) 20:46
And start wondering if that was a needed "hack" because our timing was off before...
hoelzro iirc, I think so
jnthn OK
hoelzro I believe params were the biggest pain when it came to S26 20:47
jnthn Is this something you'd have any interest at all in looking into at some point in the next week or so? ;)
I don't mind fixing it if you'll not have time/interest.
hoelzro I can try, but I'll have to get up to speed on the native ref stuff 20:48
jnthn But figure you may be able to figure it out faster than me :)
Well, the refactors related to where we make sig objects are fairly decoupled from the rest of the work.
So you don't need to grok native refs especially. :) 20:49
It's just that the timing of when we build sig objects has moved earlier.
hoelzro ok, cool
I'll see if I can take a look tonight
jnthn OK, cool. native-ref branch in rakudo/rakudo already shows it 20:50
hoelzro I'll let you know if I can and if I find something
jnthn *but* I only updated stuff for routine_def
I'm working on method_def and pblock at the moment
hoelzro I believe that methods/subs were more sane in their implementation
jnthn But if you look at it before I'm done changing those it may be a case of "fix it for routines, bust it for methods"
20:51 amaliapomian left
hoelzro jnthn: I probably won't be able to look at it until at least 00:00 your time 20:53
(assuming it's about 22:00 there)
jnthn hoelzro: I might have broken parameters on methods and pblocks by then :)
But really no hurry; this branch won't be ready to merge for a week or so yet on other issues.
Not least that it currently represents a serious performance regression.
hoelzro do I have to clone a special copy of nqp/moar to build rakudo for this? or will --gen-moar be fine? 20:54
jnthn Moar, no.
Just master
Then native-ref branches of NQP and Rakudo.
hoelzro ah, ok
jnthn Normal repos, jsut different branches.
hoelzro understood
20:55 jluis left
jnthn hoelzro++ 20:55
(For those reading and worrying about the perf reg: it's nothing to be concerned about, simply that the way certain things are code-gen'd has changed and optimizers/JIT haven't caught up yet; I'll get there pre-merge) 20:56
masak m: sub bar($a, $b) {}; bar(1) 21:02
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Sk1tdf3xOC␤Calling 'bar' will never work with argument types (int)␤ Expected: :(Any $a, Any $b)␤at /tmp/Sk1tdf3xOC:1␤------> 3sub bar($a, $b) {}; 7⏏5bar(1)␤»
masak m: sub bar($a, $b) {}; my $x = 1; bar($x)
camelia rakudo-moar 546000: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤ in sub bar at /tmp/NiNrvboWqB:1␤ in block <unit> at /tmp/NiNrvboWqB:1␤␤»
masak why is the first a compile-time error and the second a runtime error?
PerlJam at a guess, because 1 is a compile-time constant and $x isn't. 21:03
jnthn What PerlJam said, basically.
vendethiel no
jnthn The errors fall out of inlining efforts.
vendethiel it's about the number of arguments here
Kristien because the flattening semantics are so complicated even the compiler doesn't understand them
vendethiel Kristien: calls arguments aren't flattened :)
call*
jnthn And the inlining stuff cares a bunch about types.
masak is there any situation where `bar($x)` can mean anything other than "pass one argument"?
FROGGS really hates IIS
jnthn No
It's not that we can't catch that one at compile time 21:04
It's simply that we catch them as a side-effect of optimization, and in this case we're apparently not trying to optimize.
Kristien ew
jnthn The promise is "runtime at latest, compile time preferable" 21:05
vendethiel *g*
masak right.
so it's not a *bug* in the sense that it's failing to do something we promised...
jnthn Correct, but it's disappointing still. :)
masak it's more of an LTA because it's a case where we could be more awesome, but aren't at present.
masak submits LTA rakudobug :) 21:06
jnthn Key thing to understand here is that the static inliner laregly exists to make sure we generate nice code for native operators.
PerlJam masak++ (I was just about to encourage you to do that :)
jnthn Anything beyond that is, so far, as bonus.
Again, we'll get better at it. 21:07
And yes, I'm fine with an LTA ticket.
21:07 echowuhao joined
jnthn May even look at it soonish, as I need to pay a visit to the optimizer while dealing with native refs. 21:07
masak \o/ 21:08
21:09 kjs_ left
masak I think the architecture we have is great, so don't take this the wrong way: we shouldn't be limited by an argument such as "there's no compile-time error here about this impossible situation, because we're not attempting to inline it" 21:09
jnthn True, though we shouldn't duplicately implement tricky logic either 21:11
I think the place we're doing the analysis is right, but we probably shouldn't give up trying so easily 21:12
masak ok, fairy nuff.
21:14 rindolf left
masak rt.perl.org/Ticket/Display.html?id=123919 21:16
21:18 xfix left, dolmen joined
raydiak m: say Capture ~~ Positional|Associative # Why? 21:26
camelia rakudo-moar 546000: OUTPUT«False␤»
masak good question. 21:27
if you can index into it, it probably should be.
raydiak I'd ask why you even can without an error, but I figured it was autovivification-related 21:28
21:30 kjs_ joined
raydiak seems you can index most anything and it turns into a 1-elem list if it doesn't do something else instead...so it just works as-is because it defines a .list and .hash I guess 21:36
21:36 dolmen left
raydiak m: my $a = class{}.new; say $a{}.perl; say $a[].perl; 21:36
camelia rakudo-moar 546000: OUTPUT«<anon>.new()␤(<anon>.new(),).list␤»
raydiak that first one is cute :)
dalek pan style="color: #395be5">perl6-examples: e3395b5 | paultcochrane++ | bin/run-examples.pl:
Search for .p6 files as well as .pl
21:37
pan style="color: #395be5">perl6-examples: e302aa2 | paultcochrane++ | bin/run-examples.pl:
Ignore games/ dir since they are interactive
pan style="color: #395be5">perl6-examples: cf8595c | paultcochrane++ | games/connect4.p6:
Make games/connect4.p6 work again

A few hacks to work around lack of certain features in the past could be removed such that the game now works again as expected.
kudo/native-ref: 830108d | jnthn++ | src/Perl6/ (2 files):
Move invocant adding into sig-object builder.

A small step to prepare for lifting signature creation for method-ish things earlier.
kudo/native-ref: 7b41e74 | jnthn++ | src/Perl6/Actions.nqp:
Lift signature creation out of methodize_block.
mohij Hey! I'm just starting to write my first serious pl6 program, a parser. During parsing I'd like to save some state to reuse later on in the parser. I'd like to have that state *not* survive backtracking (i.e. I'd like the state to revert to its previous state when backtracking over the action that created/modfied it). Is there a canonical way of doing something like that? 21:39
dalek c: 1091feb | paultcochrane++ | lib/Language/io.pod:
Mention IO::Handle.say() as alternative to .print
21:40
c: 1ae7413 | paultcochrane++ | CONTRIBUTING.md:
Merge branch 'master' of github.com:perl6/doc
c: ad48c53 | paultcochrane++ | CONTRIBUTING.md:
Correct minor typos
kudo/native-ref: 4dd6ccb | jnthn++ | src/Perl6/ (2 files):
Build method signature before parsing body.

This means we also code-gen native lexical readonly parameters better and get errors at compile time for trying to assign to them.
kudo/native-ref: 304300f | jnthn++ | src/Perl6/Grammar.nqp:
Tweak routine_def for consistency with method_def.
jnthn mohij: In the Perl 6 grammar we use dynamically scoped variables for those kinds of cases
I suspect there there may be smaller examples in some module somewhere, though I can't think of one off-hand. Maybe someone else here has a handy example. :) 21:42
dalek kudo-star-daily: 3cc1541 | coke++ | log/ (11 files):
today (automated commit)
lizmat commute home& 21:43
21:43 lizmat left
masak mohij, jnthn: module example: strangelyconsistent.org/blog/parsin...ented-text 21:43
dalek kudo-star-daily: 04ebc4c | coke++ | bin/star.sh:
Suspend running parrot backend
21:44
raydiak I'll just "[BUG] attempting to index into objects without defined postcircumfixes doesn't fail" if nobody else chimes in eventually 21:45
mohij jnthn: Thank you! That looks like what I need.
hoelzro raydiak: ah, that behavior bugs me too 21:46
raydiak hoelzro: so it's known? is it reported? is it even a bug?
hoelzro iirc, it's intended behavior 21:47
hoelzro looks through logs for when he reported it
raydiak :/
mohij wait, masak that was your link, so kudos to you (too) :-)
masak enjoy :) 21:49
hoelzro raydiak: irclog.perlgeek.de/perl6/2014-12-18#i_9825061
raydiak hoelzro: thanks :)
hoelzro np
raydiak m: class Foo {}; my $foo = Foo.new; say $foo{}.perl; 21:51
camelia rakudo-moar 546000: OUTPUT«Foo.new()␤»
raydiak that is just weird 21:52
hoelzro raydiak: I agree
raydiak also weird that {} returns a single scalar, while [] returns a single-element list
m: class Foo {}; my $foo = Foo.new; say $foo{}.perl; say $foo[].perl; 21:53
camelia rakudo-moar 546000: OUTPUT«Foo.new()␤(Foo.new(),).list␤»
21:53 dolmen joined
raydiak m: class Foo {}; my $foo = Foo.new; say $foo[].elems; say $foo{}.elems; 21:54
camelia rakudo-moar 546000: OUTPUT«1␤1␤»
raydiak m: class Foo {}; my $foo = Foo.new; say $foo.hash
camelia rakudo-moar 546000: OUTPUT«Odd number of elements found where hash initializer expected␤ in method STORE at src/gen/m-CORE.setting:11138␤ in method hash at src/gen/m-CORE.setting:1656␤ in block <unit> at /tmp/184BvGebSo:1␤␤»
21:55 kjs_ left
dalek kudo/native-ref: 9276140 | jnthn++ | src/Perl6/ (2 files):
Bring pblock signature building before body parse.

Means that -> int $x { $x = 42 } is now also a compile-time error, and native lexical access code-gen is better for pointy block args also.
21:56
vendethiel jnthn++ 21:58
dalek kudo/cpp: 5bc251b | FROGGS++ | t/04-nativecall/13-cpp-mangling. (2 files):
add tests about mangling of typed pointers
FROGGS ohh, nice
21:59 anaeem1_ left 22:00 laouji joined 22:02 [Sno] left 22:05 laouji left
masak 'night, #perl6 22:08
dalek kudo/cpp: 15f8a05 | FROGGS++ | / (2 files):
handle and test Bool as argument to C++ subs
raydiak good night masak 22:10
22:14 geekosaur left 22:15 geekosaur joined
vendethiel 'night :) 22:15
22:15 skids left
FROGGS lol, void __cdecl abc<def<int>,void*>::xyz(void); is mangled in VC++ as: ?xyz@?$abc@V?$def@H@@PAX@@YAXXZ 22:17
vendethiel nice.
FROGGS yeah :o)
en.wikipedia.org/wiki/Visual_C%2B%2...e_mangling 22:18
a nice guide
I hope I can get the basics done by the end of the week
some of the mangled codes look like klingon: $Jx'y'z $Qa 22:22
22:22 Rounin left
geekosaur that might explain a few things... 22:23
Kristien sometimes mangled names are more readable than C++ declarations: stackoverflow.com/a/6755760/1804599
geekosaur exactly 22:24
Kristien doesn't make C++ any less awesome :D
FROGGS :D 22:25
ohh, I got a lot to read: mentorembedded.github.io/cxx-abi/abi.html#vtable 22:29
22:31 kjs_ joined, saurabh joined
Kristien don't do C++ ABI interop 22:31
saurabh Hi 22:32
Kristien it will break
22:32 saurabh is now known as Guest18648
FROGGS Kristien: the valuable information for me there are the rules about when a vtable pointer is present 22:32
Guest18648 Hello there, I want to contribute to perl 6 developement, Am I at the right place ??
FROGGS so I can autodetect that, and get the struct size right 22:33
Guest18648: you are
Kristien FROGGS: note that there can be multiple vptrs
jercos Guest18648: close as they come :)
Kristien in case of multiple inheritance
FROGGS Guest18648: welcome
Guest18648 Thank You!
How to get started? I can write perl 5 modules. :P
FROGGS Kristien: yes, though we do not support that for CStructs/CPPStruct atm 22:34
Kristien Guest18648: use v5; :D
Guest18648 Any suggetions ??
FROGGS Guest18648: you could try to port a module over :o)
Guest18648 Allright.
FROGGS Guest18648: that's a good way to get your hands dirty
Kristien FROGGS: you also have to be careful about the unspecified order in case of access specifiers
field order in memory 22:35
FROGGS Kristien: of attributes?
Kristien struct t { int a; int b; } // b will follow a in memory, guaranteed
FROGGS aye
Kristien struct t { int a; private: int b; } // no such guarantee
FROGGS aha
that's a problem 22:36
Kristien I'd go the lazy and safe way and query libclang for all the details, although it has no stable API.
22:36 rurban left
FROGGS but, that has to wait :o) 22:36
perhaps
gnight :o)
Kristien goodbye
C++ is immensely complicated. You have to be careful with lots of stuff regarding multiple inheritance, public/private, __attribute__((packed)), bitfields, alignas(T), etc… 22:37
Guest18648 yes 22:38
I don't get it, How can i chat with so many people at once.
How to reply...
Kristien I'm in eight parallel chat sessions. 22:39
Guest18648 Are you a bot? :P
Kristien no :P
FROGGS: also have fun with union members! 22:40
Guest18648 Help me, How to start: just give me a hint , I will follow.
raydiak Guest18648: other than learning Perl 6, doc.perl6.org/language/modules contains most of what you need to know to author modules 22:41
Guest18648 Should I get Rakudo ?
jnthn Yes 22:42
raydiak well, yes
Guest18648 okay, I will get started.
Ulti also pick a nickname so when you come back we know it's you ;P
Guest18648 allright..
Ulti /nick yourname 22:43
^type that without the leading space
Guest18648 ^saurabh
Kristien lol
Ulti wow
vendethiel well.
ashleydev and when you are in a conversation with someone while other people are chatting you often preface your coments with "<nickname>: ..."
Kristien let's try the hunter2 test on them
jnthn Guest18648: Try /nick saurabh
Kristien: Be nice. :P 22:44
22:44 wicope left
Guest18648 It's okay 22:44
Ulti saurabh the chat understands commands that start with a /
22:44 Vlavv_ left
Kristien technically it depends on the IRC client 22:44
vendethiel sigh. 22:45
it doesn't, really.
jnthn hoelzro: So, I did the pblock and method_def switch-over, and of course busted more leading/trailing decl Pod tests too. ;) But at least things should be consistently broken now and so consistently fixable.
hoelzro jnthn: thanks for the heads-up. I'll probably just start from the first break, try to fix it, and see if I can apply the fix to other breakages 22:46
jnthn hoelzro: *nod*
Guest18648 I tried [backslash]nick __NickName__ , Didn't work.
22:47 dolmen left, Guest18648 left
jnthn hoelzro: Though I suspect it's broken quite consistently, such that there'll be a neat fix (maybe a simplification) for the lot. 22:47
22:47 kjs_ left
hoelzro that would be nice =) 22:47
vendethiel Guest83546: it's slash, not backslash 22:48
jnthn hoelzro: Bonus points if the <dummy> thing goes away :)
Kristien lol, Go documentation: "Given a set of identifiers, an identifier is called unique if it is different from every other in the set."
22:48 tgt joined
hoelzro I'll do what I can =) 22:48
Kristien But sets contain only unique elements!
vendethiel hence they're all uniques
jnthn I'm president of the tautology club!
vendethiel
.oO( it's like a meet-lattice !)
22:49 [Sno] joined
vendethiel (actually not. sorry) 22:50
rjbs Please fact-check me: 22:51
It's: sub xyz ($x) is cached { ... } --and not-- sub xyz is cached ($xyz) { .. }
hoelzro m: sub f($x) is cached { say "here for $x"; return $x } ; f(1); f(2) 22:52
camelia rakudo-moar 546000: OUTPUT«here for 1␤here for 2␤»
hoelzro m: sub f($x) is cached { say "here for $x"; return $x } ; f(1); f(1)
camelia rakudo-moar 546000: OUTPUT«here for 1␤»
hoelzro rjbs: looks sane to me!
22:52 tgt left
rjbs m: sub f is cache ($x) { say "here for $x"; return $x } ; f(1) 22:52
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TaJFHFz38y␤Missing block␤at /tmp/TaJFHFz38y:1␤------> 3sub f is cache 7⏏5($x) { say "here for $x"; return $x } ; ␤ expecting any of:␤ new name to be defined␤»
rjbs m: sub f is cached ($x) { say "here for $x"; return $x } ; f(1)
camelia rakudo-moar 546000: OUTPUT«5===SORRY!5=== Error while compiling /tmp/oYwVambI4r␤Missing block␤at /tmp/oYwVambI4r:1␤------> 3sub f is cached 7⏏5($x) { say "here for $x"; return $x } ; ␤ expecting any of:␤ new name to be defined␤» 22:53
rjbs Thanks.
(This is relevant to a current p5p thread.)
22:56 Vlavv_ joined
hoelzro happy to help! 22:57
rjbs specifically, www.nntp.perl.org/group/perl.perl5....26103.html 23:03
Once I'm back on wall power, I will build rakudo anew!
raydiak is it intentional that an EXPORT sub inside a package/module/class/etc doesn't work? 23:08
23:08 jbotz joined
jbotz hello 23:09
jnthn raydiak: Yes; the importer looks for it as a lexical in UNIT
jbotz just tried to upgrade to latest rakudo using rakudobrew and it broke...
Unhandled exception: While looking for 'ModuleLoader.moarvm': no such file or directory 23:10
at <unknown>:1 (src/vm/moar/stage0/nqp.moarvm:<dependencies+deserialize>:6)
Makefile:218: recipe for target 'gen/moar/stage1/nqpmo.moarvm' failed
raydiak jnthn: thank you...I see the part I was missing in S11 now 23:11
jnthn jbotz: First time I've seen this reported; any chance you can nopaste/gist the full build log? 23:12
23:13 adu left, kjs_ joined
jbotz how to 'nopaste'..? 23:13
23:15 espadrine left
jbotz nopasted: nopaste.linux-dev.org/?443276. 23:15
jnthn jbotz: Not sure what's going on; I'm not especially familiar with rakudobrew. But the uninitialized var warnings near the top look suspect... 23:18
As does the "no --prefix supplied"
raydiak noticed same warnings yesterday 23:19
jbotz raydiak: but did your build fail?
23:20 kjs_ left
raydiak jbotz: no 23:20
now that I look, even just "rakudobrew build" (no 2nd arg) gives me the same warnings, and dies with an error before printing the suggestion list 23:23
dalek ast: 9dd8a31 | jnthn++ | S06-traits/native-is-rw.t:
Add test file for native is rw parameters.
23:25
kudo/native-ref: bea708f | jnthn++ | src/ (2 files):
Typed exception for assigning to ro native param.
23:26
kudo/native-ref: b576197 | jnthn++ | t/spectest.data:
Run S06-traits/native-is-rw.t.
23:28 gfldex left 23:29 dolmen joined
jnthn Enough for today...should have a good Perl 6 tuit supply tomorrow :) 23:29
o/
raydiak \o jnthn 23:31
23:35 larion left 23:36 adu joined
Kristien is gonna fork Python and actually implement from __future__ import braces. 23:43
23:44 virtualsue left
jbotz jnthn, raydiak: did "rakudobrew build moar 2015.02" instead of just "rakudobrew build moar" and it worked. 23:48
so I guess whatever broke is in the head ;-)
raydiak heh :) 23:49
23:50 laouji joined 23:53 Alina-malina left, Alina-malina joined 23:54 laouji left 23:55 mohij left