»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
AlexDaniel .tell Skarsnik Hi! I am parsing ≈6000 html files with Gumbo. Although I only store just a couple of tiny bits (Str-s) I am still running out of memory after around 822 files (16Gb RAM). I'm pretty sure that it is not me and something else is leaking this memory. Could be something in Gumbo or could be something in Perl6. Do you have any idea? 01:14
yoleaux AlexDaniel: I'll pass your message to Skarsnik.
arnsholt AlexDaniel: If it's a NativeCall wrapper, the library wrapper probably leaks memory due to hacks and general shenanigans in the NativeCall implementation 01:44
AlexDaniel arnsholt: that sounds horrible 01:45
I'm so disappointed with that script actually
first I got into 「hyper」 problems
arnsholt That's because it is kinda terrible, yeah =/
I perpetrated some of said hacks originally. Kinda regretting taking it in that direction, in hindsight
AlexDaniel then double free or corruption thingy when using just 「start」 blocks 01:46
so all disappointed I dropped everything and went with a simple algorithm that does things in serial without that parallel magic
arnsholt I've never worked on the concurrency stuff, so *probably* not my fault in those cases =)
AlexDaniel and now it eats 16 gb memory 1/10 way through…
I should probably get more memory… 01:47
160 gb should probably work 01:48
AlexDaniel cries in the corner
arnsholt Yeah, that memory leak is really annoying. Unfortunately it's tricky to fix as it's probably best fixed by a non-trivial redesign of bits of NativeCall
Well, you can always just split the job into pieces
100 files at a time or whatever 01:49
AlexDaniel arnsholt: and now you're saying that it will be fixed after a *redesign*. I'll go hang myself, this script is never going to be done…
yeah, I've thought about that. Yes, that will complicate everything but it will work
arnsholt If you really do need the data from all 6000 files in memory at the same time, write one script to dump the data from each file to JSON or whatever and another to read in the mess of JSON and do the processing 01:50
It's a bit messy, but that's generally how things get done =) 01:51
Also, it's a kind of approach that you can't avoid in truly large-scale scenarios
AlexDaniel arnsholt: Yes, I know, it is possible to make it work. But it's not as simple because these are not just 6000 files, I'm building a rather deep structure (hash in array in hash etc…) out of 1-2 strings from each page 01:52
arnsholt Should be dumpable to JSON, no? Then you don't have to do any nasty serializing and parsing logic on your own 01:53
Just use one of the JSON modules to handle it
AlexDaniel yeah, that's what I'm building in the end. JSON. 01:54
arnsholt: I'm just unhappy because currently it is a simple 100 line script which *should* work. Sure enough I can split it in a hunder of 1-line script so that the memory is cleaner correctly, but… 01:55
hundred*
scripts* 01:56
cleaned* geez
arnsholt: I'm also unhappy because e.g. I can't find a way to report “double free or corruption” thingy 01:57
arnsholt: I've seen it several times, it happens after a while if you're using a couple of 「start」 blocks. But I cannot narrow it down to something reportable
.tell Skarsnik you may also read this: irclog.perlgeek.de/perl6/2016-02-14#i_12037219 who knows, maybe you're the right person to fix this :) 01:58
yoleaux AlexDaniel: I'll pass your message to Skarsnik.
AlexDaniel arnsholt: and I don't think that a 100-line script that parses 800 files an crashes after 1+ hours is a good candidate for a script that could be attached to the bug report. 02:00
perlawhirl hi perlers 02:48
just wonderin about the best way to check if a word contains a particular diacritic, eg a GRAVE 02:49
my $word = 'papà'; say so $word.comb.grep( *.uniname.contains('GRAVE') );
m: my $word = 'papà'; say so $word.comb.grep( *.uniname.contains('GRAVE') ); 02:50
camelia rakudo-moar 97eafa: OUTPUT«True␤»
perlawhirl so that's what i came up with... any other suggestions
m: my $word = 'papà'; say $word.comb».uniname.contains('GRAVE'); 02:51
camelia rakudo-moar 97eafa: OUTPUT«True␤»
perlawhirl that's a little nicer i guess 02:53
AlexDaniel perlawhirl: hold on 03:04
geekosaur m: my $word = 'papà'; say so $word ~~ /<:name(/GRAVE/)>/; 03:05
camelia rakudo-moar 97eafa: OUTPUT«True␤»
AlexDaniel m: .say for ‘à’.NFD».chr».Str».uniname
camelia rakudo-moar 97eafa: OUTPUT«LATIN SMALL LETTER A␤COMBINING GRAVE ACCENT␤»
AlexDaniel m: .say for ‘à’.NFD».chr».uniname
camelia rakudo-moar 97eafa: OUTPUT«LATIN SMALL LETTER A␤COMBINING GRAVE ACCENT␤»
geekosaur m: my $word = 'papà'; say so $word.NFD ~~ /\x0300/; 03:06
camelia rakudo-moar 97eafa: OUTPUT«False␤»
geekosaur whoops 03:06
AlexDaniel m: .say for ‘à’.NFD».chr».uniprop
camelia rakudo-moar 97eafa: OUTPUT«Ll␤Mn␤»
AlexDaniel perlawhirl: perhaps you might want to look at Mn prop after getting your string in NFD form
AlexDaniel m: say [~] (0..0x1FFFF ==> grep { .uniprop eq ‘Mn’ })».chr 03:07
camelia rakudo-moar 97eafa: OUTPUT«…»
AlexDaniel m: say ‘a’ ~ [~] (0..0x1FFFF ==> grep { .uniprop eq ‘Mn’ })».chr 03:08
camelia rakudo-moar 97eafa: OUTPUT«…»
AlexDaniel camelia: honestly I have no idea why you can't print that
flussence m: say (0..0x1FFFF ==> grep { .uniprop eq ‘Mn’ }).elems 03:13
camelia rakudo-moar 97eafa: OUTPUT«1327␤» 03:14
perlawhirl AlexDaniel: i like your fist one. i knew there'd be a nice and short way using smartmatch 03:15
petercommand m: say <1 2 3>
camelia rakudo-moar 97eafa: OUTPUT«(1 2 3)␤»
perlawhirl m: my $word = 'papà'; say so $word ~~ /<:name(/GRAVE/)>/;
camelia rakudo-moar 97eafa: OUTPUT«True␤»
geekosaur I think you meant mine
petercommand m: say <<1 2> 2 3>
camelia rakudo-moar 97eafa: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6zNeEhivrf␤Unable to parse expression in shell-quote words; couldn't find final '>>' ␤at /tmp/6zNeEhivrf:1␤------> 3say <<1 2> 2 3>7⏏5<EOL>␤ expecting any of:␤ argument list␤ …»
perlawhirl oh
sorry geekosaur
it was you :D
AlexDaniel xD
petercommand m: say < <1 2> 2 3>
camelia rakudo-moar 97eafa: OUTPUT«Value of type List uselessly passed to val() in block <unit> at /tmp/X2DdUDIfjO line 1␤(<1 2> 2 3)␤»
petercommand at first i thought i can do nested list using this syntax, but turns out i can't 03:16
AlexDaniel perlawhirl: just keep in mind that if you're looking for GRAVE then you basically get all these:
m: say [~] (0..0x1FFFF ==> grep { .uniname ~~ /GRAVE/ })».chr
camelia rakudo-moar 97eafa: OUTPUT«`ÀÈÌÒÙàèìòùǛǜǸǹȀȁȄȅȈȉȌȍȐȑȔȕˋˎ˴˵̖̀̏̀ЀЍѐѝѶѷ॓ᐠ᷀᷅᷆᷈᷉ḔḕṐṑẀẁẦầẰằỀềỒồỜờỪừỲỳ⛼`𛲂𛲃𛲒𛲓␤»
geekosaur petercommand, < > quotes the insie, so embdded < > are no longer special 03:17
AlexDaniel perlawhirl: which, for exmple, contains HEADSTONE GRAVEYARD SYMBOL
perlawhirl AlexDaniel: all good... not actually solving anything for myself. i saw a perl question on SO, and was just thinking to myself how much easier these sorts of things are in perl6
AlexDaniel .u HEADSTONE GRAVEYARD SYMBOL
yoleaux U+26FC HEADSTONE GRAVEYARD SYMBOL [So] (⛼)
geekosaur yeh, I was thinking that it might want spaces
m: my $word = 'papà'; say so $word ~~ /<:name(/ GRAVE /)>/; 03:18
camelia rakudo-moar 97eafa: OUTPUT«True␤»
geekosaur although that could potentially lose too, come to think of it
AlexDaniel m: my $word = 'pap⛼'; say so $word ~~ /<:name(/ GRAVE /)>/;
camelia rakudo-moar 97eafa: OUTPUT«True␤»
geekosaur m: say [~] (0..0x1FFFF ==> grep { .uniname ~~ /GRAVE$/ })».chr
camelia rakudo-moar 97eafa: OUTPUT«ÀÈÌÒÙàèìòùǛǜǸǹȀȁȄȅȈȉȌȍȐȑȔȕЀЍѐѝᐠ᷆᷈ḔḕṐṑẀẁẦầẰằỀềỒồỜờỪừỲỳ𛲂𛲃𛲒𛲓␤»
geekosaur m: say [~] (0..0x1FFFF ==> grep { .uniname ~~ /GRAVE$$/ })».chr 03:19
camelia rakudo-moar 97eafa: OUTPUT«ÀÈÌÒÙàèìòùǛǜǸǹȀȁȄȅȈȉȌȍȐȑȔȕЀЍѐѝᐠ᷆᷈ḔḕṐṑẀẁẦầẰằỀềỒồỜờỪừỲỳ𛲂𛲃𛲒𛲓␤»
geekosaur sigh
AlexDaniel $ was ok :)
geekosaur doin it wrong
sortiz \o #perl6 03:19
yoleaux 13 Feb 2016 11:46Z <lizmat> sortiz: the || suggestion gives a tiny slowdown in my benchmarks, so I didn't apply that
perlawhirl m: say [~] (0..0x1FFFF ==> grep { .uniname ~~ /<< GRAVE >>/ })».chr
camelia rakudo-moar 97eafa: OUTPUT«`ÀÈÌÒÙàèìòùǛǜǸǹȀȁȄȅȈȉȌȍȐȑȔȕˋˎ˴˵̖̀̏̀ЀЍѐѝѶѷ॓ᐠ᷀᷅᷆᷈᷉ḔḕṐṑẀẁẦầẰằỀềỒồỜờỪừỲỳ`𛲂𛲃𛲒𛲓␤»
AlexDaniel .u Ǹ 03:20
yoleaux U+01F8 LATIN CAPITAL LETTER N WITH GRAVE [Lu] (Ǹ)
perlawhirl .u ˎ
yoleaux U+02CE MODIFIER LETTER LOW GRAVE ACCENT [Lm] (ˎ)
geekosaur oh, it does end with it
AlexDaniel perlawhirl: perhaps if you want to get just letters than you have to look for Lu property + GRAVE
then* 03:21
that being said, I still think that NFD is the only accurate solution
perlawhirl sometime like... $word ~~ /<:name(/ <:Lu> .+ GRAVE$ /)>/; 03:22
should work for most things
m: my $word = 'teˎst'; say $word ~~ /<:name(/ <:Lu> .+ GRAVE$ /)>/;
camelia rakudo-moar 97eafa: OUTPUT«Nil␤»
perlawhirl goodo 03:23
m: my $word = 'papà'; say $word ~~ /<:name(/ <:Lu> .+ GRAVE$ /)>/;
camelia rakudo-moar 97eafa: OUTPUT«「à」␤»
AlexDaniel perlawhirl: why would you want to do that, by the way? 03:24
I mean, what's the reason why this question was asked?
perlawhirl oh like i said... just thinking about the problem cause i saw a perl5 question on so. 03:25
if you're interested: stackoverflow.com/questions/3537555...-diacritic
sortiz .tell lizmat I was assuming that less bytecode implies less opcodes so better times, That worries me, I need to make a deeper analysis.
yoleaux sortiz: I'll pass your message to lizmat.
perlawhirl after i tried a few things and failed i was thinking, geez this is so much easier in perl6
and then was just wondering about the best way to actually do it in perl6 03:26
to be clear... i don't really have a problem i'm looking to solve... just thinking out loud :D 03:27
geekosaur m: my $word = 'papx̀'; say $word ~~ /<:name(/ <:Lu> .+ GRAVE$ /)>/;
camelia rakudo-moar 97eafa: OUTPUT«Nil␤»
geekosaur didn't think so
perlawhirl geekosaur: yep, already tested that it also doesn't pick up 'ˎ' 03:28
.u ˎ
yoleaux U+02CE MODIFIER LETTER LOW GRAVE ACCENT [Lm] (ˎ)
perlawhirl m: my $word = 'teˎst'; say so $word ~~ /<:name(/ <:Lu> .+ GRAVE$ /)>/; 03:29
camelia rakudo-moar 97eafa: OUTPUT«False␤»
perlawhirl which is what you would want if you were trying to solve this issue
AlexDaniel perlawhirl: oh, the answer to this question is really simple 03:30
if only I could make Uni act like a list… 03:33
ah, lit
「list」
m: say so ‘àầằèềḕìǹòồṑùǜừẁỳ’.NFD.list.grep: 768
camelia rakudo-moar 97eafa: OUTPUT«True␤»
AlexDaniel perlawhirl: ↑ that's it
after NFD that grave will end up being COMBINING GRAVE ACCENT 03:34
so just search for it and that's it
it also has a nice effect of finding real COMBINING GRAVE ACCENT (which is good!) 03:35
perlawhirl that's cool 03:38
petercommand what does the * mean in something like *@var? 03:55
is there any doc i can refer to? 04:00
sortiz petercommand, search for Slurpy Parameters in doc.perl6.org/type/Signature 04:01
AlexDaniel Hotkeys: my@h – that's something :D
geekosaur design.perl6.org/S06.html#List_parameters 04:02
Hotkeys heh
who needs whitespace
not this guy
the only one you can't do it with is the \ sigil
petercommand sortiz: thx! 04:03
geekosaur: :D
thanks, geekosaur
b2gills m: say ("abàầằèềḕìǹòồṑùǜừẁỳy" ~~ m:g/(.) <?{ $0.Str.NFD.any == "\c[COMBINING GRAVE ACCENT]".ord }>/)».Str 04:14
camelia rakudo-moar 97eafa: OUTPUT«(à ầ ằ è ề ḕ ì ǹ ò ồ ṑ ù ǜ ừ ẁ ỳ)␤»
Herby_ Evening, everyone! 05:07
Herby_ m: "Skyfall" ~~ /Sky 'fall'?/; 05:10
camelia ( no output )
sortiz good * Herby_
Herby_ \o
m: say "Skyfall" ~~ /Sky 'fall'?/;
camelia rakudo-moar 97eafa: OUTPUT«「Skyfall」␤»
Herby_ m: say "Sky" ~~ /Sky 'fall'?/;
camelia rakudo-moar 97eafa: OUTPUT«「Sky」␤»
Herby_ flipping through the "Perl 6 Modules 'Want List'" 05:11
to see if there are any I can tackle
exciting Saturday night, I know. 05:14
m: say "Skyfalling" ~~ /Sky 'fall'?/; 05:17
camelia rakudo-moar 97eafa: OUTPUT«「Skyfall」␤»
Herby_ m: say "Skyfalling" ~~ /Sky 'fall'?>>/;
camelia rakudo-moar 97eafa: OUTPUT«Nil␤»
sortiz .seen hoelzro 05:33
yoleaux I saw hoelzro 12 Feb 2016 21:05Z in #perl6: <hoelzro> I was going to say "2215?! Perl 6 really *is* a one-hundred year language!"
sortiz .ask hoelzro Reading your changes for multi-line, in nqp, why is $more-code-sentinel outside of the class, more over, why not an attribute? 05:41
yoleaux sortiz: I'll pass your message to hoelzro.
sortiz .tell hoelzro Seems to me that other exceptions to catch are those produced by HLL::Grammar.FAILGOAL, method that I suppose can be overridden too. 06:40
yoleaux sortiz: I'll pass your message to hoelzro.
nine Good morning! 08:29
yoleaux 13 Feb 2016 16:51Z <jnthn> nine: I don't know that we need to do anything; a pass with some passing TODO'd tests is still a perfectly fine pass.
nine .tell jnthn well our test harness counts test files with passing TODOs as failed. Seems like a good thing for the master tests but not for 6.c. 08:30
yoleaux nine: I'll pass your message to jnthn.
masak morning, nine 08:43
nine Looks like we already fail 15 6.c tests :/ 09:10
masak wow, how did that happen? 09:12
nine I guess people just don't run the 6.c tests before committing 09:15
dalek kudo/nom: 66628aa | (Stefan Seifert)++ | src/core/CompUnit/Repository (3 files):
CompUnit::Repository::resolve

