»ö« 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.
HelpBot[perl6] tbrowder: on my box .lines vs .split for 1 mil-line file shows .split to be 1.590551x faster. If you saw no difference, the way you were measuring is flawed. 00:01
Probably drowned by all those regex option parsing, unless you're excluding those times.
tbrowder: and in this investigation, telling perl 5 to perform encoding made it 1.5x slower. So again, you should be able to see the differences in timing very clearly if you're measuring just the IO: www.reddit.com/r/perl6/comments/6h...s/dixps6s/ 00:03
tbrowder my test times are user times as reported by the GNU system 'time' command. they are averaged over three trials, and they are supposed to reflect a real environment shared with other processes. but i'll look at your suggestions, thnx 00:08
HelpBot[perl6] But the user times includes all the other bits. 00:15
So the comparison is very lopsided. Even if you rename the timings from IO to "some programs", they'd still be lopsided because, excluding IO, you're doing very different things in the two programs. You should measure the time inside the test scripts and print out the times and parse them out of the output instead of using `time` 00:16
HelpBot[perl6] was contemplating a benching system for core recently 00:20
HelpBot[perl6] You just create a small file that has some code in it and it becomes part of the bench suite. Make enough of these and you can bench the entire Perl 6. Make a reliable-enough ruler and you can also add tests to watch for regressions. 00:21
timotimo HelpBot[perl6]: maybe there's a bit of stuff you can steal from japhb's perl6-bench? 00:22
HelpBot[perl6] Where is it? 00:23
HelpBot[perl6] huggable: bench 00:24
huggable HelpBot[perl6], nothing found
HelpBot[perl6] huggable: bench :is: github.com/japhb/perl6-bench
huggable HelpBot[perl6], Added bench as github.com/japhb/perl6-bench
HelpBot[perl6] Thanks.
timotimo it has a bunch of microbenchmarks already built-in 00:26
and we used to run them daily on moarvm.org/measurements/
lookatme morning
HelpBot[perl6] \o 00:28
lookatme ^_< 00:33
literal_ Is there a way to know the callee of a sub without needing to pass any information? 00:48
HelpBot[perl6] m: sub foo { bar }; sub bar { callframe(1).code.name.say } 01:03
camelia ( no output )
HelpBot[perl6] m: sub foo { bar }; sub bar { callframe(1).code.name.say }; foo
camelia foo
zengargoyle m: sub f { !!! X::NYI.new: feature => &?ROUTINE.name }; f(); 01:13
camelia f not yet implemented. Sorry.
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
zengargoyle an, nm, one level down. 01:14
zengargoyle thinks it must be bedtime. 01:15
reino4477 hi, how can I use a reserved word as a name of a method? 01:39
tbrowder what very different things are being done? 01:46
awwaiid reino4477: what's an example of a reserved word that doesn't work? 01:50
BenGoldberg m: class Foo { method my { 42 } }; say Foo.my; 01:51
camelia 42
BenGoldberg m: class Foo { method self { 42 } }; say Foo.self;
camelia 42
BenGoldberg m: class Foo { method ^strange { 42 } }; say Foo.^strange; 01:52
camelia Too many positionals passed; expected 1 argument but got 2
in method strange at <tmp> line 1
in block <unit> at <tmp> line 1
BenGoldberg m: class Foo { method ^strange(|) { 42 } }; say Foo.^strange; 01:53
camelia 42
lookatme How can I write action for token like this: `token target { <style1> | <style2> | <style3> }` 04:52
s/action/actions/
ufobat github.com/rakudo/rakudo/commit/40...3adec180bf Zoffix++ 05:27
seatek You know, whoever put those matching guesses in error messages in... the ones that say, hey, dummy, maybe you really meant to say "this thing" ... they're a real smart alec. ;) I love those though. The guesses are really good too. 06:01
Geth ecosystem: 52ba465c8d | seatek++ (committed using GitHub Web editor) | META.list
Update META.list
07:31
reino4477 how can I create my own exception? 07:44
parv reino4477 is Exceptional 07:47
reino4477 parv: tnx 07:48
lookatme m: my class FE is Exception { }; FE.new(message => "123").throw 07:49
camelia FE exception produced no message
in block <unit> at <tmp> line 1
lookatme m: my class FE is Exception { }; FE.new("123").throw
camelia Default constructor for 'FE' only takes named arguments
in block <unit> at <tmp> line 1
lookatme m: my class FE is Exception { }; FE.new(msg => "123").throw
camelia FE exception produced no message
in block <unit> at <tmp> line 1
lookatme m: my class FE is Exception { has $.message; }; FE.new(message => "123").throw 07:50
camelia 123
in block <unit> at <tmp> line 1
parv Does #perl6 get rakudo build (nearly?) everyday? 07:57
lookatme IDK :) 08:06
probably not
parv hunh. everytime i notice the revision in rakudo-moar output, it /seems/ to be the new one i had installed some days/weeks/months ago. 08:15
reino4477 I can't find any info about the difference between subroutines and methods, where can I find it? 08:34
lookatme reino4477, check out method document :docs.perl6.org/type/Method 08:43
melezhik Hi! How to declare mandatory parameter in sub MAIN ? 08:44
lookatme and also sub: docs.perl6.org/type/Sub
melezhik, add ! after parameter
melezhik thanks. lookatme: 08:45
always forget the syntax ))
lookatme more practice :)
melezhik sure
and the syntax will be "in fingers" 08:46
Geth doc: 9e46c5c274 | (Jan-Olof Hendig)++ | 3 files
Fixed a few broken links. AlexDaniel++
08:51
reino4477 tnx 08:54
reino4477 how can I specify a variable of type Hash <Str Str>? 09:04
or a return type of a method
reino4477 my Hash<Str Str> a; ----> doesn't work 09:05
moritz m: Hash{Str, Str}
camelia 5===SORRY!5=== Error while compiling <tmp>
Autovivifying object closures not yet implemented. Sorry.
at <tmp>:1
------> 3Hash{Str, Str}7⏏5<EOL>
moritz hmm 09:06
m: my Str %h; say %h.^name
camelia Hash[Str]
moritz oh
m: say Hash[Str, Str]
camelia (Hash[Str,Str])
lookatme reino4477, perl6 use `[]` for type parameter 09:08
reino4477 tnx 09:09
lookatme There are many perl6 tutorial : perl6.org/resources/ 09:12
reino4477
reino4477 by the way, what's the most common way to specify a return value syntax a) --> b) of c) returns ?
reino4477 there're 4, which is usually used? 09:13
geekosaur "returns" is deprecated
--> is the preferred one
lookatme I prefer `-->`
reino4477 it works without a comma before it and with it too, should a command be used? 09:14
geekosaur I still think --> is in the wrong place especially since it's visually claiming to take part in MRO when in fact it doesn't
reino4477 sub s1(Str --> Int) {}; and sub s2(Str, --> Int) {}; 09:15
geekosaur: what do you use instead of the -->? 09:16
geekosaur we don;t use the comma and I would be wary of that syntax being used for something else in the future
lookatme m: say (Str, --> Int) ~~ (Str --> Int) 09:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3say (Str,7⏏5 --> Int) ~~ (Str --> Int)
expecting any of:
statement end
statement modifier
statement modifier loop
geekosaur I did not say I don't use --> since --> has been legislated as The Way. I just think that was the wrong decision'
lookatme m: say :(Str, --> Int) ~~ :(Str --> Int)
camelia True
lookatme current they are equivalent 09:18
Geth doc: 88cd831a92 | (Jan-Olof Hendig)++ | doc/Type/IO.pod6
Fixed broken link
09:59
doc: 9baa6797ae | (Jan-Olof Hendig)++ | 2 files
Fixed a few indentation problems
HelpBot[perl6] "returns" isn't deprecated. TimToady wanted to deprecate it in 6.d, but there's resistance to that. 10:08
Geth doc: a5904cb70e | (Jan-Olof Hendig)++ | 2 files
Fixed a bunch of broken links. AlexDaniel++
10:16
HelpBot[perl6] .tell parv you should only ever use releases and not "build every day" off a random commit. Non-release commits aren't as thoroughly tested and it isn't uncommon for them to have some regressions. People who build them are like people who do 30 over speed limit: they think they know better and would like to get (bugfixes) fast, but eventually they'll come across a untested pothole that wipes all their data. 10:19
yoleaux HelpBot[perl6]: I'll pass your message to parv.
timotimo i ... i'm like that :o 10:22
Ulti gist.github.com/MattOates/0c051cb3...a42ef96b78 <--- is the difference in perf here simply the number of assignments required? 10:31
I assume P5 is doing some kind of gross direct writing to the same SV with low level C style block memcpy and P6 is creating whole new Buf objects? 10:32
HelpBot[perl6] Ulti: I'd guess assignments are the least expensive thing there. It's fewer going out to the file and reading chunks from it. 10:33
Ulti that would explain the very minimal difference between the read buffer size on P5 and the almost linear relationship in time with P6
Ulti HelpBot[perl6]: P5 is barely affected though with what is logically the same "speed up" 10:34
HelpBot[perl6] timotimo: at least you hang in #perl6-dev. I've seen people rock a 2017.04.02-\d+ rakudo so they definitely had some sort of bug there.
Ulti: it gets 30% faster 10:35
HelpBot[perl6] would like to see such "barely" in Rakudo :) 10:35
timotimo moar definitely does create new Buf objects for each read there 10:36
Ulti the Rakudo relationship is the multiplier for difference in length /8 in a linear relationship o____O 10:37
HelpBot[perl6] It's worse than that. $*IN by default is in utf8 mode, so you're also filling up the decoder for no reason 10:38
Ulti: but your code is not a 1-to-1 relationship to Perl 5's version
Ulti well its as close as you can get without NQP
afaik? 10:39
HelpBot[perl6] No
Ulti orly
HelpBot[perl6] You're reading in char mode basically. Also you have phaser support on that while
jnthn Pretty sure it can see there's not phasers, though. :)
Ulti surely the phaser support is a constant not linearly worse
HelpBot[perl6] Ulti: try: perl6 -e '$*IN.encoding: Nil; $ while my $buf = $*IN.read: 1024' 10:40
Yes, your major loss is in filling decode
r
Ulti k k
jnthn It's assuming you might do mixed mode binary/text because the encoding is set by default, though, as HelpBot[perl6] said
And that implies 2 extra copies/allocations each time
HelpBot[perl6] Ulti: ok, never mind the `$ while` bit, but set $*IN.encoding 10:41
Ulti HelpBot[perl6]: even worse real 0m20.516s
HelpBot[perl6] Ulti: what perl6 version are you using?
Ulti did it a second time for IO cache effects and it went up to 21.8
Rakudo version 2017.06-103-g2a8d1e7ce built on MoarVM version 2017.06-29-ga51ba620 10:42
also Im not saying this is suddenly slower
HelpBot[perl6] Ulti: this one time perl6 -e '$*IN.encoding: Nil; while ( my $buf = $*IN.read(1024) ) {}'
Ulti: is that the one you tried?
Hard to believe it's slower, considering it should bypassing doing a whole ton of work :/
jnthn It bypasses work, but note that it also does no buffering 10:43
HelpBot[perl6] ah
Ulti HelpBot[perl6]: that last one 18.774
HelpBot[perl6] right
Ulti which is still slower than my original while :S
jnthn In binary mode, the .read and .write you get are basically going straight down to read/write calls 10:44
It's not unlikely that a profile would show up some more useful info
And probably some optimization opportunities 10:45
HelpBot[perl6] Ulti: you should get better perf with switched encoding when reading 0x100000 and larger chunks :)
Ulti oh adding the profiler made the one liner wig out
HelpBot[perl6]: yeah I mean 1024 is like 1980s level OS buffer sizes 10:46
HelpBot[perl6] As for seeing phasers. I just went off this: www.reddit.com/r/perl6/comments/6h...s/dixps6s/ 10:47
Where `$ while 1` is much faster than `loop {}`1
well a bit faster
Ulti: how come you're benching IO BTW? 10:48
You're like the 3rd or 4th person I see doing it this week. Comparing to Perl 5 in all cases.
Ulti because everything else is fast enough >;3
P5 has unreasonably fast IO for a scripting language is the main problem with that comparisson too 10:49
jnthn True, though we're already about matching it in at least the case of reading lines in UTF-8
travis-ci Doc build errored. Jan-Olof Hendig 'Fixed a few indentation problems' 10:49
travis-ci.org/perl6/doc/builds/248718962 github.com/perl6/doc/compare/9e46c...aa6797ae0a
Ulti Ruby for example takes Pi seconds :D to 3 sigfig anyway 10:52
Geth doc: 1f2799d524 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/functions.pod6
Amend %*SUB-MAIN-OPTS docs

