»ö« 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 m: use nqp; use NQPHLL:from<NQP>; say HLL::Compiler.new.version 00:08
camelia This is version built on MoarVM version 2017.09.1-7-geeb664ea6
AlexDaniel almost
how do I get access to Perl6::Compiler?
Zoffix m: $*PERL.compiler.^name.say 00:10
camelia Compiler
Zoffix m: $*PERL.^name.say
camelia Perl
Zoffix shrugs 00:11
m: use nqp; nqp::getcomp("perl6").^name.say
camelia Perl6::Compiler
Zoffix \o/
MasterDuke m: use nqp; nqp::getcomp("perl6").version.say 00:12
camelia This is Rakudo version 2017.09-27-gda5c36c13 built on MoarVM version 2017.09.1-7-geeb664ea6
implementing Perl 6.c.
MasterDuke Zoffix++
Zoffix oh cool. Didn't know it was that easy. MasterDuke++ 00:15
huggable: version in code :is: Same output as from perl6 --version in code form: use nqp; nqp::getcomp("perl6").version.say 00:16
huggable Zoffix, Added version in code as Same output as from perl6 --version in code form: use nqp; nqp::getcomp("perl6").version.say
perlawhirl .tell as_ re: Supplier -> 6guts.wordpress.com/2015/12/05/get...christmas/ 00:17
yoleaux perlawhirl: I'll pass your message to as_.
AlexDaniel c: all use nqp; nqp::getcomp("perl6").version.say 00:22
committable6 AlexDaniel, gist.github.com/55b98bfe224373eacf...56f2be63c6
Zoffix has just discovered LaTeX 00:25
Man, this thing is dope! 00:26
AlexDaniel m: use nqp; nqp::getcomp("perl6").version; say ‘hello world’ 00:27
camelia This is Rakudo version 2017.09-27-gda5c36c13 built on MoarVM version 2017.09.1-7-geeb664ea6
implementing Perl 6.c.
AlexDaniel xD
Zoffix NQP wasn't even a thing in 2015.02 ?
before I meant
AlexDaniel c: 2015.01 nqp::getcomp("perl6").version
committable6 AlexDaniel, ¦2015.01: «This is perl6 version 2015.01 built on MoarVM version 2015.01»
AlexDaniel just not “use nqp
Zoffix ah k
AlexDaniel the problem is that this thing exits :D 00:28
Zoffix s: nqp::getcomp("perl6"), 'version', \()
SourceBaby Zoffix, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Could not find nqp::getcomp, did you forget 'use nqp;' ?␤at -e:6␤------> put sourcery( nqp::getcomp("perl6")<HERE>, 'version', \() )[1];␤
Zoffix s: (use nqp; nqp::getcomp("perl6")).head, 'version', \()
SourceBaby Zoffix, Something's wrong: ␤ERR: Could not find candidate that can do \()␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 29␤ in block <unit> at -e line 6␤␤
Zoffix s: (use nqp; nqp::getcomp("perl6")).tail, 'version', \()
SourceBaby Zoffix, Something's wrong: ␤ERR: Died with X::Multi::NoMatch␤ in block <unit> at -e line 6␤␤
AlexDaniel github.com/perl6/nqp/blob/862cde8e...r.nqp#L572 00:29
but the code to generate it is there, so…
Zoffix huggable: version in code :is: Same output as from perl6 --version in code form: use nqp; with nqp::getcomp("perl6") { say "This is {.implementation} version {.config<version>} built on {.backend.version_string}\nimplementing {.language_name} {.language_version}." } 00:33
huggable Zoffix, Added version in code as Same output as from perl6 --version in code form: use nqp; with nqp::getcomp("perl6") { say "This is {.implementation} version {.config<version>} built on {.backend.version_string}\nimplementing {.language_name} {.language_version}." }
sacomo Hi #perl6 00:52
AlexDaniel hello o/ 00:57
Zoffix <Zoffix> Man, this thing is dope! 01:02
Well, that was a short love affair. It crashes when I try to use Unicode ops in my code examples :(
sacomo: \o
MasterDuke huh, i would have thought latex would support unicode pretty well 01:05
Zoffix I think it's just the issue with the code highlighter I'm using (minted)
Zoffix I stand corrected. Apparently Unicode support is very problematic. All the possible solutions I find just talk about supporting some specific language or encoding specific chars only (which I guess works out for my case, since all I need a Rakudo's ops) 01:24
geekosaur well, not so much 'problematic' as 'expects such things to be handled by appropriate fonts and packages' 01:34
TeX/LaTeX has an 'interesting' worldview though, I admit
Zoffix Ah 01:35
geekosaur including that its users are trying to get special characters on devices that don't have any support for them, so its main focus is on providing ways to enter them 01:36
(specifically entering math equations on 'glass ttys') 01:37
Geth whateverable: 69330d1823 | (Aleks-Daniel Jakimenko-Aleksejev)++ | lib/Whateverable.pm6
Report rakudo version in 「uptime」
01:57
AlexDaniel code golf… and perl 6 :-/ 02:22
I guess I'm not doing anything useful tonight
AlexDaniel m: { say ‘hello’ } while $++ < 5 02:29
camelia ( no output )
AlexDaniel :S
AlexDaniel m: my $x = ‘foo’; say --$x 02:31
camelia fon
AlexDaniel feels like he is using something else, not perl 6
rngoodn I have not used perl6 yet, but am constantly trying out new languages and am now somewhat interested in perl6. I have been googling around and one thing I am worried about before putting any time into learning the language is it's speed. I did a quick test and calculating 20 turns of hanoi took 41 seconds on perl 6... same task took 0.8 secs in Julia (another "new" language I am playing with). I then tried 30 turns and gave up 02:49
waiting after 1300 seconds... this finishes in 7 secs in Julia. I have read that perl6 was released to be stable/working, but not optimized right now. What level of performance is perl6 targeting for the future? Python speeds? Java or C speeds? Or is it reasonable to believe it will always be very slow?
AlexDaniel rngoodn: hello o/ 02:52
rngoodn: what rakudo version are you using?
rngoodn 2017.07
AlexDaniel okay 02:53
rngoodn: “Or is it reasonable to believe it will always be very slow?” – here's the progress so far: tux.nl/Talks/CSV6/speed4.html
rngoodn: this graph does not necessarily represent performance for typical perl 6 program, but it is still pretty accurate
AlexDaniel rngoodn: people often look at perl5 when comparing performance, so often times we too set the goal to get as fast as perl5 if not faster 02:56
rngoodn: that's not easy, but we're moving into the right direction, as you can see :) 02:57
rngoodn: for some people it is fast enough today, but on average it is still slow 02:58
rngoodn: that said, if you have some particular code, you can sometimes make it faster by doing some easy tricks 02:59
e.g. native ints come to mind
or maybe you can parallelize something? Depending on the job, it may improve things 03:00
rngoodn Ok. Thanks much for the info. I am not a perl5 user, but in general perl5 performance is in the realm of python and the dynamic interpreted languages right? I also understand that speed is not anything.. I am a fan of common lisp and somewhat of python and enjoy using a very powerful high level language that is not necessarily "fast".
AlexDaniel rngoodn: yeah, you're right 03:00
rngoodn anything = everything*
AlexDaniel rngoodn: though python startup time is not as fast as perl5's :)
AlexDaniel rngoodn: short answer: yeah, sometimes it is slow. Working on it :) 03:02
AlexDaniel I wonder if benchable can generate a graph of startup time if you just give it say 42 03:03
may not work, but let's try…
benchable6: say 42
benchable6 AlexDaniel, ¦say: «Cannot find this revision (did you mean “all”?)»
AlexDaniel benchable6: releases say 42
benchable6 AlexDaniel, starting to benchmark the 23 given commits
AlexDaniel, benchmarked the given commits, now zooming in on performance differences 03:04
AlexDaniel, gist.github.com/b8f670f8fee44ecc4d...2bbd6590ad
AlexDaniel oops :D
AlexDaniel benchable6: releases say 42 # I'm guessing that's just noise 03:04
benchable6 AlexDaniel, starting to benchmark the 23 given commits
perlawhirl rngoodn: what hanoi code are you running? is it the one on RosettaCode? 03:05
rngoodn I am also a little worried that I don't find as many resources/articles/videos online for perl6 compared to other "new" languages. If it had been "1.0" since 2015 what is the reason for this? Are there any big projects/companies using perl6? Are many people still holding out using perl6 for some reason?
benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences
AlexDaniel, gist.github.com/fca6f434da23cc2a84...6a017595b5
AlexDaniel yep, noise
rngoodn: we got a bunch of books this year: perl6book.com/ 03:06
AlexDaniel rngoodn: as for articles… maybe you can help by blogging about it :) 03:07
perlawhirl the Hanoi sample on RosettaCode uses a Junction as a subset type constraint. simply using Int or no contraint should make things run at least twice as fast, but still not as fast python/perl5 03:08
AlexDaniel perlawhirl: that's a very good point 03:09
rngoodn pearlawhirl: It was on the wikipedia page en.wikipedia.org/wiki/Perl_6 .. close to the bottom. I noticed it and since I already have hanoi written up in a few languages I figures it would be a neat little test before diving into the language. Let me know it looks like a bad example for hanoi though.
perlawhirl *
perlawhirl rngoodn: ok, that one should be faster than the one from RosettaCode. 03:10
rngoodn Thank for answering all my questions everyone. You all have been very friendly. 03:12
perlawhirl Ultimately, Perl 6 is slower at some tasks compared to other languages... for some select tasks, it may be quicker. Time will tell how that changes, but bear in my that python and perl have been out since the 80's, and Perl 6 has been out for a few years
AlexDaniel rngoodn: can you try it without multi dispatch? 03:14
rngoodn: sub hanoi($n, $a = 'A', $b = 'B', $c = 'C') { return unless $n; … 03:15
this is about 5 times faster here 03:18
rngoodn AlexDaniel: Sure I can. I literally know no p6 though so I can't modify the code... I assume drip the "multi"... and add the base case... not familiar with your "return unless $n;" Can I use an equivalent to "if n > 0" for the base case? 03:19
drip=drop*
AlexDaniel rngoodn: correct. Something like this: gist.github.com/AlexDaniel/c1db30f...dfb6f70bd9 03:20
rngoodn AlexDaniel: Wow! 2.7 secs. Much faster. 03:22
AlexDaniel rngoodn: maybe also this shave off another 0.1s :) gist.github.com/AlexDaniel/ed05d09...3ddea5dad4
rngoodn for 20 steps without printing to std out... same test that took 41 secs with "multi" 03:23
AlexDaniel maybe $n > 0 would be more correct
rngoodn 2.33 for that one. Nice. 03:24
perlawhirl AlexDaniel: now slash your vars :D it will shave a little more off 03:25
AlexDaniel perlawhirl: I know another trick also…
rngoodn: try this: sub hanoi(int $n 03:26
perlawhirl rngoodn: not all Perl6 vars require a sigil, you can to: my \x = 5; print x; 03:27
these variables are able to be better optimised, so can be a little faster 03:28
gist.github.com/0racle/de5a1b39753...924cd96ebe
AlexDaniel perlawhirl: this does nothing here
perlawhirl that gist runs in about 1.4 seconds running on a linux vm on my crappy work laptop 03:29
printing to the terminal blows out the time, but most of that is IO buffering
AlexDaniel perlpilot: oh, actually, yes it does
perlpilot: sorry
perlawhirl: ^
perlawhirl im perlawhirl... but i know who you're talking to :D I should just go by orac1e like everwhere else :)
rngoodn 0.02 seconds with the type declaration. That is impressive. Exact same speed as my common lisp code for hanoi at 20 rings. 03:31
AlexDaniel does it produce the same output though? 03:31
rngoodn ah just a sec haha... that was an error... let me try it again
AlexDaniel should be faster than 2.33, maybe :) 03:32
rngoodn 1.07 seconds
AlexDaniel :o 03:33
perlawhirl rngoodn: the point is, currently sometimes to get fast performance in Perl 6, you have to write things in a less obvious way. the hope is that with enough time spent optimising, the obvious code can be made almost as fast
rngoodn still impressive that we have come from 41s -> 1s with small tweaks.
AlexDaniel we didn't make it less readable
In fact… maybe it's even more readable now… 03:34
AlexDaniel rngoodn: can I suggest something crazy? :) 03:39
rngoodn AlexDaniel: sure 03:40
AlexDaniel rngoodn: gist.github.com/AlexDaniel/c314002...ad79b67428
rngoodn: hold on… 03:41
rngoodn This is the intermediate language for the compiler right?
AlexDaniel rngoodn: yep
rngoodn: I updated the code, try the latest version gist.github.com/AlexDaniel/c314002...ad79b67428
rngoodn 0.91secs 03:42
AlexDaniel hm, interesting. It was more impressive here 03:43
I also thought that “nqp::if($n, …” can improve thing, but it doesn't 03:44
rngoodn: anyway, we can probably continue this for hours… :)
rngoodn AlexDaniel: Yeah. It was a fun experiment. Good to know that you can write code quick to prototype and then start typing things and what not to make it more performant within the same language. A sign that maybe the compiler can make some of these optimizations one day in the future too. 03:48
AlexDaniel rngoodn: correct 03:50
raschipi rngoodn: Also, it's really easy to do a quick prototype in Perl6 and then call into a C program after profiling. Perl6 has a ridiculously easy-to-use FFI. 03:53
AlexDaniel JRaspass is amazing 04:02
how he got 99 bottles of beer golf down to 212 characters is completely beyond me 04:03
I'm 34 characters off… 34!!
raschipi Can we get a gist?
AlexDaniel gist.github.com/AlexDaniel/673eb0d...81f4d32164 04:04
oh, I know
hm… maybe not… :-/ 04:05
well I have some ideas on how to shave off 10 more characters or so, but 34??? 04:07
fwiw unicode quotes are counted as 1 character 04:08
down to 238 04:14
doesn't help anyway
AlexDaniel 227 :O 04:40
227 but “Killed for exceeding 750ms timeout.” :D 04:44
grondilu m: multi f([$x] where $x %% 2) { $x div 2 }; say f([4]) 05:15
yoleaux 18 Sep 2017 18:43Z <Zoffix> grondilu: this uses non-standard features (slangs), but it makes chained ops work, I think: BEGIN { $?LANG.refine_slang('MAIN', role { token infix:sym«smaller» { <sym> <O('prec', 'm=', 'assoc', 'left', 'dba', 'chaining', 'iffy', 1, 'diffy', 1, 'pasttype', 'chain')> } } )}; sub infix:<smaller> { $^a < $^b }; say 1 smaller 2 smaller 3
camelia Cannot resolve caller infix:<%%>(Mu, Int); none of these signatures match:
()
($)
(Int:D \a, Int:D \b)
(\a, \b)
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu .tell Zoffix, nevermind it occured to me that I can attach an Int to my objects via a rank method, and then use $x.rank to sort them. 05:16
yoleaux grondilu: What kind of a name is "Zoffix,"?!
grondilu .tell Zoffix nevermind it occured to me that I can attach an Int to my objects via a rank method, and then use $x.rank to sort them.
yoleaux grondilu: I'll pass your message to Zoffix.
grondilu m: multi f([$x where $x %% 2]) { $x div 2 }; say f([4]) 05:17
camelia 2
grondilu m: multi f([$x where $x %% 2]) { $x div 2 }; say f([5]) 05:18
camelia Cannot resolve caller f([5]); none of these signatures match:
(@ (Any $x where { ... }))
in block <unit> at <tmp> line 1
grondilu So I guess the where clause must be inside the array
HoboWithAShotgun is this guy (www.perlmonks.org/?node_id=1199629) correct in saying "1.say" is some clever boxing or is a "1" actually a "real" object akin to a user defined class 05:27
geekosaur m: say 1.WHAT 05:28
camelia (Int)
geekosaur rakudo's not quite that clever yet to do nice auto(un)boxing, sadly. iirc it gets unboxed if passed to something that wants an unboxed int 05:30
HoboWithAShotgun I know. But that doesn't really you if there is some clever thing the parser does to pretend 1 to be an object but internally it is a primitive
s/really/really tell/
timotimo it's boxing, but i wouldn't necessarily call it clever 05:42
though tbh i'm not sure how exactly it's implemented
geekosaur I think it just boxes literals and then unboxes if something wants unboxed 05:44
timotimo at the compiler level it has a cool thing for literals called "Want"
geekosaur some of the past weird issues with unboxing and binding seemed to imply that
timotimo a 1 would be put into the AST as a QAST::Want with three children: an Int object, "Ii", and a native integer value 05:45
and later stages of the compiler can figure out if a native int can be used properly and throw away the boxed integer object
AlexDaniel 223 :D 06:28
AlexDaniel 209 … just by rewriting it without fancy stuff 06:52
grondilu m: class A does Real { has Int $.n; method Real { $!n % 3 } }; multi infix:<+>(A $a, A $b) { A.new: n => ($a.n +$b.n) % 3 }; my $a = A.new(:n(2)); say (foo => $a, foo => $a).Mix; 07:22
camelia MoarVM panic: Memory allocation failed; could not allocate 79872 bytes
grondilu m: class A { has Int $.n; method Real { $!n % 3 } }; multi infix:<+>(A $a, A $b) { A.new: n => ($a.n +$b.n) % 3 }; my $a = A.new(:n(2)); say (foo => $a, foo => $a).Mix; 07:24
camelia Mix(foo(4))
grondilu m: class A { has Int $.n; method Real { $!n % 3 } }; multi infix:<+>(A $a, A $b) { A.new: n => ($a.n +$b.n) % 3 }; my $a = A.new(:n(2)); say (foo => $a).Mix;
camelia Mix(foo(2))
grondilu m: say (foo => class {}.new).Mix 07:25
camelia Cannot resolve caller Real(<anon|60754768>: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
grondilu m: say (foo => class does Real {}.new).Mix
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse class definition
at <tmp>:1
------> 3say (foo => class does7⏏5 Real {}.new).Mix
expecting any of:
generic role
grondilu m: say (foo => class :: does Real {}.new).Mix
camelia MoarVM panic: Memory allocation failed; could not allocate 79872 bytes
lizmat clickbaits p6weekly.wordpress.com/2017/09/18/...me-booked/ 07:40
albertferrico hello everyone 07:52
moritz hi albertferrico 07:53
albertferrico I've just read about the fact that I can install perl6 on my raspberry pi and start building an app on "El Bailador". I tried to read the documentation of "El Bailador" but it seems to be unavailable
hi Moritz
does someone have the pdf of the "El Bailador" documentation? 07:54
moritz albertferrico: this one? leanpub.com/bailador
albertferrico I'm not sure 07:55
moritz what are you talking about, then?
albertferrico I'm talking about this site: bailador.net/documentation 07:56
moritz huh, ufobat and szabgab are offline 07:59
and I forgot my login on the bailador slack channel 08:00
albertferrico ah ok 08:01
moritz FYI, bailador.net is fixed (but albertferrico is gone) 09:27
AlexDaniel m: my@x=[^∞],{@([\+] @$_)}…∞; for 0..19 -> $z { put ‘1 ’, @x[^$z].map: {.[$z-$++]} } 09:54
camelia 1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
1 10 45 120 210 252 210 120 45 10 1
1 11 55 165 330 462 462 330 165 55 11 1
1 12 66 220 495 792 9…
AlexDaniel definitely not the shortest way to do it, but it's fun
Zoffix . 10:21
yoleaux 05:16Z <grondilu> Zoffix: nevermind it occured to me that I can attach an Int to my objects via a rank method, and then use $x.rank to sort them.
Zoffix OK. So the disappeared code highlightings are just a temporary caching issue; nothing to worry about: github.com/github/linguist/issues/...-330377122 10:24
Or this rather: github.com/github/linguist/issues/...-321189792 10:25
Zoffix m: say Date.new('2017-10-08') - Date.today 10:52
camelia 19
Zoffix mst: I'm 19 days short of a whole year sober :) 10:53
Zoffix m: say Date.new('2018-07-01') - Date.today 10:58
camelia 285
Zoffix Though, I suspect in 285 days, with the new laws up here in Canukistan, I'll pick up baking as a hobby :P
tbrowder hi #perl6 11:06
tbrowder Zoffix: i look forward to yr books, good luck! 11:06
ref sets: how do i add another member to a defined set? 11:07
Zoffix tbrowder: thanks. I hope to churn them out fast. 11:14
tbrowder: sets are immutable, you can only add to SetHash, and you can do that with $sh<foo>++ 11:15
or with $sh{@keys}>>++ if you have more than one key 11:16
Zoffix &
El_Che ===SORRY!=== 11:55
Found /opt/rakudo/bin/moar version 2017.09, which is too old. Wanted at least 2017.09.1
El_Che so, we have a subrelease as well this time? 11:55
AlexDaniel this time again, yes
but for moarvm only
El_Che ok, fixing the build
AlexDaniel so rakudo 2017.09 and moar 2017.09.1
El_Che AlexDaniel: by again I don't mean you, btw. It happens once in a while 11:56
AlexDaniel El_Che: I clearly see the pattern :) We now have appveyor CI on moarvm repo so hopefully this won't happen again 11:57
El_Che I kick travis to do the builds before I do it locally
so, good canary 11:58
I need to automate the release creation by travis
[Coke] Zoffix: (regarding latex) an ex-parrot person, simon cozens has made his own thing that fills a similar space that you might be interested in: sile-typesetter.org/ 12:04
Zoffix Thanks. 12:07
tbrowder Zoffix: ref sets thanks. I've used them a lot but never needed to add to them so now on to SetHash! 12:15
[Coke] grumbles at having to take a 3 page html doc and reformat it in movable type. 12:16
El_Che travis-ci.org/nxadm/rakudo-pkg/jobs/277273232 <--rakudo fails on fedora 26, so far it builds fine on other OS'es 12:17
including fedora 25: travis-ci.org/nxadm/rakudo-pkg/builds/277273227 12:18
Zoffix m: dd <a d e>.Set ∪ <a b c>.Set ∪ 42
camelia set(42,"e","d","b","a","c")
Zoffix tbrowder: ^ another way to add, where you don't have to deal with SetHash
tbrowder ok! 12:19
El_Che I meant "fails on fedora 25, works on fedora 26": rerunning the jib to make sure
Zoffix .in 10h fix make xtest on docs 12:25
yoleaux Zoffix: I'll remind you at 22:25Z
Geth doc: 6dc61f89d7 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
Remove reference to specific implementation's details

  .oO( this entire paragraph on implementing a custom `eqv`
probably doesn't belong here )
12:27
El_Che AlexDaniel: the previous rakudo built fine on Fedora 25, but fails on 26: travis-ci.org/nxadm/rakudo-pkg/job...3232#L1513 12:30
Ubuntu, Centos and Debian build fine
where there new dependencies added?
AlexDaniel El_Che: RT #132114
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=132114
Geth doc: e0b271a5c8 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
Document edge case eqv behaviour…

  …when comparing lazy iterables
12:41
Geth doc: 3702cc2b70 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
Remove superfluous «Note that»
13:05
AlexDaniel code-golf.io/ 13:32
maybe I can go to bed now…
timotimo oh wow, well done
you deserve some rest
Zoffix haha nice :) AlexDaniel++ 13:33
AlexDaniel arabic to roman is a boring task, don't really want to think about it 13:34
but Pascal's triangle…
somehow I can save 3 chars, and I just can't see it :/
grondilu Fibonacci in 18 chars. That's sorcery 13:52
tadzik that's... long 13:53
mspo how do you see the solutions?
tadzik ISTR we can 10: 1,1,*+*...* 13:54
grondilu you also must print the first 31 elements
ilmari m: say (1,1,*+*...*)[^31]
camelia (1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269)
grondilu oh wai 13:55
oh wait
I know
jast which is >20 characters
tadzik ah, but you have to print the first 31
AlexDaniel each on new line, yeah
… saves you two characters already
mspo: I think you can't 13:56
which is rather unusual
mspo useful
maybe the stack exchange one is better 13:57
too bad
AlexDaniel FWIW you'd never see tricks I used there in real code, so maybe it's good that you can't see it… :) 13:58
tadzik oh, 18 is some black magic then 13:58
AlexDaniel you can get 19 without black magic :) 13:59
but with ».say though
timotimo bad idea :)
AlexDaniel which is incorrect, but oh well…
grondilu I used .put 14:00
ilmari what's bad about ».say? 14:01
moritz &[+] isn't shorter than *+* :(
AlexDaniel ilmari: it prints stuff in random order
moritz ilmari: it doesn't process in order
AlexDaniel mspo: one problem with stack exchange is that they count the number of bytes 14:02
ilmari ah, indeed
AlexDaniel which is… uhhhhh…
ilmari «Note that all hyper operators are candidates for autothreading and will cause tears if the methods have side effects.»
mspo :)
mspo AlexDaniel: tough onn perl6 14:02
ilmari also, 832040) isn't any shorter than *)[^30] :( 14:05
moritz can't you hard-code the 31's pasc... what ilmari said :(
grondilu ilmari: I got somthing for that pat hehe
*part
moritz maybe if it's the first of the numbers that has a unique divisor
than you do do ...*%%5 or so
s/do/could/
grondilu 4chars are enough :) 14:06
oh wait
moritz m: for 2..99 { say $_ if 1346269 %% $_ } 14:07
camelia ( no output )
grondilu isn't there a unicode alt for ... ?
AlexDaniel
grondilu :)
AlexDaniel \o/
told ya, 19 isn't hard
grondilu still one char chort
timotimo chortles 14:09
ilmari feature requests: subscript digits for numbers in other bases: HU08₃₆ 14:10
s/ts/t/
AlexDaniel heh, another use for subscripts
timotimo time for a slang 14:11
ugexe is it normal for some systems copyfile api to not truncate by default? 14:19
timotimo it's windows we're talking about here ;) ;) 14:20
ugexe its win32/osx vs linux/bsd it looks like
timotimo i mean, surely it'll be useful to be able to open a file, seek to some place, and overwrite from there using the contents of another file
and having the kernel do the work for you is great if you have networked filesystems or something 14:21
ugexe but do people normally use copyfile for that?
timotimo don't think so
Zoffix With only 34 options, you could just do 34 ops :) 14:25
Oh wait, it won't know that HU is a number :) nevermind 14:26
AlexDaniel Zoffix: hey, I know that you know. Why does this happen? 14:32
m: $_ = 1; say $++ xx 5
camelia (0 1 2 3 4)
grondilu yeah me! I got the lead in Pascal's triangle :) 14:33
AlexDaniel :O
damn triangle
Zoffix AlexDaniel: what happens?
AlexDaniel grondilu++
Zoffix: well, why is it not 1 1 1 1 1?
jnthn xx thunks
Zoffix and you assigned 1 to $_, which isn't used by the code 14:34
AlexDaniel right
Zoffix m: for ^5 { say $++ }
camelia 0
1
2
3
4
jnthn Yeah, I was wondering what the $_ = 1 was for :-)
Zoffix AlexDaniel: ^ same as here, basically
AlexDaniel but if I do something like 14:35
m: $_ = 5; say .succ xx
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3$_ = 5; say .succ xx7⏏5<EOL>
expecting any of:
prefix
term
AlexDaniel m: $_ = 5; say .succ xx 5
camelia (6 6 6 6 6)
Zoffix Because you're not saving the result
$ is a state variable
and ++ saves the new value in it
m: $_ = 5; say $_.=succ xx 5 14:36
camelia (6 7 8 9 10)
AlexDaniel m: $_ = 5; say .=succ xx 5
camelia (6 7 8 9 10)
AlexDaniel okay
Zoffix huh
AlexDaniel yeah I have no idea 14:36
Zoffix m: $_ = 5; .=succ for ^5
camelia Cannot modify an immutable Int (0)
in block <unit> at <tmp> line 1
Zoffix m: $_ = 5; for ^5 -> $ { .=succ }
camelia ( no output )
AlexDaniel m: $_ = 5; say .++ xx 5
camelia (5 6 7 8 9)
Zoffix Weird, I thought .=foo didn't work. 14:37
Wonder if I thought that because in some cases it actually doesn't :)
(maybe I'm just confusing it with .»foo not working (not assuming $_ before the dot)
grondilu seems so, .=foo is a common idiom, like in .=new 14:38
Zoffix my $x .= new is, but can't say I saw .=new (with the $_ as the variable) 14:39
geekosaur that's just because it's something of an odd circumstance 14:41
Zoffix man the subscript slang doesn't wanna assemble :( 14:48
alexk m: class Foo is Int {}; my Foo $x .= new: 42; say $x; say $x.WHAT; 14:49
camelia Type check failed in assignment to $x; expected Foo but got Int (42)
in block <unit> at <tmp> line 1
Zoffix m: BEGIN { $?LANG.refine_slang: 'MAIN', role { token number:sym<subbase> { $<num>=<[0..9A..Za..z]>+ $<base>=<[₀₁₂₃₄₅₆₇₈₉]>+ } }, role { method number:sym<subbase> ($/) { my $base = $<base>.comb.reverse.map({.unival*10**$++}).sum; make $<num>.parse-base: $base; } }, }; say HU08₃₆ 14:49
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus postfix
at <tmp>:1
------> 3um>.parse-base: $base; } }, }; say HU087⏏5₃₆
expecting any of:
infix
infix stopper
postfix
statement end
Zoffix I guess the identifier+op matches first somehow. Oh well, too bad :)
alexk: Int.new returns an Int. 14:50
alexk: core classes aren't yet polished enough for easy subclassing like that. Especially something as basic as an Int
alexk Zoffix: It does work with an older rakudo version ... 14:51
Zoffix Then I bet it's because some buy added a patch to Int.new to fix something and it's still there. 14:52
s: 42, 'new', \()
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/bb45...Mu.pm#L112
Zoffix s/buy/guy/
s: 42, 'new', \(42)
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/bb45...Int.pm#L25
alexk Zoffix: I found this: blogs.perl.org/users/zoffix_znet/20...erl-6.html 14:53
Zoffix Ah, at least it wasn't totally useless: "Fix Int.new for large values"
Yeah, that patch is crap. It uses .Int to coerce to an Int 14:55
AlexDaniel ok 14:59
now how much do I need for this…
grondilu: :) 15:00
Zoffix m: use nqp; class Foo is Int { method new ($v) { nqp::p6bindattrinvres(self.bless, Int, q|$!value|, nqp::decont($v)) } }; my Foo $x .= new: 42; say $x; say $x.WHAT; 15:02
camelia P6opaque: representation mismatch when storing value (of type Int) to attribute (of type bigint)
in method new at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix Is there a way to get a bigint in HLL land? I see $*W has some QAST-building stuff for bigint constants, but is there a trick to build them in src/core/Int.pm for example? 15:03
timotimo whoops i got my terminal into a mode where arrow keys skip whole words and now i can't code any more? 15:04
Zoffix Are you sure your CTRL key isn't stuck? 15:04
Ctrl+arrows skips by words on my terminal
Zoffix m: use nqp; class Foo is Int { method new ($v) { nqp::box_i($v, self.WHAT); } }; my Foo $x .= new: 42; say $x; say $x.WHAT; 15:05
camelia 42
(Foo)
timotimo turns out my weechat wasn't running inside a tmux at all 15:05
Zoffix alexk: you can use ^ that in the meantime, I guess. It still has the problem that >64bit ints don't work right that the core patch fixed. Unsure what the fix is to make it work right and subclass right.
Zoffix m: use nqp; class Foo is Int { method new ($v) { nqp::p6bindattrinvres(self.bless, Int, q|$!value|, nqp::getattr(nqp::decont($v), Int, q|$!value|)) } }; my Foo $x .= new: 42; say $x; say $x.WHAT; 15:13
camelia (signal SEGV)
Zoffix fun
timotimo that shouldn't happen :) 15:14
Zoffix Filed: rt.perl.org/Ticket/Display.html?id=132126 15:15
moritz if you use the wrong types (for example getattr instead of getattr_i), a segfault may well happen
Geth doc: 67bc4c3f2f | (Wenzel P. P. Peppmeyer)++ (committed by Zoffix Znet) | doc/Type/IO/Socket/Async.pod6
Better example for IO::Socket::Async, closes #1546 (#1547)

  * Better example, closes #1546
  * Update Async.pod6
  * Update Async.pod6