New method to ask the repository chain if a module matching the given DependencySpecification is available. This could for example be used by panda to avoid trying to install an already installed module.
09:24
kudo/nom: 062e7aa | (Stefan Seifert)++ | src/core/CompUnit/ (3 files):
Centralize more precompilation code
kudo/nom: d71f42f | (Stefan Seifert)++ | src/core/CompUnit/Repository/Installation.pm:
CompUnit::Repository::Installation::uninstall
kudo/nom: 8ca26ce | (Stefan Seifert)++ | src/core/CompUnit/Repository/Installation.pm:
Fixes for installing from outside a dists directory

Use the stable names instead of local file paths when generating file ids. This way those ids no longer depend on the current working directory. Previously we used the path like "./lib/Foo.pm6" for generating the id and would end up with a different id if installing the file by using e.g. "modules/Foo/lib/Foo.pm6".
Only affects newly installed dists.
dalek kudo/nom: 123c7aa | moritz++ | src/core/Seq.pm:
Fix RT #127492

  .perl of an already iterated Seq died instead of producing
a string that, when EVAL()ed, produces a Seq that has been iterated.
10:06
ast: 760dbe8 | moritz++ | S32-list/seq.t:
RT #127492: .perl on a consumed Seq
dalek osystem: 9d0a2a7 | jamesneko++ | META.list:
Add Dice::Roller to ecosystem