Since the dynamic no longer exists by default and needs a `my`ing
10:53
travis-ci Doc build passed. Jan-Olof Hendig 'Fixed a bunch of broken links. AlexDaniel++' 10:54
travis-ci.org/perl6/doc/builds/248723785 github.com/perl6/doc/compare/9baa6...904cb70e11
Ulti so yeah 5x slower than the latest Ruby in a contrived weird IO use case, that really is not that bad given Ruby itself was probably at that level not long ago at all certainly whilst everyone was doing Rails 10:56
Geth specs: 2eb5cd1e7a | (Zoffix Znet)++ (committed using GitHub Web editor) | v6d.pod
Add reminder to toss $*MAIN-ALLOW-NAMED-ANYWHERE

backwards compat support in 6.d
10:57
araraloren evening 10:58
HelpBot[perl6] morning
Ulti HelpBot[perl6] but to more directly answer your question the sorts of files that are routine size for me are about 100GB, so a factor of 45x just to shovle that through a script is unfortunately for my professional use case almost the only thing that matters. The correct solution is for me to write some P6 bindings to bioinformatics IO libraries, which is the solution all other languages really have. I just wanted to know if its feasible to write these so 11:03
Ulti like even in P5 its all XS to libraries that manage the major binary formats 11:04
I think thats kind of correct anyway it means you have code with a similar API across languages which is better for the user anyway 11:05
lizmat just committed github.com/perl6/doc/commit/a72b15...e6685f98d8 11:07
HelpBot[perl6] lizmat++ # I didn't even thing about using assignment doh 11:13
weird. geth receivwd that commit but there's no more output in the log. it just exited :/ 11:16
.o( killed by OS? ) 11:17
HelpBot[perl6] feels like a l337 haxor shelling into the bot's server and restarting it from a phone while riding on the bus :) 11:18
tbrowder ref my r/w tests, i should rename them something like "real world" tests. i made them because reading and processing large data files is a large part of the work fllow for such things as fea and genomics among other things. real world perl users want to see how p6 is stacking up to p5. but i will refine them to show ascii vs utf8 for each of p5 and p6. 11:19
Geth doc: a72b152868 | (Elizabeth Mattijsen)++ | doc/Language/functions.pod6
Hopefully improve SUB-MAIN-OPTS doc
HelpBot[perl6] tbrowder: a better refinement would be testing equivalnt programs :/ 11:21
tbrowder why are they not equivalent? 11:22
HelpBot[perl6] It's fine to publish data that shows P6 is 30x slower than Perl 5, but not if your Perl 6 script is doing different work
tbrowder ok, i'm not smart enough to see what you mean, please elucidate 11:23
HelpBot[perl6] tbrowder: from what I recall yesterday, you were also measuring a bunch of options parsing using regexes in perl 6 (where "real world" code would likely use .starts-with/.contains) and I didn't see any option handling in your Perl 5 script at all
tbrowder the option handling was only to decide which read method is to be used. it 11:25
HelpBot[perl6] Yes, but you're still including the time to run it in your measurementd
HelpBot[perl6] gives up trying to explain the issue with that bench setup
tbrowder it is only used once. liz and timotimo suggested that early on. i can't believe it is significant, but it is easily removed. 11:26
[Coke] sums up: 'everything takes time' and 'only compare like to like'. 11:27
"can't believe" doesn't enter into benchmarking.
that's the whole point of benchmarking.
[Coke] to measure the actual thing. 11:27
HelpBot[perl6] tbrowder: yesterday you said .split vs .lines and making Perl 5 do encoding had no difference too, yet I showed you 1.5x-2.1x differences. Why measure anything if you "can't believe" and think a 1.5x diff is not significant :/ 11:29
AlexDaniel dogbert2: I think solving the <a><a> issue will get rid of most of the warnings
El_Che In case someone missed it: fayerplay.com/perl-is-schrodinger_state/ <- kind of harsh 11:30
HelpBot[perl6] And I also quoted jnthn++'s measurements for the same task you're benching and his results are 1.24x slower, whike yours show 20x slowr
El_Che good timing! 11:31
tbrowder you showed me results of yours or jnthn's tests, i still maintain mine are valid rw tests, not micro-statement measurements
HelpBot[perl6] *sigh*
tbrowder don't sigh, show me the code 11:32
HelpBot[perl6] What code?
tbrowder his tests
HelpBot[perl6] I told you you're testing non-equivalent scripts amd you dismiss the differences as not mattering 11:33
tbrowder ok, fix my code 11:33
[Coke] he's given you several concrete items that can be fixed.
HelpBot[perl6] ok, hire me. $150/hour
[Coke] well, s/fixed/changed/ 11:34
El_Che HelpBot[perl6]: I see your point reading the backlog
HelpBot[perl6] El_Che: more precise, my point is we shouldn't give more ammunition to people who articles you just posted who scream Perl 6 is non-optimizeable. 11:35
tbrowder i don't think i could change anything to satisfy him, but i'll tweak a bit...
HelpBot[perl6] And it's fine if the 20x slower mark is the real data, not wildly different scripts 11:36
El_Che HelpBot[perl6]: It's not about that. People will read it anyway, so it's good to know what was written 11:36
tbrowder i don't agree with "wildly"
HelpBot[perl6] tbrowder: you also say 2.1x speed difference is not significant, so what does it matter? 11:37
Hell, show data that says we're 100x slower. I won't have beef with that, but show accurate data 11:38
tbrowder i didn't say that, i don't use that way of comparing times
ok, no more wasted bandwidth, PRs welcome 11:40
bye
travis-ci Doc build errored. Zoffix Znet 'Amend %*SUB-MAIN-OPTS docs 11:43
travis-ci.org/perl6/doc/builds/248733623 github.com/perl6/doc/compare/a5904...2799d524c1
dogbert2 AlexDaniel: all ACCEPTS links here are broken, wonder where the author intended them to point: docs.perl6.org/type/ComplexStr#method_ACCEPTS 11:52
yoleaux 00:45Z <AlexDaniel> dogbert2: I've updated everything. github.com/perl6/doc/issues/561
dogbert2 yeah, have removed a bunch of broken links already 11:52
AlexDaniel dogbert2: Numeric#ACCEPTS, Str#ACCEPTS and no link respectively 11:53
dogbert2 AlexDaniel: cool, all Allmorphs have this problem 11:54
travis-ci Doc build errored. Elizabeth Mattijsen 'Hopefully improve SUB-MAIN-OPTS doc' 11:54
travis-ci.org/perl6/doc/builds/248736639 github.com/perl6/doc/compare/1f279...2b1528684e
AlexDaniel well, it's #method_ACCEPTS, but you get the point :) 11:56
Geth doc: 32b2ebcba5 | (Jan-Olof Hendig)++ | 4 files
Fixed even more broken links. AlexDaniel++
12:04
timotimo at least the create-large-file.p6 thing doesn't actually get faster when changing the encoding to ascii, which means that the utf8 encoder fast path (if there is one) is rather good! 12:21
lambd0x Hi there everyone! I wanted to know wether someone has already tried to extract in xml, txt, obj and pdf file in perl6. I was looking for it yesterday in Perl6 and could only find a way to create PDF files, not to parse it. In addition, in Perl, there are some modules, but articles regarding it are from 7 years ago and even back then, the authors reported not been able to achieve what they wanted (parsing 12:23
txt from a pdf). Nevertheless I was looking for a pure perl6 solution, would anyone have some experience with this? Thx in advance.
zengargoyle notes after backloging that all 3 of my modules are probably subtly broken re encoding and probably only work on ascii data. :/ 12:25
timotimo which modules are those? 12:26
FWIW, when i encode $str x 50 and only call write 1/50th of the time instead, the whole program finishes in 0.5s 12:27
zengargoyle Search::Dict (binary search on dictionary files), Text::Fortune (fortune files), and Algorithm::Trie::libdatrie (a trie library binding).
timotimo this is for a 382 megabytes big file
ah, hmm 12:28
zengargoyle the first two were mostly 'ports' from p5 modules as inspiration.
the third was just playing with NativeCall and library building in a dist. 12:29
Ulti lambd0x: and you've checked out the ecosystem modules related? github.com/p6-pdf/PDF-p6
lambd0x Ulti: yes, but it looks like a pdf management only module (create, update, etc..) 12:33
timotimo it looks like it can parse, too, though? 12:35
like, you open the file and you get something vaguely object-graph-y out of it? 12:36
> $doc<Root><Pages><Kids>[0]<Contents>.decoded
BT /F1 24 Tf 100 250 Td (Hello, world!) Tj ET
Geth DBIish: melezhik++ created pull request #94:
An example how to pass dbname as file for qqlite
12:39
linuksz is here someone using Arch Linux? 12:45
raschipi Many people use ARCH LINUX too. 12:46
linuksz how do you install modules? from AUR? of using zef? 12:47
raschipi No idea.
zengargoyle probably zef. :)
travis-ci Doc build passed. Jan-Olof Hendig 'Fixed even more broken links. AlexDaniel++' 12:48
travis-ci.org/perl6/doc/builds/248754850 github.com/perl6/doc/compare/a72b1...b2ebcba50c
zengargoyle i think there are some debian people still trying to figure out how to manage packaging of modules. 12:49
lambd0x what's the diff between moar and moar-blead as vm? 12:50
timotimo the arch people have this tool that's supposed to install perl6 packages (maybe by creating an arch package for them first?) but it's not up to date with the latest module API
lambd0x: with moar-blead you're running an untested version that can have bugs nobody has found yet
lambd0x timotimo: thx :D 12:50
linuksz there are many packages in AUR, which use alacryd for installing the module to the packaging directory, but alacryd don't work 12:51
timotimo right
DrForr_ I'll ask over here as well just in case - --profile seems to be dumping core on a 4GB Ubuntu Linux VM. 14:40
AlexDaniel wasn't it fixed recently? 14:48
DrForr_ This was on rakudobrew from yeterday, doesn't get much more "recently" :) 14:50
jnthn Believe it was fixed in github.com/MoarVM/MoarVM/commit/3d3d0d05df
DrForr_ So it may not have propagated. I was just hoping to get some profile data so I can see when a major slowdown occurred. 14:51
Rebuilding. 14:52
araraloren_ Quick question: How to create actions for token like : `token pair { <style1> | <style2> | <style3> } 14:53
jnthn make ($<style1> // $<style2> // $<style3>).ast 14:54
araraloren_ jnthn, thanks
jnthn Though it might well have been cleaner to use protoregexes instead :)
Another alternative is 14:55
token pair { <style=.style1> | <style=.style2> ... } and then the action is just make $<style>.ast
araraloren_ em, thanks 14:56
araraloren_ I will try to make a protoregex. 14:58
DrForr_ Rebuilt, testing.
DrForr_ Dumping core after about 3 lines, just like last time. May not have actually picked up moarVM changes... 15:07
ufobat in perl5 / Moose there is a around 'methodname' => sub { $orig = shift; $self = shift; ... } is there something similar in perl6? 15:32
ugexe m: proto method foo(|) { say "before"; {*}; say "after" }; multi method foo($a) { say $a }; foo(100) # kinda the same 15:33
camelia 5===SORRY!5===
Undeclared routine:
foo used at line 1

Other potential difficulties:
Useless declaration of a has-scoped method in mainline (did you mean 'my method foo'?)
at <tmp>:1
------> 3proto method7⏏5 foo(|) …
ugexe m: proto sub foo(|) { say "before"; {*}; say "after" }; multi sub foo($a) { say $a }; foo(100) # kinda the same
camelia before
100
after
ufobat i want do to this in a role that i add with does at runtime 15:34
will try it :D thx ugexe
ugexe you could probably use something like `multi whatever(|c) { ...; nextsame(|c) }`
ugexe `multi whatever(|c) { ...; my $val = [next|call]same(|c); say $val; ...; }` 15:35
Geth doc: d75b0ea6d5 | (Jan-Olof Hendig)++ | doc/Language/unicode.pod6
Fixed broken link
15:56
ufobat ugexe, what is c in this example? a constant? could i retrive values from this c? 15:58
Geth doc: 6372a29881 | (Jan-Olof Hendig)++ | doc/Language/quoting.pod6
Fix more broken links
16:02
DrForr_ Maybe the emulation bit has flipped on my laptop... 3 minutes for a test suite is annoying. 16:14
raschipi ufobat: It's a capture 16:19
ufobat raschipi: thank you! 16:32
raschipi ufobat: The 'signature' and 'capture' docs are required reading. 16:42
travis-ci Doc build errored. Jan-Olof Hendig 'Fix more broken links' 16:52
travis-ci.org/perl6/doc/builds/248844773 github.com/perl6/doc/compare/d75b0...72a29881fe
araraloren_ m: my $c = \(a => 4, "z" => "bcd"); say $c.[0]; say $c.[1]; say $c.<z>; say $c.<a>; 17:03
camelia z => bcd
Nil
Nil
4
araraloren_ What's difference between `a => 4` and `"z" => "bcd"` in a Capture ?? 17:08
raschipi One is a named argument and the other is a pair in a positional parameter 17:09
raschipi the bareword/string as key is significant in this case 17:10
araraloren_ so If I want capture all Pair parameter, should I use *@ instead of *% ? 17:11
raschipi m: my $c = \("a" => 4, z => "bcd"); say $c.[0]; say $c.[1]; say $c.<z>; say $c.<a>;
camelia a => 4
Nil
bcd
Nil
araraloren_ like "a" => "c"
timotimo DrForr_: but profiling works now? 17:12
araraloren_ m: sub f (*%args) { say %args; }; f("a" => "c")
raschipi Now you're talking about signature binding, which is something else
camelia Too many positionals passed; expected 0 arguments but got 1
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
DrForr_ timotimo: Nope.
araraloren_ m: sub f (*@args) { say @args; }; f("a" => "c")
camelia [a => c]
araraloren_ raschipi, thanks
raschipi np 17:13
timotimo were you able to update your moar sufficiently?
DrForr_ Unknown...
raschipi m: sub f (*%args) { say %args; }; f(a => "c")
camelia {a => c}
araraloren_ I can not use named parameter, they are contain some special letter 17:14
timotimo well, perl6 --version could tell us 17:15
[Coke] whips up a perl 6 script to help figure out various weight goals based on bmi, kilo/stone/pounds, etc.
DrForr_ It's the latest - 'empty out bbs that were killed' is the latest log entry for MoarVM.
raschipi right, I was testing for myself in this case.
timotimo that's the one that fixes profiling, in theory
pompomcrab so i worked as a perl dev 2004-2009 and loved it, moved on to ruby/js, but have been playing with perl6 for the past 6 months. i love it. kudos to everyone involved in the 6 community. p6 dings all my linguistic autistic buttons. tbh i hope p6 could be The Next Big Language. that is all. k thx bai
[Coke] pompomcrab: thanks! 17:16
timotimo cool
DrForr_ No luck so far.
araraloren_ another short question.Can I add a type constraint for `*@` ?
raschipi If you want each pair as a positional, *@ will contain them all. But you should also test **@ and see which one do you prefer when you give it a single list.
timotimo and also +@ 17:17
araraloren_ em, ok
raschipi araraloren_: no, you'll have to test them yourself. But it's possible to throw the "wrong parameter type" exception yourself and people that will use will never know. 17:18
araraloren_ raschipi, em, I got it.
raschipi For people used to perl5, testing a parameter list feels natural 17:20
araraloren_ raschipi, I am not familiar with perl5 17:21
When I saw perl6, I stopped learn perl5 :) 17:22
jnthn m: sub foo(*@a where all(@a) ~~ Int) { }; foo(1,2,3) 17:24
camelia ( no output )
jnthn m: sub foo(*@a where all(@a) ~~ Int) { }; foo(1,"2",3)
camelia Constraint type check failed in binding to parameter '@a'; expected anonymous constraint to be met but got Array ($[1, "2", 3])
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
araraloren_ jnthn++ 17:25
samcv interestingly i've actually used my Font::QueryInfo a few times to find out what characters a font supports. it's pretty nice 17:29
DrForr_ I need to have someone else run this test suite to see if 3min is just me... 17:30
samcv font-query-all("FantasqueSansMono-Regular.ttf".IO)<charset>.grep({'a'.ord ~~ $_ }) 17:31
maybe i should add a convenience function to query if a font supports a certain character though i should probably cache the results maybe so i don't have to query the font a tons of times. though that's simple enough
timotimo DrForr_: linky please? 17:34
is this the perl6 parser one?
DrForr_ I don't have it up yet. 17:37
No, it's not.
DrForr_ github.com/drforr/perl6-Format-Lisp 17:43
timotimo oh, you implemented a complete programming language in perl6 17:54
timotimo how do you run the tests? 17:56
DrForr_ perl6 -Ilib t/01-parse-text.t # that's it. 17:58
And there's no language backing it yet, I'm just on the parser stage.
It's very much unoptimized, but having to wait for 3 minutes for a test suite to run is really cramping my style. 17:59
linuksz i have an array of objects. all objects has a $.time variable. i want to sort the array by the objects' $.time variable. is there any way to do that? 18:52
geekosaur @a.sort( { $^a.time cmp $^b.time } ) ? 18:54
AlexDaniel hm, what about .sort: { .time }
raschipi I suggest .sort({ .time }) to bridge this divide. 18:56
geekosaur looks like it should work, yes 18:57
linuksz now trying them.
geekosaur checking arity might be a bit of a surprise...
jnthn tends to write it .sort(*.time)
AlexDaniel yea
jnthn Note that it returns the sorted elements
Use @a.=sort(*.item) to do it in place 18:58
raschipi geekosaur: are you aware of other languages that check arity like this? 18:59
geekosaur most distinguish them by something more than arity in my experience 19:01
geekosaur it has the feel of ancient C varargs abuse, but (a) I'm not sure moderns know stuff that ancient to be worried about it (b) it was (K&R, even) C, so "arity" wasn't really a thing, making it much more fragile than it might otherwise be 19:04
raschipi It's overloaded on the arity of the first argument. It's a well stablished pattern. 19:06
sjn o/ 19:13
sena_kun o/
raschipi oi, sjn
sena_kun m: my @a = 1,2,3; say (@a xx 3).flat;
camelia (1 2 3 1 2 3 1 2 3)
moritz I really enjoyed this rant on (among other things) message brokers: programmingisterrible.com/post/1623...th-in-half 19:15
sena_kun m: my @a = 1,2,3; (6,6,6,6,6) Z~ (@a xx *).flat; 19:16
camelia Potential difficulties:
Useless use of Z~ in sink context
at <tmp>:1
------> 3my @a = 1,2,3; (6,6,6,6,6) 7⏏5Z~ (@a xx *).flat;
sena_kun Wow.
AlexDaniel wow what?
sena_kun I thought (@a xx *).flat should fail, but it just did what I wanted. 19:17
sjn m: subset Filename of Str where { *.IO.e // die "file $_ not found in $*CWD" }; sub MAIN (Filename $in = "in.txt") { ... }; # does not work
camelia Stub code executed
in sub MAIN at <tmp> line 1
in block <unit> at <tmp> line 1
sena_kun Perl 6 is "Wow, cool". :)
timotimo DrForr_: 7.57user 0.56system 0:08.17elapsed 99%CPU (0avgtext+0avgdata 2640112maxresident)k
AlexDaniel what did it do for you, by the way…
m: my @a = 1,2,3; say (6,6,6,6,6) Z~ (@a xx *).flat
camelia (61 62 63 61 62)
timotimo DrForr_: maybe your system is swapping?
AlexDaniel why does it stop on 62?
ah, oops 19:22
zengargoyle goes OH GAWD again as people are still trying to use an app I stopped developing in 2010.
AlexDaniel there are five 6-es… oops…
sena_kun AlexDaniel, I mean the cycling of list.
AlexDaniel sena_kun: how dare you put five 6s, not 6!
sjn Am I being too ambitious with subtypes in my code? ^^
AlexDaniel :)
sena_kun AlexDaniel, ;)
timotimo zengargoyle: people are still trying to use apps development stopped for in 1980 :)
zengargoyle not when the README says: WARNING: You probably shouldn't use this. 19:22
timotimo haha, "probably shouldn't"
raschipi Haha
nicq20 fire 19:22
seatek moritz: that was a great read :) full circle, really ;) 19:22
timotimo a full-circle developer? :D
zengargoyle still works on Debian. only Ubuntu f'd thing up enough to break it on and off. but it's also Gtk2 .... 19:22
timotimo DrForr_: i'd wager the vast majority of time is spent precompiling Grammar.pm6 19:23
i'm profiling the compile thereof now
zengargoyle and GNOME. i should have never ever gotten into making a GUI app.
zengargoyle it's trickled down to about one burst of emails every 6 months or so. 19:25
timotimo cool, only 1.7 megs of profile html file :S
pilne my quandry lies in that my interests lie in game logic/ai (as a hobbyist programmer) and would like to deploy to the android store, or as a webapp, but i smeggin hate gui stuffs... and i hate having to work outside of perl6, like, i go and work on rosetta code for perl6 to remind myself how fun coding is these days, everything else feels so... akward now lol. 19:26
timotimo fascinating, 50% time spent in GC
77% of inclusive time spent in mergesubstates 19:27
zengargoyle pilne: have you tried /r/dailyprogrammer? i should start doing that again. 19:28
pilne i haven't run outta fun on rosetta yet, but i'll definitely check it out zengargoyle
timotimo the program spends most of its time freeing up almost exactly half the nursery for the next run, then it shifts its behavior by going up from 7.5k gen2 roots to 44k gen2 roots and freeing 0% of the nursery each GC run 19:29
pilne as someone who used to love python's readability, ruby's "magic", and is always (usually unecesarily) worrying about multi-core-capable, perl6 just "gets it right"
timotimo i.e. catastrophic behavior 19:29
full GCs go up to about 1 second
pilne that does sound like something went charlie-foxtrot on your
s/your/you 19:30
timotimo coldfusion?
pilne cluster fuck (:
anyone ever built perl6 in termux?
timotimo termux? i only know tmux 19:31
pilne it is nifty, it's a little distro within an app.. that doesn't require a rooted phone 19:33
also have gnuroot-debian to mess with too
timotimo DrForr_: you read my stuff? 19:42
user3 I'm new to perl 6. Someone gave me this code to print all files recursively in the current directory. How can I modify it to print only the files with the extension .txt 19:46
say -> $p = $*CWD { $p.f ?? $p !! dir($p)>>.&?BLOCK.Slip }()
evalable6 (exit code 1) Failed to get the directory contents of '/home/bisectable/git/whateverable/all-modules/Tux/CSV/csv-rust-qckrdr': Failed to open dir: 2
in block <unit> at /tmp/6Q5N6Oz9GX line 1
user3 Other question: how can I post code without having it evaluated automatically? 19:47
raschipi user3, evalable6 will detect Perl6 code and run it, so you can't avoid it. 19:48
user3 # say -> $p = $*CWD { $p.f ?? $p !! dir($p)>>.&?BLOCK.Slip }()
ahah i just defeated evalable6 :-P
user3 :-P :-P :-P 19:49
:)
by the way, the code above works just fine 19:50
raschipi Then we need to go and run code evalable6 could run for us. 19:50
AlexDaniel well, evalable does this only if you start your message with “say” :)
timotimo say so if True 19:51
user3 I tried to add test => / txt$ / in the code above but that did no good
lucasb say it isn't so
raschipi say {it isn't so}
evalable6 raschipi, Full output: gist.github.com/d945ffca0c07fe40e4...f49093ceca
(exit code 1) 04===SORRY!04=== Error while compiling /tmp/bEo3rZnNQW
Prefix …
raschipi user3: you need grep 19:52
user3 in particular i tried to replace $p.f by ($p.f && !~~ /\.txt$/)
moritz $p.f && $p !~~ /.../ 19:53
user3 i also tried ($p.f && $p.extension !eq '.txt')
AlexDaniel yeah, and only if your message looks like code… :)
FROGGS I thought you need to filter the result of dir($p)
user3 yes 19:54
user3 but I dont quite understand the code above 19:54
it's too advanced for me at this stage
FROGGS your own or the suggestions?
user3 someone gave me this code
FROGGS -> $p { $p.f ?? $p !! dir($p)>>.&?BLOCK.Slip }($*CWD) 19:55
timotimo DrForr_: it'd probably cause the code to be wrong, but if i replace all | with || in token TOP Grammar.pm6 will finish compiling in about 15 seconds rather than 95
FROGGS this is the same
(basically)
timotimo well, 97 really
ohai FROGGS
FROGGS also this: sub foo ($p) { $p.f ?? $p !! dir($p)>>.&?BLOCK.Slip }; say foo($*CWD)
hi timotimo 19:56
user3: do you get what the last shown example does?
user3 FROGGS: i tried it, prints nothing
FROGGS it print a lot for me... 19:57
prints*
user3: I'm talking about the example with the foo subroutine
user3 oops it works now
AlexDaniel whispers “Rakudo::Internals.DIR-RECURSE” 19:58
user3 but how to I clean lyfilter out .txt 19:58
FROGGS -> $p { } # <--- this is an anonymous sub btw, with a parameter $p
user3 cleanly
* cleanly filter out .txt 19:59
yes
Geth doc: 9a369c76c8 | (Moritz Lenz)++ | doc/Language/regexes.pod6
Explain s[...] = replacement form of substitution
lucasb m: say < 1.foo 2.txt 3.bar 4.txt >.grep(*.ends-with('.txt')) 20:00
camelia (2.txt 4.txt)
DrForr_ timotimo: Thank you very much for the comment, doing tat shortly. 20:01
FROGGS this seems to work: sub foo ($p) { $p.f ?? $p !! dir($p)>>.&?BLOCK.Slip }; say foo($*CWD).grep(*.ends-with(".txt") 20:02
does .&?BLOCK make it recurse? 20:03
user3 i've lots of name of the user who gave me this great code 20:04
lol
lost
the name
FROGGS hehe
user3 moritz, i just noticed your suggestion. it works. thx 20:10
raschipi moritz: What he talks about in the end of the blogpost, a solution for discovery would something like mDNS, right? The problem with mDNS is that it doesn't work across subnets? 20:15
ugexe m: my $files = -> *@_ { my @d = @_.grep(*.d); grep *.defined, (&?BLOCK(@d.map(*.&dir)) if @d).Slip, @_.grep(*.f).Slip; }; say $files($*CWD).grep(*.extension eq "txt"); 20:18
camelia ("/home/camelia/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/auto/share/dist/File-ShareDir/subdir/sample.txt".IO "/home/camelia/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/auto/share/dist/File-ShareDir/sample.txt".IO "/home/camelia/per… 20:19
timotimo DrForr_: you're a tattoo artist?
user3 ugexe, i think you're the one who gave me this code
moritz raschipi: there are many approaches to service discovery
raschipi: I don't know which one(s) the author tried
ugexe that could be written better but `... with @whatever` gives &?BLOCK the wrong block 20:20
ufobat i want to have a $object as a key of hash, i dont need to retreive the object anymore so its okay thats it is being stringified
i am just afraid that $obj.perl doesnt allway get the same result
moritz but I can really understand his point about the convenience about using a message broker for service discovery; we do that at $work too
ufobat order of a hash or something..
ugexe make your own .perl method? 20:21
ufobat in perl5 i would do refaddr() from Scalar::Util 20:21
ugexe i think WHICH is for that
moritz ufobat: you could use an object hash for that, no? 20:22
ufobat moritz, I dont know them :( 20:22
but i think .WHICH is faster?
ugexe you would implement .WHICH doing something like hashing all the key/values you want to normalize 20:23
ufobat just reading docs.perl6.org/type/Hash#index-ent...bject_hash
El_Che raschipi: consul is also DNS based and not limited to a subnet 20:24
ufobat i think for my case the provied .WHICH is sufficient :) a different object instance shoud be a different key in the hash
raschipi DNS-SD too. 20:25
ufobat i think a object SetHash would be cool, but thats not possible, right? 20:27
moritz my: my %h{Any}; my $key = []; %h{ $key } = 42; say %h.keys[0].perl; # for ufobat
m: my %h{Any}; my $key = []; %h{ $key } = 42; say %h.keys[0].perl; # for ufobat
camelia [] 20:28
ufobat thanks for the help :) i know what to do now :) 20:30
travis-ci Doc build passed. Moritz Lenz 'Explain s[...] = replacement form of substitution' 20:35
travis-ci.org/perl6/doc/builds/248920240 github.com/perl6/doc/compare/6372a...369c76c881
awwaiid dear lazyweb: is there a regex replace that returns the value without modifying the var? 20:44
ah, maybe .subst 20:45
FROGGS r: my $a = 'abc'; say S/b/d/ given $a; say $a # awwaiid 20:48
camelia adc
abc
awwaiid fancy
AlexDaniel .tell moritz clog handles unicode rather poorly nowadays… ¦ appears as ¦ and I don't think this issue existed previously 22:01
yoleaux AlexDaniel: I'll pass your message to moritz.
Geth doc: e2754690c9 | (Jan-Olof Hendig)++ | doc/Type/IO/Handle.pod6
Some formatting adjustments
22:46
travis-ci Doc build errored. Jan-Olof Hendig 'Some formatting adjustments' 23:37
travis-ci.org/perl6/doc/builds/248971385 github.com/perl6/doc/compare/9a369...754690c9ba