15:16
timotimo moarvm should never segfault unless you use NativeCall to do evil things
moritz really?
timotimo yeah
jnthn In this case it should be boxing
Zoffix m: use nqp; class Foo is Int { method new ($v) { nqp::p6bindattrinvres(self.bless, Int, q|$!value|, nqp::getattr_i(nqp::decont($v), Int, q|$!value|)) } }; my Foo $x .= new: 42; say $x; say $x.WHAT;'
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'"
at <tmp>:1
------> 3Foo $x .= new: 42; say $x; say $x.WHAT;'7⏏5<EOL>
expecting any of:
single quotes
timotimo somehow the repr_data ends up being a null pointer
Zoffix m: use nqp; class Foo is Int { method new ($v) { nqp::p6bindattrinvres(self.bless, Int, q|$!value|, nqp::getattr_i(nqp::decont($v), Int, q|$!value|)) } }; my Foo $x .= new: 42; say $x; say $x.WHAT;
camelia P6opaque: representation mismatch when storing value (of type Int) to attribute (of type bigint)
in method new at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo in the copy_to reprop, apparently 15:17
P6opaque's copy_to i mean
jnthn But it's in a code path that's barely used, so...
Zoffix is there a nqp::box_bi or nqp::getattr_bi or nqp::box_a_bigint_into_this_subclas_of_int?
jnthn Zoffix: No, what you wrote should probably do it though
Zoffix OK. cool.
jnthn Except the SEGV
Zoffix :)
jnthn But what it should do is wrap the normally flattened-in bigint into a box on the getattr, and extract it on the bindattr 15:18
Zoffix .in 4d fix what you broke, bruh: rt.perl.org/Ticket/Display.html?id=132128 15:23
yoleaux Zoffix: I'll remind you on 23 Sep 2017 15:23Z
Zoffix alexk: I filed your issue as rt.perl.org/Ticket/Display.html?id=132128 and unless someone beats me to it, will try to fix before Monday. 15:24
alexk Zoffix: Thank you
AlexDaniel .tell Hotkeys I remember you liked golfing in perl 6 code-golf.io 15:28
yoleaux AlexDaniel: I'll pass your message to Hotkeys.
AlexDaniel .seen Hotkeys
yoleaux I saw Hotkeys 26 Jul 2017 19:09Z in #perl6: <Hotkeys> I'd have to go through my answers though
dogbert17 ==24818== ERROR: AddressSanitizer: SEGV on unknown address 0x00000000 (pc 0xb567a972 sp 0xbf9d4030 bp 0xbf9d4078 T0) 15:40
#0 0xb567a971 in copy_to /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/P6opaque.c:89
#1 0xb567e076 in bind_attribute /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/P6opaque.c:354
Zoffix ^^
Zoffix dogbert17++ thanks. 15:42
Maybe I'll play with it tonight. Hone in my newly acquired C-foo :) 15:43
timotimo huh, now that is fascinating. the copy_to of P6opaque is called on a p6bigint object 15:51
got the fix 15:53
Zoffix: sorry :(
Zoffix timotimo: nah, it's cool :) 15:54
I have plenty of other stuff to fix :D
timotimo i should spectest it before it goes in, though
Zoffix I'll write the tests and try to fix that Int.new bug 15:55
Geth doc: b8f14bf6c9 | (Zoffix Znet)++ (committed using GitHub Web editor) | html/.htaccess
De-404 /type/int* docs

So URLs in form /type/$some-type work for native int types
17:46
Zoffix m: class Foo is Int {}; my Foo $x .= new: 42; say $x; say $x.WHAT; 19:03
camelia 42
(Foo)
Zoffix alexk: there, fixed forever.
El_Che jnthn: rt.perl.org/Public/Bug/Display.html?id=132114 suggests you fixed the failing test on travis. However, I am building with moarvm 2017.09.1 on travis and it stills fails. Only the fedora 25 container while fedora 26, ubuntu *, debian * and centos 7 build fine 19:07
jnthn: travis-ci.org/nxadm/rakudo-pkg/jobs/277273232 19:08
I just restated the job as the bug suggest it's a random fail. So far it fails 2 out of 2
jnthn El_Che: Was fixed since the release 19:10
El_Che jnthn: then I am hitting something else since I use moarvm .1
jnthn .1 didn't have the fix, I meant 19:11
I fixed it yesterday or something
The test has been vulnerable to that failure since it was added some months ago, though.
El_Che Ah ok. Let's see if I get 3 out of 3
running now
will you publish a .2? 19:12
with the fix I mean?
jnthn No
El_Che ok
jnthn The problem has been in like 3-4 previous releases
El_Che first time I hit it and I build a lot 19:13
jnthn In that, the bug was in the code that was added when that test was also added
El_Che I build 9 pkgs at the time (4 OS, different x64 OS releases + 386 for ubuntu) 19:14
jnthn It's possible that something else made it more likely to appear, though
Of note, native calling got faster
El_Che I wonder why only fedora 25 has the problem in my setup 19:15
while 26 doesn't
jnthn For me it failed something like 1 time in 20
Or less
On a loaded system it was more like 1 time in 5
El_Che 2 out of 2 is of course not really representative
but 2 out of 2 was for each OS 19:16
sjn o/
sjn plays around with Cro today o/
El_Che (as in all pass, and the same fails)
sjn is the TLS work that's been done lately finished? (having some errors about "no shared cipher" with the default fake certs) 19:17
jnthn sjn: Haven't seen that one before. Though am still hunting github.com/jnthn/p6-io-socket-asyn.../issues/19 which is proving to be very hard to track down 19:18
jnthn bbi30
El_Che jnthn: the third run passed 19:18
jnthn: thx for the help! 19:22
sjn looks like the "no shared cipher" error message is made by openssl 19:45
geekosaur modern web servers have a lot of older ciphers disabled for security reasons 19:50
sjn hm. that would mean the default ciphers used by IO::Socket::Async::SSL and/or Cro::TLS are all old 19:52
I get that error when opening the cro service with my browser 19:53
(Firefox 55.0.2 on Ubuntu)
timotimo sjn: superuser.com/questions/109213/how...ite-offers - you could try the shell script in the second answer to see what cro offers 19:57
sjn timotimo: it seems that cro just quits and gives absolutely no output for openssl to parse 19:59
jnthn Got some stuff to do afk for the next while but github.com/jnthn/p6-io-socket-asyn...L.pm6#L291 is where to look in the code
For the default ciphers 20:00
El_Che wow. Even when building on my laptop, the one that fails is fedora 25 while the rest builds fine. Weird bug
timotimo oh, is this about the cro https client?
sjn timotimo: no, I'm setting up a service with cro 20:01
in fact, I'm trying the default service that cro stub creates
timotimo wow, and cro quits with that error, that looks a bit like an oversight :) 20:02
sjn Kinda strange that Cro::TLS::Listener just quits, isn't it?
timotimo just a case of a missing try i expect ;) 20:05
Zoffix moritz++ # fun example of primality test with regexes in the book :) 20:45
(also gives you the idea of where I am with proofreading; hoping to put in extra hours on the weekend, in addition to proofreading for about 40m a day on the bus) 20:46
and finish before Monday EST
firecat p6:say 5 21:01
timotimo m: say 5
camelia 5
timotimo seems like it really wants a space after the : 21:02
firecat p6: say 3;
camelia 3
firecat y
weabot Is there a way to just pass @argv as a variable whose modifications are kept from lisp_append_args sort of like a pointer? Instead of doing this: @argv = append_args(@argv, $0); 21:27
weabot this is thread specific and too temporary to be worth defining as a global variable 21:27
timotimo you can "temp @*ARGV" 21:28
perl6 -e 'say @*ARGS; { temp @*ARGS; unshift @*ARGS, $*PROGRAM-NAME; say @*ARGS; }; say @*ARGS' 1 2 3 21:29
try this
weabot these are only arguments to give to a subroutine that I parse and append myself 21:31
timotimo ooooh
you mean like this:
m: sub call-this($a, $b, $c) { say "a $a, b $b, c $c" }; sub add-nine(@*args) { call-this(9, |@args) }; add-nine("hi", "weabot") 21:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@args' is not declared. Did you mean '@*args'?
at <tmp>:1
------> 3}; sub add-nine(@*args) { call-this(9, |7⏏5@args) }; add-nine("hi", "weabot")
timotimo m: sub call-this($a, $b, $c) { say "a $a, b $b, c $c" }; sub add-nine(*@args) { call-this(9, |@args) }; add-nine("hi", "weabot")
camelia a 9, b hi, c weabot
weabot hmm 21:33
I think that's it yeah
timotimo cool
weabot actually that doesn't modify @args in the calling function if I'm understanding this correctly but I can make this work 21:34
timotimo m: sub call-this($a, $b, $c) { say "a $a, b $b, c $c" }; sub add-nine(*@args) { @args.unshift(9); call-this(|@args) }; add-nine("hi", "weabot") 21:35
camelia a 9, b hi, c weabot
timotimo you can modify @args in that function just fine :)
weabot ooh nice
weabot hmm 21:38
sub test (@argv) { @argv.append("arg3"); } my @argv = ["arg1", "arg2"]; test(@argv); put(@argv); 21:39
m: sub test (@argv) { @argv.append("arg3"); } my @argv = ["arg1", "arg2"]; test(@argv); put(@argv);
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3b test (@argv) { @argv.append("arg3"); }7⏏5 my @argv = ["arg1", "arg2"]; test(@argv
expecting any of:
in…
weabot you see, I want this to add "arg3" to @argv 21:40
m: sub test (@argv) { @argv.append("arg3"); }; my @argv = ["arg1", "arg2"]; test(@argv); put(@argv);
camelia arg1 arg2 arg3
weabot wait
is all I've ever believed wrong? do functions that are passed arrays modify them? 21:41
Zoffix yup 21:42
Same with any other object. 21:43
weabot is that if they don't have any return values or..?
Zoffix At all times
weabot how have I written so much perl 6 without knowing this, and without screwing things up? 21:44
holy hell
teatime Zoffix: so when would you have to use 'is rw' in signature?
Zoffix weabot: basically a function has no control over which methods you can call on the passed argument; it doesn't restrict them. So if you call methods like appending stuff or some other method that mutates the passed object, it's not gonna stop you and it'll mutate the original object that was passed. It doesn't implicitly clone it 21:45
weabot I've written 952 lines of code under the assumption that functions don't modify their arguments
I haven't modified an argument that I've reused in a single subroutine of that code 21:46
weabot that's impressive 21:46
Zoffix teatime: when you want the callee to give you a writeable container
teatime weabot: 1000 lines isn't so much, and also if you're like me you probably avoid modifying arguments even when the language assures them to be locals just for readability
timotimo teatime: if you want to re-assign to a scalar that got passed to your sub, that's when "is rw" can let you change stuff on the outside
weabot teatime yeah, it's just mind-blowing to me 21:47
Zoffix weabot: for FWIW, even Damian Conway made that mistake and said arrays won't modified during a talk I attended :)
So don't feel bad
weabot I mean I do avoid modifying arguments usually
Zoffix teatime: basically "is rw" just asks that the routine could write to the container that's given as an argument. It says nothing about immutability of the passed object 21:48
teatime Zoffix / timotimo : gotcha, I think I follow.
El_Che New Linux packages: github.com/nxadm/rakudo-pkg/releas.../2017.09.1 21:49
Zoffix \o/
El_Che++
teatime so if you 'is rw' a @-sigil'd argument, you can reassign a different Array to the @variable in the calling scope?
or is it just for $scalars
actually you don't really have to answer, I don't need to know / can go read instead 21:50
geekosaur or just try it, we do have a bot you know :p
weabot I'm surprised that rakudo wasn't ported to freebsd yet
I compiled it succesfully the other day on there
Zoffix teatime: it'll complain about it :) 21:51
m: -> @ is rw {}
camelia ( no output )
teatime geekosaur: every time I try to use the bot for a one-off test/example, I syntax error :) I have to fix up my bot stuff for a few minutes in REPL usually.
Zoffix m: -> @ is rw {}()
camelia Too few positionals passed; expected 1 argument but got 0
in block <unit> at <tmp> line 1
Zoffix orly
Zoffix m: sub (@ is rw) {}() 21:51
camelia Too few positionals passed; expected 1 argument but got 0
in sub at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: sub (@x is rw) {}()
camelia 5===SORRY!5=== Error while compiling <tmp>
For parameter '@x', '@' sigil containers don't need 'is rw' to be writable
Can only use 'is rw' on a scalar ('$' sigil) parameter, not '@x'
at <tmp>:1
Zoffix m: -> @x is rw {}()
camelia 5===SORRY!5=== Error while compiling <tmp>
For parameter '@x', '@' sigil containers don't need 'is rw' to be writable
Can only use 'is rw' on a scalar ('$' sigil) parameter, not '@x'
at <tmp>:1
geekosaur so do i. so I try to remember to do it in /query first :)
teatime Zoffix: and now, I remember reading that once :) 21:52
Zoffix teatime: FWIW, I found this article useful when trying to grasp the containers: docs.perl6.org/language/containers
geekosaur weabot, I vaguely recall there was a port back in the parrot days, the maintainer disappeared and it was dropped? 21:53
weabot let me double check my ports tree
nope, doesn't seem like it 21:54
weabot I mean it was dropped I guess 21:54
Zoffix Filed the inconsistency as rt.perl.org/Ticket/Display.html?id=132133
Ulti any reason why iterating through a file with encoding utf8-c8 takes 1m23s latin-1 takes 13s and default encoding is 16s? 22:22
my expectation was utf8-c8 would be less expensive than the default was that wrong?
timotimo there's a fast-path in the decoder for utf8, probably none for utf8-c8 22:24
yoleaux Zoffix: fix make xtest on docs 22:25
jnthn utf8-c8 is a lot more expensive, because it's got to keep track of a bunch more 22:28
Not only to be able to recover and produce synthetics on invalid bytes, but also to be able to cope with things that aren't in NFC 22:29
Zoffix yoleaux: I wanted to relax, bruh
Zoffix hopes there are few failures
jnthn Zoffix: I know that feeling :) 22:30
Ulti jnthn: are all the same sort of promises made about string ops/methods as with the normalised strings?
so stuff like length is based on graphemes?
jnthn With utf8-c8?
Ulti yeah
jnthn What are you using it for?
Ulti im not, just curious 22:31
jnthn If you feed it text in NFD, then it will actually store a synthetic grapheme per byte that makes that up, iirc
Ulti given that feels a bit like an impossible task
ok
jnthn The point of it is to let people pretend a filename is a Str
And appending '.bak' to it and feed it back to the OS and get the Right Thing happening 22:32
It's a pretty bad idea to use it for general input
Ulti all of this was also just kicked off by Zoffix mentioning perf on reddit :3 22:33
jnthn Yeah, normal utf8 decoding is fairly well optimized 22:33
Ulti I should probably write more stuff down but I think its been a whole number factor imporvement since last I checked
about 10x off of perl5 hacktastic strings that everyone secretly really wants >:P 22:34
if you made perl5 do exactly the same job it must be getting close now
jnthn Yes, for sufficiently large files to overcome the startup/optimizer time, `for $fh.lines { ... }` typically comes out ahead of Perl 5 if doing utf-8 decoding these days. 22:35
jnthn There's output buffering now too, so output is within a factor of about 1.2x or so 22:35
(Again, assuming utf8-8 encoding) 22:36
Ulti the real issue in the world is that bioinformatics uses ascii bytes for something that can be 2-3bit encoded 22:37
jnthn Yeah, I guess for bioinformatics folks, it's ASCII performance (or "I don't care" performance :-)) that really matters. 22:39
Ulti yeah :( plus everything is gzipped all the time everywhere because of the stupid encoding and DNA itself having lots of runs 22:40
raschipi Can Perl6 start using an ASCII fast path and only turn on the utf-8 path when it encounters a byte bigger than 127? 22:41
teatime Ulti: at least gzip is efficient for streaming
Ulti there is a bias in which letters of DNA have runs too... so you'd hope in a sane world youd pick the highest or lowest byte value for those to make it more compressable (obviously not)
teatime apart from they gzip small chunks and put them end to end 22:42
jnthn raschipi: It's largely already doing that, except NFG means you gotta look out for \r too
Ulti the idea being its then easy to jump in and index
but bzip2 already has that block concept built in :/ 22:43
raschipi Right, isn't that what dealing with DNA needs for performance?
Ulti basically 22:44
Im fairly sure its like 2x faster since I last checked this I could have sworn it was about 30s for a 1GB file
Ulti not DNA though just a giant CSV where 50% of it is DNA sequence which shouldnt matter one way or the other 22:45
jnthn Ulti: I did a bunch of work on I/O performance and got at least a factor of 2 on the benchmark I was looking at, so it's entirely possible :) 22:46
Ulti thats fairly awesome jnthn++ 22:47
I think the last time was around when Zoffix had done a bunch of work
lots of the mini "benchmarks" im doing you see Rakudo between ruby and perl5 quite often 22:48
Zoffix It might've been right after it. jnthn++ did the work. The only perf improvements I did was for Windows IO::Specs
raschipi Ulti: But you're making them do the same work as Perl6 is doing? 22:49
jnthn Ulti: Hm, that's not such a bad place to be. :-)
Especially when I know we've more to win yet :)
Ulti raschipi nope :)
jnthn It's just that the opts gradually get scarier. :-) 22:50
Ulti its probably worth doing a real like for like comparisson to other languages... having slower strings but the fastest most complete unicode implementation is surely a massive win for the world 22:51
and if "slower" is still apreciably as fast or faster than other popular languages used to process strings regularly its hardly a big deal 22:52
blog.honeybadger.io/ruby_unicode_normalization/ hmmmmm 22:56
weabot can I use variables in s/ replace? 22:57
like s/$var1/$var2/
Zoffix weabot: yes, what you show works
weabot thank you
timotimo hah, looks like "i can't not normalize my strings :(" is a luxury-problem compared to "i'd have to normalize strings all the damn time or things everywhere mess up"
Zoffix wamba[m]: $var1 gets interpreted as text though, not regex. use s/<$var1>/$var2/; to make it interpret it as a regex 22:58
Ulti I wonder if there is like the perfect unicode brown note type string that just breaks the world if you use it as input on websites
weabot Zoffix $var2 won't be interpreted as text?
raschipi weabot: Tha'ts what the $ is for. 22:59
weabot yeah I just assumed both are regex since it's all between //
jnthn Only the stuff between the first two are parsed as regex 23:00
The others are parsed like a quoted string
teatime weabot: the s/pattern/replacement/ operation takes a string for replacement in every language.
weabot alright
teatime weabot: plus usually some special syntax like \1 for backreferences
Ulti timotimo: yeah I think so to for the vast majority of software written today it makes complete sense to normalise all the things
weabot thank you :)
timotimo Ulti: until timo comes along and wants to write a json parser ;) 23:01
"but json is so simple!" i hear you say
Ulti I think almost everyone who has done international web stuff comes to regret their life choices when a blend of your web app JS and the database conspire to literally fart line noise to the user
timotimo no, nobody says that. everybody knows nowadays
teatime Zoffix: I'm curious how /<$var>/ and /<{$var}>/ differ
Ulti timotimo: well simpler than XML :P 23:02
jnthn teatime: iirc they're the same semantics, but the second will burn a tad more CPU cycles 23:03
<$var> looks up a variable and treats it as regex code to compile and run
Zoffix docs make xtext: All tests successful. 23:04
jnthn <{$var}> runs a block and treats its result as regex code, but if the block just looks up a variable then it's the same thing
teatime there was a previous discussion, seems like <$var> did something weird when used multiple times ...
jnthn Hmm 23:05
Zoffix weabot: there're .subst and .subst-mutate methods. They do the same thing as S/// and s///, but perhaps will be easier to understand how they work
jnthn Maybe I remember wrong then. It's either a long time since I implemented that feature, or a long time since I read the implementation of that feature. Long enough that I can't recall which I did. :-)
weabot Zoffix I understand better now, thanks, just needed some clarifications 23:06
basically it replaces every match from the first field with the string from the second
teatime jnthn: I doubt it, I have a bad memory
Zoffix weabot: not every, just the first. You need to use s:g/// to replace every
There's an article on S///, BTW: rakudo.party/post/Perl-6-S---Subst...n-Operator 23:07
weabot right
teatime jnthn: however, both <$var> and <{$var}> are difficult to find documentation on, e.g. docs.perl6.org/language/regexes does not mention "interpolation" or the string "<$" ... maybe worth a ticket?
jnthn teatime: I'd say so
teatime aside: having ^ and $ match begin/end-of-*string* + providing ^^ and $$ is a thing of beauty 23:09
jnthn :) 23:10
Sleep time for me; 'night
timotimo nite jnthn
Geth doc: 63190963a1 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Type/SetHash.pod6
add idiom for adding a new SetHash element

per example from Zoffix, needs utf8 quotes
23:23
Geth doc: 0e4fc28568 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/SetHash.pod6
Use utf8 quotes; add example for multiple keys

Also declare the variable; pretty sure make xtest would complain otherwise.
23:27
Zoffix retreats into zofcave for a week 23:28
timotimo have a good one!
tbrowder hm, right, i was just looking for something to follow the previous code--kind of a bummer we have to start over just for the test--kind of interrupts the discussion 23:30
i'm sure Zoffix can fix that!
timotimo isn't there some pod command that lets us put in code that gets run but not rendered? 23:31
but in general it's nice to have code you can actually copy-paste and run immediately
tbrowder um, you migh 23:33
tbrowder *might add a note highlighting the >> operator for old eyes on the multi add 23:34
s/old/weak/ 23:35
AlexDaniel grondilu: if you did pascal's triangle in 33 you should be able to do fibonacci in 18 23:58