RPG-style dice string rolling tool: github.com/jamesneko/dice-roller
10:25
osystem: 0e483b4 | azawawi++ | META.list:
Merge pull request #154 from jamesneko/patch-1

Add Dice::Roller to ecosystem
pmurias nine: it seems that we need the proposed tracking of the 6.c passing master 10:31
nine pmurias: definitely. Without appropriate tooling, this is doomed to fail. 10:32
uruwi Hello, short question. 10:51
uruwi Is there any way to make parsing with grammars treat whitespace as significant? 10:54
If you're asking why I'd do that: this project is for fun.
masak uruwi: using `rule` instead of `regex` or `token` in a grammar will make whitespace significant. 10:58
uruwi: but I'm not 100% sure that's what you're asking about.
here, let me provide an example.
m: grammar G { token TOP { foo bar } }; say ?G.parse("foobar"); say ?G.parse("foo bar") 10:59
camelia rakudo-moar 123c7a: OUTPUT«Potential difficulties:␤ Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤ at /tmp/Tx3QcXc0QZ:1␤ ------> 3grammar G { token TOP { foo…»
masak heh :)
m: grammar G { rule TOP { foo bar } }; say ?G.parse("foobar"); say ?G.parse("foo bar")
camelia rakudo-moar 123c7a: OUTPUT«False␤True␤»
uruwi m: grammar G {rule TOP { <a>* }; rule a { 0 | 1 | 2 } }; say G.parse("012012"); 11:00
camelia rakudo-moar 123c7a: OUTPUT«Nil␤»
uruwi ^ this is what I mean
m: grammar G { regex TOP { <a>* }; token a { 0 | 1 | 2 } }; say G.parse("012012"); 11:01
camelia rakudo-moar 123c7a: OUTPUT«「012012」␤ a => 「0」␤ a => 「1」␤ a => 「2」␤ a => 「0」␤ a => 「1」␤ a => 「2」␤»
uruwi m: grammar G { rule TOP { <a>* }; token a { 0 | 1 | 2 } }; say G.parse("012012");
camelia rakudo-moar 123c7a: OUTPUT«「012012」␤ a => 「0」␤ a => 「1」␤ a => 「2」␤ a => 「0」␤ a => 「1」␤ a => 「2」␤»
uruwi m: grammar G { rule TOP { <a>* }; rule a { 0 | 1 | 2 } }; say G.parse("012012");
camelia rakudo-moar 123c7a: OUTPUT«Nil␤»
uruwi m: grammar G { rule TOP { <a>* }; regex a { 0 | 1 | 2 } }; say G.parse("012012"); 11:02
camelia rakudo-moar 123c7a: OUTPUT«「012012」␤ a => 「0」␤ a => 「1」␤ a => 「2」␤ a => 「0」␤ a => 「1」␤ a => 「2」␤»
uruwi Is there any performance benefit to using rule instead of regex?
Or is the only difference the treatment of whitespace? 11:03
Oh wait, rule doesn't backtrack
So it's more similar to token in that regard.
masak yes, rule is token + sigspace 11:04
uruwi Thanks anyway! 11:07
[Tux] test 22.139 11:08
test-t 12.083
csv-parser 50.672
masak [Tux]++ # relentless marking of bench 11:09
RabidGravy going back down again 11:17
RabidGravy it definitely seems there is a limit around the 12ish 11:19
still struggling to find a nice example of Audio::Liquidsoap without any dependencies
uruwi Is anyone else having trouble with deep nesting levels in grammars? 12:10
masak could you be more specific? 12:11
I'm pretty sure I've nested hundreds of levels in some of my parses. once you get going, it's hard to stop.
uruwi More specifically, parsing operator precedences.
masak that's not specific enough :) 12:12
uruwi Each level I add doubles the time needed for parsing. 12:13
I'm seeing if I can replace instances of "regex" with "token" instead.
masak yes, sounds like you need to eliminate some rampant backtracking there 12:14
there's a rule of thumb: the more mature and scaled-up the language, the less backtracking should be required
uruwi Mature in terms of? 12:15
pmurias do we want to have both the line and the column (instead of just the line in exception backtraces)? 12:16
masak uruwi: mature in terms of the purposes it's meant to be put to. a full-fledged programming language is likely to (want to) be mature and have little backtracking. 12:18
uruwi: a constraint-satisfaction puzzle is likely to want to make use of a lot of backtracking.
pmurias: I usually like both, yes. 12:19
with the caveat that they point to the right place :) something Perl 5 does quite well, and other languages generally less well
pmurias erlang for a long time didn't display either and still managed to be the cool new thing 12:26
;)
masak LTA error messages are the norm, I fear. 12:28
pmurias masak: internally we are using the file positions, it's only when translated for displaying that info gets lost 12:35
pmurias should "is native(LIB)" be now turned into "is native(LIB, VERSION)" 12:44
?
RabidGravy pmurias, LIB can be a list 12:45
uruwi Fortunately, all that time seems to be spent at the start 12:46
RabidGravy so you can just change LIB to be "my constant LIB = ( 'somelib', v0.1)
pmurias when using Readline I get a note that I should consider adding a version
sortiz Can I assume that in a Lock protected block no other thread can't touch the memory of a Blob, nor reallocate it? 13:28
pmurias masak: it's an interesting question how the awesomeness of minor things influences language adoption/fun of use compared to the big things (speed/library support) 13:31
vendethiel o/, #perl6
pmurias vendethiel: hi 13:34
partly Hi 13:34
I can not figure out how to say List<Int> in perl6
partly I read the Containers documentation, 13:35
partly Or is this not possible in perl6? 13:35
timotimo m: my Int @foo = 1, 2, 3, 4; say @foo 13:37
camelia rakudo-moar 123c7a: OUTPUT«[1 2 3 4]␤»
timotimo m: say Array[Int].new(1, 2, 3, 4, 5) 13:38
camelia rakudo-moar 123c7a: OUTPUT«[1 2 3 4 5]␤»
pmurias do we want the column from HLL::Compiler.line_and_column_of to be 0-indexed or 1-indexed? 13:42
partly if i put Array[Int] @haystack in my function signature i get an error 13:43
RabidGravy yes
you are asking for an Array of Arrays of Ints
I guess you mean Int @haystack 13:44
partly if i do Int @haystack in function signature and give it an array of ints, i get the error: expected Positional[Int] but got Array
timotimo yeah, type constraints are nominal in perl6 13:46
you need to actually Array[Int].new(...) or my Int @array ...
just because you write [1, 2, 3, 4], you don't get an Array[Int] 13:47
RabidGravy If you really must do something like that then you want something like:
m: 'sub foo(Array[Int] $a) { say $a }; my Int @b = (^10); foo(@b)
camelia rakudo-moar 123c7a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/s5jxR2Jjwt␤Unable to parse expression in single quotes; couldn't find final "'" ␤at /tmp/s5jxR2Jjwt:1␤------> 3) { say $a }; my Int @b = (^10); foo(@b)7⏏5<EOL>␤ expecting any of:␤ sing…»
partly timotimo: well i would be happy if i could say: here should be something listy which contains ints
RabidGravy m: sub foo(Array[Int] $a) { say $a }; my Int @b = (^10); foo(@b)
camelia rakudo-moar 123c7a: OUTPUT«[0 1 2 3 4 5 6 7 8 9]␤»
partly ok, i see how this makes sense, but this makes no sense to normal human beeing 13:48
timotimo m: sub test(@arr where *.all ~~ Int) { say "yay" }; test([1, 2, 3, 4])
camelia rakudo-moar 123c7a: OUTPUT«Constraint type check failed for parameter '@arr'␤ in sub test at /tmp/I4q299kjEZ line 1␤ in block <unit> at /tmp/I4q299kjEZ line 1␤␤»
timotimo ah, yes
partly i mean yeah, by using Array[Int] $haystack i get an array while @haystack is positional, but this is weird 13:49
timotimo m: sub test(@arr where *.>>isa(Int).all) { say "yay" }; test([1, 2, 3, 4])
camelia rakudo-moar 123c7a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6i6CVNZKbj␤Missing dot on method call␤at /tmp/6i6CVNZKbj:1␤------> 3sub test(@arr where *.>>7⏏5isa(Int).all) { say "yay" }; test([1, 2,␤ expecting any of:␤ postfix␤»
timotimo m: sub test(@arr where *>>.isa(Int).all) { say "yay" }; test([1, 2, 3, 4])
camelia rakudo-moar 123c7a: OUTPUT«yay␤»
timotimo m: sub test(@arr where *>>.isa(Int).all) { say "yay" }; test([1, 2, 3, 4, "hey"])
camelia rakudo-moar 123c7a: OUTPUT«Constraint type check failed for parameter '@arr'␤ in sub test at /tmp/H8LAYaGqKv line 1␤ in block <unit> at /tmp/H8LAYaGqKv line 1␤␤»
partly ahh nice 13:50
timotimo: thank you, this will do
but just out of curiosity, if use Array[Int] $haystack, later in the function @haystack.elems breaks, because it has the wrong sigil, how would i convert it to a @var ? 13:51
timotimo i find that question hard to answer, because ... what do you expect that to do? 13:52
jnthn You'd normally just write Int @haystack, so you don't couple to the exact implementation type being passed.
yoleaux 08:30Z <nine> jnthn: well our test harness counts test files with passing TODOs as failed. Seems like a good thing for the master tests but not for 6.c.
timotimo you can use the binding operator (:=) to do that
RabidGravy or
jnthn .tell nine Then we should fix our test harness to not do that.
yoleaux jnthn: I'll pass your message to nine.
RabidGravy m: sub foo(Array[Int] $a) { my @a = $a.list; say @a }; my Int @b = (^10); foo(@b)
camelia rakudo-moar 123c7a: OUTPUT«[0 1 2 3 4 5 6 7 8 9]␤»
RabidGravy or any other squillion methods 13:53
jnthn RabidGravy: That works, but also makes a copy.
RabidGravy indeed
partly ahh so i have a reference, which i make by using := or .list method on it back to something listy, right? 13:54
jnthn I find it funny that people start out saying "how do I List<int> in Perl 6", presumably with a C++/Java/C# background given the use of that syntax, then get surprised when they are expected to make the types match on either side - just as C++/Java/C# would make them do. :)
RabidGravy but yeah, so
m: sub foo(Int @a ) { say @a }; my Int @b = [^10]; foo(@b) # just works
camelia rakudo-moar 123c7a: OUTPUT«[0 1 2 3 4 5 6 7 8 9]␤»
RabidGravy so I'm really not sure what the problem is here 13:54
partly m: sub foo(Int @a) { say @a }; foo([1,2,3]) 13:55
camelia rakudo-moar 123c7a: OUTPUT«Type check failed in binding @a; expected Positional[Int] but got Array␤ in sub foo at /tmp/6gQRWjqIuH line 1␤ in block <unit> at /tmp/6gQRWjqIuH line 1␤␤»
partly does not work
jnthn partly: Yes because you did not type the thing you are passing
RabidGravy you can't have it both ways 13:56
partly [] == is not always an array?
or list? or whatever?
jnthn partly: It's always an *untyped* array.
partly ahh!
sortiz m: my Array[Int] $foo .= new(1,2,3,4,5); say $foo.elems; sub f(@a) { say @a.elems }; f(@$foo);
camelia rakudo-moar 123c7a: OUTPUT«5␤5␤»
jnthn m: sub foo(Int @a) { say @a }; foo(my Int @ = 1,2,3) 13:57
camelia rakudo-moar 123c7a: OUTPUT«[1 2 3]␤»
partly i think i understand now my issue. so i misunderstood []
RabidGravy m: sub foo(Int @a) { say @a }; foo([1,2,3] but Positional[Int]) ; # just do demonstrate 13:58
camelia rakudo-moar 123c7a: OUTPUT«[1 2 3]␤»
partly thank you all for your patience
jnthn RabidGravy: That's...naughty :)
RabidGravy it's all about the naughty here
jnthn wonders if we need a better write-up of typed arrays and stuff in the docs somewhere... :) 13:59
partly jnthn: yes please
masak partly: Perl 6's type system is nominal. in practice that means that it's not enough for an array to contain only Ints in order to match `Int @array`, it actually has to be declared as an Array[Int]. "nominal", as in "by name", as in you have to declare that it's an Array of Ints. 14:02
partly m: sub foo(Int @f) { say @f }; foo([1,2,'a'] but Positional[Int]) 14:03
camelia rakudo-moar 123c7a: OUTPUT«[1 2 a]␤»
partly masak: so if i say it's Positional[Int] it just believes me, like in the example above? 14:03
partly or is this some kind of weird string to int casting? 14:04
timotimo no, it's just a footgun
jnthn advises against `but Positional[Int]` style tricks 14:05
masak yes, that does seem ill-advised 14:07
jnthn Will see if I can find some time to write a bit more in doc.perl6.org/language/list#Typing later on today
masak you're slapping a type onto it, instead of declaring it as the type it actually is
jnthn Given Perl 6's meta-programming capabilities, the sky's the limit in terms of what you can claim. :-) 14:08
timotimo well, at least with the "but" trick you can get it to typecheck any later additions to the array 14:10
jnthn Uh...no you don't :) 14:11
I don't think so, anyway
jnthn bbl
partly m: my @a = [1,2,3] but Positional[Int]; @a[3] = 'a'. 14:14
camelia rakudo-moar 123c7a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bsxfwV6XxM␤Malformed postfix call␤at /tmp/bsxfwV6XxM:1␤------> 031,2,3] but Positional[Int]; @a[3] = 'a'.7⏏5<EOL>␤»
partly m: my @a = [1,2,3] but Positional[Int]; @a[3] = 'a';
camelia ( no output )
partly m: my @a = [1,2,3] but Positional[Int]; @a[3] = 'a'; say @a
camelia rakudo-moar 123c7a: OUTPUT«[1 2 3 a]␤»
masak boo! 14:17
timotimo oh, damn 14:18
it doesn't parameterize it properly 14:19
masak haha -- I don't know what you mean by that, but it sounds like Star Trek speak. "it doesn't reverse the polarity!" :P 14:20
timotimo: I don't see it as an "error", it's just the foot being shot as ordered IMHO
timotimo right :)
masak timotimo: as in, the underlying object that the `but` acts on is *not* typed 14:21
timotimo right, and the role itself isn't responsible for all the implementations of the methods 14:22
that's TypedArray
sortiz From class Lock doc: "A Lock is a low-level constructor for ensuring that only one thread works with a certain object at a given time". That description doesn't seem right or I'm missing something? 14:23
masak sortiz: the word "constructor" there surprises me. 14:23
sortiz And I understand that a Lock protects a block, not an object. 14:24
masak sortiz: looking at the tests and the source, I'd say so too. 14:25
masak sees no tests for the "reentrant" bit and is left wondering what would be a good code example showing off that 14:27
partly :w 14:30
masak hugs partly, good vim user!
partly well it was targeted to spacemacs ;) 14:31
masak .oO( space-Macs, like the aliens in "Independence Day" are using? ) 14:32
partly github.com/syl20bnr/spacemacs 14:33
timotimo it's not space-macs, it's spac-emacs 14:43
just like run-escape rather than rune-scape 14:44
mspo I tried spacemacs and was impressed when emacs found my mouse but a bunch of the installs failed and it seemed a little thrown together 15:24
dalek c: 17f6714 | (Eric de Hont)++ | doc/Language/regexes.pod:
Update regexes.pod

I found a small typo: staring -> starting
15:44
c: 9d3e034 | (Fritz Zaucker)++ | doc/Language/regexes.pod:
Merge pull request #395 from edehont/patch-1

Update regexes.pod
edehont My first pull request EVER! 15:46
timotimo good! :) 15:56
may it be the start of something great
edehont Who knows :-) 16:13
moritz regarding rakudo commit 123c7aadfb9ef0c656c3b4fb6281605345a015cf 17:16
would you think it'd be cleaner if I gave Seq a special constructor for creating an already-consumed Seq, and then patch .perl to emit that?
Juerd I think that makes sense. Maybe just a :named? 17:23
jnthn moritz: Sounds reasonable, yeah. Seq.already-consumed or so. It'd match up with various Supply factories (Supply.interval, etc.) 17:41
moritz Juerd: named doesn't make sense, because unlike the normal constructor, it doesn't need an iterator 17:47
Juerd moritz: MMD 17:48
Juerd moritz: Different signature, different routine, still 'new'. 17:48
AlexDaniel “LTA error messages are the norm, I fear.” – depends on the community :) 18:04
security issues are also a norm in some places
partly when using NativeCall, how do express that a class is in a namespace? 18:22
timotimo C doesn't have namespaces, or classes 18:23
partly I'm trying to wrap a C++ library 18:24
timotimo OK, that's a different thing, then :)
i'd presume it'd just be putting a :: in the name?
Skarsnik probably don't have marshmaling code for namespace 18:25
yoleaux 01:14Z <AlexDaniel> Skarsnik: Hi! I am parsing ≈6000 html files with Gumbo. Although I only store just a couple of tiny bits (Str-s) I am still running out of memory after around 822 files (16Gb RAM). I'm pretty sure that it is not me and something else is leaking this memory. Could be something in Gumbo or could be something in Perl6. Do you have any idea?
01:58Z <AlexDaniel> Skarsnik: you may also read this: irclog.perlgeek.de/perl6/2016-02-14#i_12037219 who knows, maybe you're the right person to fix this :)
partly timotimo: hmm surprisingly it works now, or at least i get another error. I thought i tried the obvious ::. Thanks anyway :)
timotimo has never tried C++ with nativecall 18:26
MadcapJake my syntax highlighter is being used at github, unfortunately they skip the variable selector and so other rules are getting captured inside of variable names... 18:37
nine jnthn: the Perl 6 versioning guidelines say that changing a method from only to multi is ok. But that would break subclasses that still have the only method wouldn't it? 18:38
yoleaux 13:52Z <jnthn> nine: Then we should fix our test harness to not do that.
jnthn nine: The only method in the subclass would hide the multi in the base class 18:47
nine: Got an example to demonstrate the bustage you're worrying about?
dalek c: 56e386c | jnthn++ | doc/Language/list.pod:
Some notes on nominal nature of array typing.
19:00
c: ce52670 | jnthn++ | doc/Language/list.pod:
Assorted small wording tweaks.
Skarsnik AlexDaniel, it can be XML/perl6 fault. did you use something to track the memory print after each call? 19:28
AlexDaniel Skarsnik: I didn't. What exactly should I try?
Skarsnik Linux::Proc::Statm? x) 19:29
AlexDaniel hmm ok I'll try
Skarsnik or read yourself /proc/pid/statm
AlexDaniel a bit later
nine jnthn: I don't have an example at hand. Just trying to feel my way around how to best evolve the CompUnit::Repository API 19:30
dalek kudo/nom: bc4c6df | moritz++ | src/core/Seq.pm:
Simplify fix for RT #127492
19:44
arnsholt Skarsnik: 9 times out of 10 it'll be things like explicitly-manage that leaks the memory
NativeCall is inherently leaky, sadly =(
Skarsnik there is none in Gumbo
arnsholt There are other things that leak too, though 19:45
Come to think of it, I'm not sure if structs or arrays are ever freed, for example 19:46
(Unless explicitly done in the library code, of course) 19:47
Skarsnik I have a big Perl 6 leak with XML 19:50
I lost 4Mb for each request on the tree on one script 19:51
arnsholt Oh, wow 19:53
jnthn nearly has nqp-m with Moar run with --full-cleanup clean under valgrind leak check; will do similar for Rakudo (though it's not a lot worse). Then it'll be possible to use it to pick out real leaks. 19:55
timotimo jnthn: wow, any new commits coming for that? 19:58
timotimo does the evil thing where he asks a question and immediaetly afterwards goes AFK 19:59
vendethiel what an evillord.
jnthn timotimo: It already is like that at HEAD, with the ones I've pushed over the last week or two :)
I need to figure out how to get the standard handles cleanly cleaned up is all 20:00
Skarsnik nice work jnthn :) 20:03
FROGGS timotimo: I'm working on box2d now btw
arnsholt jnthn: Oh, very cool! 20:05
I really wish I had time to hack on some of these things, but I suspect that'd be a bad idea, sadly
dalek rakudo/nom: d924ae2 | LLFourn++ | src/ (2 files): 20:48
rakudo/nom: Make require use CompUnit interface for importing
rakudo/nom:
rakudo/nom: The following now works:
rakudo/nom: 1. require 'lib/Module.pm' <sym>;
dalek ast: 45685a3 | lizmat++ | S11-modules/require.t:
Unfudge now passing test, LLFourn++
20:50
jnthn nine: I think rt.perl.org/Ticket/Display.html?id=127465 already happened? 21:04
lizmat jnthn: I think it has 21:06
yoleaux 03:25Z <sortiz> lizmat: I was assuming that less bytecode implies less opcodes so better times, That worries me, I need to make a deeper analysis.
llfourn lizmat: thanks for merging and thanks for noticing that I broke ip5 tests 21:10
yoleaux 13 Feb 2016 14:19Z <nine> llfourn: pr 694 regresses several spec tests in the 6.c branch (some of them the S01 integration tests)
llfourn oh. thanks to nine as well then :P
lizmat llfourn: thank you for doing all the hard work :-)
llfourn .tell nine thanks for noticing that. I've set myself up for testing ip5 now :) 21:11
yoleaux llfourn: I'll pass your message to nine.
AlexDaniel Skarsnik: yeah, it is rising like 4MB per each file 21:15
or more 21:16
Skarsnik: just a quick test, not a precise result
lizmat is this on the most recent version of Rakudo? or a release version
lizmat I seem to recall jnthn fixing a leak related to slurping files in Moar like last week 21:16
AlexDaniel lizmat: the most recent thing, I've built it just a few minutes ago 21:17
lizmat: well, looking at the way it goes I think that it is better now. But I didn't really measure it before
Skarsnik AlexDaniel, did you try before/after gumbo parse? I made sure gumbo free its allocated memory. 21:18
nine jnthn: indeed. Closed the ticket. Thanks for pointing this out!
yoleaux 21:11Z <llfourn> nine: thanks for noticing that. I've set myself up for testing ip5 now :) 21:19
jnthn AlexDaniel: If you know to valgrind it with leak checking, and can arrange to pass --full-cleanup to MoarVM, feel free to gist me an output; it's still a bit noisy.
AlexDaniel I'll see if I have time for this 21:22
AlexDaniel Skarsnik: yup. If I call parse-html then it clogs the memory 21:22
if I do everything else without actually parsing it then I don't see any leaks actually 21:23
Skarsnik well it build a xml tree
this take perl6 memory
Can you try using a filter that find nothing? to see if the memory print it the same 21:24
like parse-html(:class<helloworldpiko>)
ugexe m: say (try require Test:xxx); say (try require Test:auth<foo:bar>); say (try require TestXXX); 21:30
camelia rakudo-moar 9c8c3b: OUTPUT«(Test)␤(Test)␤Nil␤»
AlexDaniel Skarsnik: yep, it is much better with that kind of filter 21:31
Skarsnik a lot?
AlexDaniel yeah like 5 to 10 times better
Skarsnik well it only create a xml tree with a html root 21:32
so gumbo does not leak
since I basicly just convert what gumbo give me to xml objects (and filtering myself)
AlexDaniel Skarsnik: I think that you're right 21:33
according to what I see it sounds correct
lizmat m: class Foo is Date { has $.foo }; dd Foo.new( :2016year, foo => 42)
camelia rakudo-moar 9c8c3b: OUTPUT«Foo.new(2016,1,1)␤»
Skarsnik the foo get lost? 21:35
lizmat yup
Skarsnik m: class Foo is Date { has $.foo }; say Foo.new( :2016year, foo => 42).foo;
camelia rakudo-moar 9c8c3b: OUTPUT«(Any)␤»
lizmat incomplete subclassability, is it a bug or not ? :-) 21:36
AlexDaniel m: class Foo is Date { has $.foo is rw }; dd Foo.new:2016year:42foo:25day
camelia rakudo-moar 9c8c3b: OUTPUT«Foo.new(2016,1,25)␤»
AlexDaniel m: class Foo is Date { has $.foo }; Foo.new:2016year:42foo:25day.perl.say 21:37
camelia rakudo-moar 9c8c3b: OUTPUT«Foo.new(2016,1,25)␤»
Skarsnik m: class Foo is Int { has $.foo }; say Foo.new(foo => 42).foo; 21:38
camelia rakudo-moar 9c8c3b: OUTPUT«42␤»
stmuk are multi-dimensional arrays thread unsafe?
Skarsnik date is special? x)
m: class Foo is Date { has $.foo }; say Foo.new(foo => 42).foo;
camelia rakudo-moar 9c8c3b: OUTPUT«Cannot call Foo.new with these named parameters: foo␤ in block <unit> at /tmp/rKtSThY_af line 1␤␤Actually thrown at:␤ in any at gen/moar/m-Metamodel.nqp line 3041␤ in block <unit> at /tmp/rKtSThY_af line 1␤␤»
Skarsnik m: class Foo is Date { has $.foo }; say Foo.new(:foo(42)).foo; 21:39
camelia rakudo-moar 9c8c3b: OUTPUT«Cannot call Foo.new with these named parameters: foo␤ in block <unit> at /tmp/XTrYpMiNWR line 1␤␤Actually thrown at:␤ in any at gen/moar/m-Metamodel.nqp line 3041␤ in block <unit> at /tmp/XTrYpMiNWR line 1␤␤»
Skarsnik Oook
that something
m: dd Date
camelia rakudo-moar 9c8c3b: OUTPUT«Date␤»
jnthn stmuk: Well, they're not vulnerable to resize data races, and you can't pop/push/shift/unshift them, so not vulnerable to those either. 21:44
stmuk: Non-native ones will still have auto-vivification races. 21:45
(Of the Scalar container)
stmuk: But the array itself is fine. 21:46
stmuk ok thanks
DrForr Howdy. Looking at the Routine class there appears to be no API to get a name other than to stringify the object. 21:47
jnthn m: say &abs.name
camelia rakudo-moar 9c8c3b: OUTPUT«abs␤»
DrForr Sometimes it's the simple things :)
dalek c: d9a18dd | jnthn++ | doc/Type/Routine.pod:
Document Routine.name.
21:49
DrForr OTOH I don't see.. Ah, thanks :) 21:50
jnthn ;)
jnthn had Atom open in the directory from doing the patch about typed arrays earlier :)
sortiz . 22:23
dalek ast: 25c40d0 | LLFourn++ | S11-modules/ (3 files):
More require tests

now that #f565f80 has been merged
22:43
hoelzro . 22:48
yoleaux 05:41Z <sortiz> hoelzro: Reading your changes for multi-line, in nqp, why is $more-code-sentinel outside of the class, more over, why not an attribute?
06:40Z <sortiz> hoelzro: Seems to me that other exceptions to catch are those produced by HLL::Grammar.FAILGOAL, method that I suppose can be overridden too.
hoelzro sortiz: I don't see any reason for it to not be an attribute; I think I just didn't think of it =) 22:49
sortiz: other FAILGOAL exceptions will be for input that has the wrong character, right?
so I don't know if that should trigger multi-line mode
sortiz hoelzro, Hi.
hoelzro o/ 22:50
sortiz I try, for exmaple my @a = [
Or my $b = <
All those die in FAILGOAL 22:51
hoelzro ahhh
sortiz But that's a naked nqp::die 22:52
(via Grammar.panic)
sortiz see github.com/salortiz/nqp/blob/maste...r.nqp#L279 22:54
dalek kudo/nom: 585619f | lizmat++ | src/core/Date.pm:
Make Date fully subclassable

When using additional named parameters, obviously. This shouldn't affect efficiency of the base class measurably.
lizmat m: class Foo is Date { has $.foo }; dd Foo.new( :2016year, foo => 42).foo # should work after ^^^
camelia rakudo-moar 9c8c3b: OUTPUT«Any␤»
sortiz So seems to me a good candidate for detect the need of more input. What do yo think? 22:58
uruwi Quick question: what are mergesubstates and mergesubrule? 23:09
These are taking half of the total time needed to start parsing 23:13
lizmat good night, #perl6! 23:14
uruwi Good night 23:15
sortiz 'night, lizmat
uruwi But really, it's taking about a minute to start, though when it's past it can whiz through the source. 23:16
I guess it's related to optimization?
uruwi Grammar I'm trying to use is here: github.com/bluebear94/u/blob/master/u.pl6 23:23
dalek osystem: cc75770 | RabidGravy++ | META.list:
Add Audio::Liquidsoap

See github.com/jonathanstowe/Audio-Liquidsoap
23:25
skids uruwi: likely the folks that could answer that questionn are asleep right now.
RabidGravy I got bored of trying to think of any more dependency-free examples 23:32