Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-19

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 mr-foobar joined #perl6
00:03 cpage_ joined #perl6
00:08 headcase joined #perl6
00:08 AlexDaniel m: use nqp; use NQPHLL:from<NQP>; say HLL::Compiler.new.version
00:08 camelia rakudo-moar da5c36: OUTPUT: «This is  version  built on MoarVM version 2017.09.1-7-geeb664ea6␤»
00:08 AlexDaniel almost
00:08 AlexDaniel how do I get access to Perl6::Compiler?
00:10 Zoffix m: $*PERL.compiler.^name.say
00:10 camelia rakudo-moar da5c36: OUTPUT: «Compiler␤»
00:10 Zoffix m: $*PERL.^name.say
00:10 camelia rakudo-moar da5c36: OUTPUT: «Perl␤»
00:11 * Zoffix shrugs
00:11 Zoffix m: use nqp; nqp::getcomp("perl6").^name.say
00:11 camelia rakudo-moar da5c36: OUTPUT: «Perl6::Compiler␤»
00:11 Zoffix \o/
00:12 MasterDuke m: use nqp; nqp::getcomp("perl6").version.say
00:12 camelia rakudo-moar da5c36: OUTPUT: «This is Rakudo version 2017.09-27-gda5c36c13 built on MoarVM version 2017.09.1-7-geeb664ea6␤implementing Perl 6.c.␤»
00:12 MasterDuke Zoffix++
00:13 pyrimidine joined #perl6
00:15 pyrimidi_ joined #perl6
00:15 Zoffix oh cool. Didn't know it was that easy. MasterDuke++
00:16 Zoffix 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
00:17 perlawhirl .tell as_ re: Supplier -> https://6guts.wordpress.com/2015/12/05/getting-closer-to-christmas/
00:17 yoleaux perlawhirl: I'll pass your message to as_.
00:18 pyrimidine joined #perl6
00:19 cpage_ joined #perl6
00:20 pecastro joined #perl6
00:22 AlexDaniel c: all use nqp; nqp::getcomp("perl6").version.say
00:22 committable6 AlexDaniel, https://gist.github.com/55b98bfe224373eacfc02356f2be63c6
00:25 * Zoffix has just discovered LaTeX
00:26 Zoffix Man, this thing is dope!
00:26 mcmillhj joined #perl6
00:27 AlexDaniel m: use nqp; nqp::getcomp("perl6").version; say ‘hello world’
00:27 camelia rakudo-moar da5c36: OUTPUT: «This is Rakudo version 2017.09-27-gda5c36c13 built on MoarVM version 2017.09.1-7-geeb664ea6␤implementing Perl 6.c.␤»
00:27 AlexDaniel xD
00:27 Zoffix NQP wasn't even a thing in 2015.02 ?
00:27 Zoffix before I meant
00:27 AlexDaniel c: 2015.01 nqp::getcomp("perl6").version
00:27 committable6 AlexDaniel, ¦2015.01: «This is perl6 version 2015.01 built on MoarVM version 2015.01»
00:27 AlexDaniel just not “use nqp
00:27 AlexDaniel
00:27 Zoffix ah k
00:28 AlexDaniel the problem is that this thing exits :D
00:28 Zoffix s: nqp::getcomp("perl6"), 'version', \()
00:28 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];␤
00:28 Zoffix s: (use nqp; nqp::getcomp("perl6")).head, 'version', \()
00:28 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␤␤
00:28 Zoffix s: (use nqp; nqp::getcomp("perl6")).tail, 'version', \()
00:28 SourceBaby Zoffix, Something's wrong: ␤ERR: Died with X::Multi::NoMatch␤  in block <unit> at -e line 6␤␤
00:29 AlexDaniel https://github.com/perl6/nqp/blob/862cde8ed431bce5aec64130737cfeafc10e7fc9/src/HLL/Compiler.nqp#L572
00:29 AlexDaniel but the code to generate it is there, so…
00:31 mr-foobar joined #perl6
00:31 pyrimidine joined #perl6
00:33 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}." }
00:37 mcmillhj joined #perl6
00:47 cpage_ joined #perl6
00:51 Cabanossi joined #perl6
00:52 sacomo Hi #perl6
00:57 AlexDaniel hello o/
01:02 Zoffix <Zoffix> Man, this thing is dope!
01:02 Zoffix Well, that was a short love affair. It crashes when I try to use Unicode ops in my code examples :(
01:02 Zoffix sacomo: \o
01:03 mr-foobar joined #perl6
01:04 cpage_ joined #perl6
01:04 headcase_ joined #perl6
01:05 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)
01:11 mcmillhj joined #perl6
01:22 mcmillhj joined #perl6
01:24 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:26 cpage_ joined #perl6
01:27 headcase joined #perl6
01:31 cdg joined #perl6
01:34 geekosaur well, not so much 'problematic' as 'expects such things to be handled by appropriate fonts and packages'
01:34 geekosaur TeX/LaTeX has an 'interesting' worldview though, I admit
01:35 Zoffix Ah
01:36 zakharyas joined #perl6
01:36 Cabanossi joined #perl6
01:36 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:37 geekosaur (specifically entering math equations on 'glass ttys')
01:42 mcmillhj joined #perl6
01:54 ilbot3 joined #perl6
01:54 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:57 Geth ¦ whateverable: 69330d1823 | (Aleks-Daniel Jakimenko-Aleksejev)++ | lib/Whateverable.pm6
01:57 Geth ¦ whateverable: Report rakudo version in 「uptime」
01:57 Geth ¦ whateverable: review: https://github.com/perl6/whateverable/commit/69330d1823
02:04 noganex joined #perl6
02:04 pecastro joined #perl6
02:06 audiatorix joined #perl6
02:16 skids joined #perl6
02:22 AlexDaniel code golf… and perl 6 :-/
02:22 AlexDaniel I guess I'm not doing anything useful tonight
02:29 AlexDaniel m: { say ‘hello’ } while $++ < 5
02:29 camelia rakudo-moar da5c36: ( no output )
02:29 AlexDaniel :S
02:30 mr-foobar joined #perl6
02:31 AlexDaniel m: my $x = ‘foo’; say --$x
02:31 camelia rakudo-moar da5c36: OUTPUT: «fon␤»
02:31 * AlexDaniel feels like he is using something else, not perl 6
02:39 mcmillhj joined #perl6
02:41 rngoodn joined #perl6
02:45 headcase joined #perl6
02:47 adu joined #perl6
02:49 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 rngoodn 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?
02:49 mcmillhj joined #perl6
02:52 AlexDaniel rngoodn: hello o/
02:52 AlexDaniel rngoodn: what rakudo version are you using?
02:52 rngoodn 2017.07
02:53 AlexDaniel okay
02:53 AlexDaniel rngoodn: “Or is it reasonable to believe it will always be very slow?” – here's the progress so far: http://tux.nl/Talks/CSV6/speed4.html
02:53 AlexDaniel rngoodn: this graph does not necessarily represent performance for typical perl 6 program, but it is still pretty accurate
02:56 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:57 AlexDaniel rngoodn: that's not easy, but we're moving into the right direction, as you can see :)
02:58 AlexDaniel rngoodn: for some people it is fast enough today, but on average it is still slow
02:59 AlexDaniel rngoodn: that said, if you have some particular code, you can sometimes make it faster by doing some easy tricks
02:59 AlexDaniel e.g. native ints come to mind
03:00 AlexDaniel 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".
03:00 mcmillhj joined #perl6
03:00 AlexDaniel rngoodn: yeah, you're right
03:00 rngoodn anything = everything*
03:00 AlexDaniel rngoodn: though python startup time is not as fast as perl5's :)
03:02 AlexDaniel rngoodn: short answer: yeah, sometimes it is slow. Working on it :)
03:02 mr-foobar joined #perl6
03:03 AlexDaniel I wonder if benchable can generate a graph of startup time if you just give it say 42
03:03 AlexDaniel may not work, but let's try…
03:03 AlexDaniel benchable6: say 42
03:03 benchable6 AlexDaniel, ¦say: «Cannot find this revision (did you mean “all”?)»
03:03 AlexDaniel benchable6: releases say 42
03:03 benchable6 AlexDaniel, starting to benchmark the 23 given commits
03:04 benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences
03:04 benchable6 AlexDaniel, https://gist.github.com/b8f670f8fee44ecc4deeea2bbd6590ad
03:04 AlexDaniel oops :D
03:04 AlexDaniel benchable6: releases say 42 # I'm guessing that's just noise
03:04 benchable6 AlexDaniel, starting to benchmark the 23 given commits
03:05 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?
03:05 benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences
03:05 benchable6 AlexDaniel, https://gist.github.com/fca6f434da23cc2a84fc8e6a017595b5
03:05 AlexDaniel yep, noise
03:06 AlexDaniel rngoodn: we got a bunch of books this year: https://perl6book.com/
03:07 AlexDaniel rngoodn: as for articles… maybe you can help by blogging about it :)
03:08 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:09 AlexDaniel perlawhirl: that's a very good point
03:09 rngoodn pearlawhirl: It was on the wikipedia page https://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.
03:09 rngoodn perlawhirl *
03:10 perlawhirl rngoodn: ok, that one should be faster than the one from RosettaCode.
03:12 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
03:14 AlexDaniel rngoodn: can you try it without multi dispatch?
03:15 AlexDaniel rngoodn: sub hanoi($n, $a = 'A', $b = 'B', $c = 'C') { return unless $n; …
03:18 AlexDaniel this is about 5 times faster here
03:18 raschipi joined #perl6
03:19 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 rngoodn drip=drop*
03:19 mcmillhj joined #perl6
03:20 AlexDaniel rngoodn: correct. Something like this: https://gist.github.com/AlexDaniel/c1db30f0fce549d71c844fdfb6f70bd9
03:22 rngoodn AlexDaniel: Wow! 2.7 secs. Much faster.
03:22 AlexDaniel rngoodn: maybe also this shave off another 0.1s :) https://gist.github.com/AlexDaniel/ed05d0901eac888af299ec3ddea5dad4
03:23 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
03:24 rngoodn 2.33 for that one. Nice.
03:25 perlawhirl AlexDaniel: now slash your vars :D it will shave a little more off
03:25 AlexDaniel perlawhirl: I know another trick also…
03:26 AlexDaniel rngoodn: try this: sub hanoi(int $n
03:27 perlawhirl rngoodn: not all Perl6 vars require a sigil, you can to: my \x = 5; print x;
03:28 perlawhirl these variables are able to be better optimised, so can be a little faster
03:28 perlawhirl https://gist.github.com/0racle/de5a1b3975366345d02b46924cd96ebe
03:28 AlexDaniel perlawhirl: this does nothing here
03:29 perlawhirl that gist runs in about 1.4 seconds running on a linux vm on my crappy work laptop
03:29 perlawhirl printing to the terminal blows out the time, but most of that is IO buffering
03:29 AlexDaniel perlpilot: oh, actually, yes it does
03:29 AlexDaniel perlpilot: sorry
03:29 AlexDaniel perlawhirl: ^
03:29 perlawhirl im perlawhirl... but i know who you're talking to :D I should just go by orac1e like everwhere else :)
03:31 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 mr-foobar joined #perl6
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
03:32 AlexDaniel should be faster than 2.33, maybe :)
03:32 rngoodn 1.07 seconds
03:33 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
03:33 rngoodn still impressive that we have come from 41s -> 1s with small tweaks.
03:33 AlexDaniel we didn't make it less readable
03:34 AlexDaniel In fact… maybe it's even more readable now…
03:35 mcmillhj joined #perl6
03:35 Cabanossi joined #perl6
03:39 AlexDaniel rngoodn: can I suggest something crazy? :)
03:40 rngoodn AlexDaniel: sure
03:40 AlexDaniel rngoodn: https://gist.github.com/AlexDaniel/c31400216809502871b082ad79b67428
03:41 AlexDaniel rngoodn: hold on…
03:41 rngoodn This is the intermediate language for the compiler right?
03:41 AlexDaniel rngoodn: yep
03:41 AlexDaniel rngoodn: I updated the code, try the latest version https://gist.github.com/AlexDaniel/c31400216809502871b082ad79b67428
03:42 rngoodn 0.91secs
03:43 AlexDaniel hm, interesting. It was more impressive here
03:44 AlexDaniel I also thought that “nqp::if($n, …” can improve thing, but it doesn't
03:44 AlexDaniel rngoodn: anyway, we can probably continue this for hours… :)
03:48 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:50 cuonglm joined #perl6
03:50 AlexDaniel rngoodn: correct
03:53 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 mcmillhj joined #perl6
03:54 aborazmeh joined #perl6
03:54 aborazmeh joined #perl6
04:02 AlexDaniel JRaspass is amazing
04:03 AlexDaniel how he got 99 bottles of beer golf down to 212 characters is completely beyond me
04:03 AlexDaniel I'm 34 characters off… 34!!
04:03 raschipi Can we get a gist?
04:04 AlexDaniel https://gist.github.com/AlexDaniel/673eb0dc43405af63171b081f4d32164
04:04 AlexDaniel oh, I know
04:05 AlexDaniel hm… maybe not… :-/
04:07 AlexDaniel well I have some ideas on how to shave off 10 more characters or so, but 34???
04:08 AlexDaniel fwiw unicode quotes are counted as 1 character
04:14 AlexDaniel down to 238
04:14 AlexDaniel doesn't help anyway
04:21 mcmillhj joined #perl6
04:33 mr-foobar joined #perl6
04:35 cdg joined #perl6
04:37 Ven`` joined #perl6
04:40 AlexDaniel 227 :O
04:44 AlexDaniel 227 but “Killed for exceeding 750ms timeout.” :D
04:50 Cabanossi joined #perl6
04:55 mcmillhj joined #perl6
05:04 mr-foobar joined #perl6
05:06 wamba joined #perl6
05:14 grondilu joined #perl6
05:15 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
05:15 camelia rakudo-moar da5c36: OUTPUT: «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␤␤»
05:16 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,"?!
05:16 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: I'll pass your message to Zoffix.
05:17 grondilu m: multi f([$x where $x %% 2]) { $x div 2 }; say f([4])
05:17 camelia rakudo-moar da5c36: OUTPUT: «2␤»
05:18 grondilu m: multi f([$x where $x %% 2]) { $x div 2 }; say f([5])
05:18 camelia rakudo-moar da5c36: OUTPUT: «Cannot resolve caller f([5]); none of these signatures match:␤    (@ (Any $x where { ... }))␤  in block <unit> at <tmp> line 1␤␤»
05:18 grondilu So I guess the where clause must be inside the array
05:25 HoboWithAShotgun joined #perl6
05:27 HoboWithAShotgun is this guy (http://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:28 geekosaur m: say 1.WHAT
05:28 camelia rakudo-moar da5c36: OUTPUT: «(Int)␤»
05:29 mcmillhj joined #perl6
05:30 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
05:30 HoboWithAShotgun s/really/really tell/
05:32 mr-foobar joined #perl6
05:42 timotimo it's boxing, but i wouldn't necessarily call it clever
05:42 timotimo though tbh i'm not sure how exactly it's implemented
05:44 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"
05:44 geekosaur some of the past weird issues with unboxing and binding seemed to imply that
05:45 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 timotimo and later stages of the compiler can figure out if a native int can be used properly and throw away the boxed integer object
05:46 xtreak joined #perl6
05:48 nadim joined #perl6
05:49 mcmillhj joined #perl6
05:50 Cabanossi joined #perl6
06:05 Juerd joined #perl6
06:05 nightfrog joined #perl6
06:05 perlawhirl joined #perl6
06:06 mr-foobar joined #perl6
06:06 Grauwolf joined #perl6
06:06 albongo joined #perl6
06:06 iviv joined #perl6
06:07 john51 joined #perl6
06:08 committable6 joined #perl6
06:10 gfldex joined #perl6
06:10 jnap_ joined #perl6
06:10 damnlie joined #perl6
06:10 chansen_ joined #perl6
06:13 ChoHag joined #perl6
06:20 mcmillhj joined #perl6
06:24 darutoko joined #perl6
06:28 AlexDaniel 223 :D
06:34 andrzejku joined #perl6
06:35 Cabanossi joined #perl6
06:36 mr-foobar joined #perl6
06:36 mcmillhj joined #perl6
06:38 andrzejku joined #perl6
06:40 robinsmidsrod joined #perl6
06:40 domidumont joined #perl6
06:45 leont joined #perl6
06:47 rindolf joined #perl6
06:47 andrzejku joined #perl6
06:50 robinsmidsrod joined #perl6
06:51 mcmillhj joined #perl6
06:52 AlexDaniel 209 … just by rewriting it without fancy stuff
06:56 setty1 joined #perl6
07:01 knobo joined #perl6
07:02 jonas1 joined #perl6
07:05 mr-foobar joined #perl6
07:05 mcmillhj joined #perl6
07:12 cschwenz joined #perl6
07:16 mienaikage joined #perl6
07:19 wamba joined #perl6
07:21 lowbro joined #perl6
07:21 lowbro joined #perl6
07:22 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 rakudo-moar da5c36: OUTPUT: «MoarVM panic: Memory allocation failed; could not allocate 79872 bytes␤»
07:24 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 rakudo-moar da5c36: OUTPUT: «Mix(foo(4))␤»
07:24 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;
07:24 camelia rakudo-moar da5c36: OUTPUT: «Mix(foo(2))␤»
07:25 grondilu m: say (foo => class {}.new).Mix
07:25 camelia rakudo-moar da5c36: OUTPUT: «Cannot resolve caller Real(<anon|60754768>: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
07:25 grondilu m: say (foo => class does Real {}.new).Mix
07:25 camelia rakudo-moar da5c36: OUTPUT: «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␤»
07:25 grondilu m: say (foo => class :: does Real {}.new).Mix
07:25 camelia rakudo-moar da5c36: OUTPUT: «MoarVM panic: Memory allocation failed; could not allocate 79872 bytes␤»
07:25 Ven`` joined #perl6
07:32 mr-foobar joined #perl6
07:33 mcmillhj joined #perl6
07:33 cpage_ joined #perl6
07:36 cdg joined #perl6
07:40 * lizmat clickbaits https://p6weekly.wordpress.com/2017/09/18/2017-38-color-me-booked/
07:42 xinming joined #perl6
07:44 AelxDnaiel joined #perl6
07:44 tadzik joined #perl6
07:44 unclechu joined #perl6
07:44 tyil[m] joined #perl6
07:44 mack[m] joined #perl6
07:44 Garland_g[m] joined #perl6
07:44 M-Illandan joined #perl6
07:44 wictory[m] joined #perl6
07:44 wamba[m] joined #perl6
07:44 Matthew[m] joined #perl6
07:44 ilmari[m] joined #perl6
07:44 CIAvash[m] joined #perl6
07:44 xui_nya[m] joined #perl6
07:44 sproctor joined #perl6
07:52 albertferrico joined #perl6
07:52 albertferrico hello everyone
07:52 dakkar joined #perl6
07:53 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
07:53 albertferrico hi Moritz
07:54 albertferrico does someone have the pdf of the "El Bailador" documentation?
07:54 moritz albertferrico: this one? https://leanpub.com/bailador
07:55 albertferrico I'm not sure
07:55 moritz what are you talking about, then?
07:56 albertferrico I'm talking about this site: http://bailador.net/documentation
07:59 moritz huh, ufobat and szabgab are offline
08:00 moritz and I forgot my login on the bailador slack channel
08:01 albertferrico ah ok
08:02 mcmillhj joined #perl6
08:03 mr-foobar joined #perl6
08:12 mcmillhj joined #perl6
08:16 raschipi joined #perl6
08:18 krunen joined #perl6
08:18 krunen joined #perl6
08:22 krunen joined #perl6
08:23 krunen joined #perl6
08:26 robertle joined #perl6
08:33 domidumont joined #perl6
08:35 mr-foobar joined #perl6
08:41 xtreak joined #perl6
08:42 mcmillhj joined #perl6
08:48 zakharyas joined #perl6
08:53 mcmillhj joined #perl6
09:00 wamba joined #perl6
09:05 mcmillhj joined #perl6
09:27 moritz FYI, bailador.net is fixed (but albertferrico is gone)
09:34 mr-foobar joined #perl6
09:37 piojo joined #perl6
09:43 cdg joined #perl6
09:45 cdg_ joined #perl6
09:46 cdg__ joined #perl6
09:48 zakharyas joined #perl6
09:50 Cabanossi joined #perl6
09:53 El_Che joined #perl6
09:54 AlexDaniel m: my@x=[^∞],{@([\+] @$_)}…∞; for 0..19 -> $z { put ‘1 ’, @x[^$z].map: {.[$z-$++]} }
09:54 camelia rakudo-moar 3e3581: OUTPUT: «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…»
09:54 AlexDaniel definitely not the shortest way to do it, but it's fun
09:57 mcmillhj joined #perl6
09:57 cdg joined #perl6
09:59 cdg_ joined #perl6
10:01 cdg__ joined #perl6
10:04 mr-foobar joined #perl6
10:04 eliasr joined #perl6
10:08 mcmillhj joined #perl6
10:15 benchable6 joined #perl6
10:15 unicodable6 joined #perl6
10:18 wamba joined #perl6
10:19 Aaronepower joined #perl6
10:20 margeas joined #perl6
10:21 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.
10:23 xtreak joined #perl6
10:24 Zoffix OK. So the disappeared code highlightings are just a temporary caching issue; nothing to worry about: https://github.com/github/linguist/issues/3763#issuecomment-330377122
10:25 Zoffix Or this rather: https://github.com/github/linguist/issues/3763#issuecomment-321189792
10:26 xtreak_ joined #perl6
10:30 S007 joined #perl6
10:34 mr-foobar joined #perl6
10:35 Cabanossi joined #perl6
10:37 knobo joined #perl6
10:38 mcmillhj joined #perl6
10:48 krunen joined #perl6
10:49 mcmillhj joined #perl6
10:52 Zoffix m: say Date.new('2017-10-08') - Date.today
10:52 camelia rakudo-moar 3e3581: OUTPUT: «19␤»
10:53 Zoffix mst: I'm 19 days short of a whole year sober :)
10:55 krunen joined #perl6
10:58 Zoffix m: say Date.new('2018-07-01') - Date.today
10:58 camelia rakudo-moar 3e3581: OUTPUT: «285␤»
10:58 Zoffix Though, I suspect in 285 days, with the new laws up here in Canukistan, I'll pick up baking as a hobby :P
11:05 Cabanossi joined #perl6
11:06 tbrowder hi #perl6
11:06 mr-foobar joined #perl6
11:06 tbrowder Zoffix: i look forward to yr books, good luck!
11:07 tbrowder ref sets: how do i add another member to a defined set?
11:14 Zoffix tbrowder: thanks. I hope to churn them out fast.
11:15 Zoffix tbrowder: sets are immutable, you can only add to SetHash, and you can do that with $sh<foo>++
11:16 Zoffix or with $sh{@keys}>>++ if you have more than one key
11:16 * Zoffix &
11:24 mcmillhj joined #perl6
11:27 konsolebox joined #perl6
11:29 xtreak joined #perl6
11:34 mr-foobar joined #perl6
11:35 Cabanossi joined #perl6
11:35 pierrot joined #perl6
11:36 mcmillhj joined #perl6
11:38 timo1 joined #perl6
11:50 nattefrost joined #perl6
11:51 mcmillhj joined #perl6
11:52 ShalokShalom_ joined #perl6
11:55 El_Che ===SORRY!===
11:55 El_Che Found /opt/rakudo/bin/moar version 2017.09, which is too old. Wanted at least 2017.09.1
11:55 El_Che so, we have a subrelease as well this time?
11:55 AlexDaniel this time again, yes
11:55 AlexDaniel but for moarvm only
11:55 El_Che ok, fixing the build
11:55 AlexDaniel so rakudo 2017.09 and moar 2017.09.1
11:56 El_Che AlexDaniel: by again I don't mean you, btw. It happens once in a while
11:57 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
11:58 El_Che so, good canary
11:58 El_Che I need to automate the release creation by travis
12:04 [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: http://sile-typesetter.org/
12:05 mr-foobar joined #perl6
12:05 Cabanossi joined #perl6
12:07 Zoffix Thanks.
12:09 itaipu joined #perl6
12:15 tbrowder Zoffix: ref sets thanks. I've used them a lot but never needed to add to them so now on to SetHash!
12:16 * [Coke] grumbles at having to take a 3 page html doc and reformat it in movable type.
12:17 El_Che https://travis-ci.org/nxadm/rakudo-pkg/jobs/277273232 <--rakudo fails on fedora 26, so far it builds fine on other OS'es
12:18 El_Che including fedora 25: https://travis-ci.org/nxadm/rakudo-pkg/builds/277273227
12:18 Zoffix m: dd <a d e>.Set ∪ <a b c>.Set ∪ 42
12:18 camelia rakudo-moar 3e3581: OUTPUT: «set(42,"e","d","b","a","c")␤»
12:18 Zoffix tbrowder: ^ another way to add, where you don't have to deal with SetHash
12:18 Aaronepower joined #perl6
12:18 xinming_ joined #perl6
12:19 tbrowder ok!
12:19 El_Che I meant "fails on fedora 25, works on fedora 26": rerunning the jib to make sure
12:21 mcmillhj joined #perl6
12:25 Zoffix .in 10h fix make xtest on docs
12:25 yoleaux Zoffix: I'll remind you at 22:25Z
12:27 Geth ¦ doc: 6dc61f89d7 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
12:27 Geth ¦ doc: Remove reference to specific implementation's details
12:27 Geth ¦ doc:
12:27 Geth ¦ doc: .oO( this entire paragraph on implementing a custom `eqv`
12:27 Geth ¦ doc: probably doesn't belong here )
12:27 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6dc61f89d7
12:29 xtreak joined #perl6
12:30 El_Che AlexDaniel: the previous rakudo built fine on Fedora 25, but fails on 26: https://travis-ci.org/nxadm/rakudo-pkg/jobs/277273232#L1513
12:30 El_Che Ubuntu, Centos and Debian build fine
12:30 El_Che where there new dependencies added?
12:30 AlexDaniel El_Che: RT #132114
12:30 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=132114
12:35 Cabanossi joined #perl6
12:40 kerframil joined #perl6
12:41 Geth ¦ doc: e0b271a5c8 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
12:41 Geth ¦ doc: Document edge case eqv behaviour…
12:41 Geth ¦ doc:
12:41 Geth ¦ doc: …when comparing lazy iterables
12:41 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e0b271a5c8
12:43 aeruder joined #perl6
13:05 mr-foobar joined #perl6
13:05 sena_kun joined #perl6
13:05 Geth ¦ doc: 3702cc2b70 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
13:05 Geth ¦ doc: Remove superfluous «Note that»
13:05 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3702cc2b70
13:07 cdg joined #perl6
13:08 giraffe joined #perl6
13:08 cdg joined #perl6
13:11 cdg_ joined #perl6
13:24 skids joined #perl6
13:32 AlexDaniel https://code-golf.io/
13:32 AlexDaniel maybe I can go to bed now…
13:32 timotimo oh wow, well done
13:32 timotimo you deserve some rest
13:33 Zoffix haha nice :) AlexDaniel++
13:34 AlexDaniel arabic to roman is a boring task, don't really want to think about it
13:34 AlexDaniel but Pascal's triangle…
13:34 AlexDaniel somehow I can save 3 chars, and I just can't see it :/
13:36 mr-foobar joined #perl6
13:44 xtreak joined #perl6
13:51 nowan joined #perl6
13:52 grondilu Fibonacci in 18 chars.  That's sorcery
13:53 tadzik that's... long
13:53 mspo how do you see the solutions?
13:54 tadzik ISTR we can 10: 1,1,*+*...*
13:54 grondilu you also must print the first 31 elements
13:54 ilmari m: say (1,1,*+*...*)[^31]
13:54 camelia rakudo-moar bb4579: OUTPUT: «(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)␤»
13:55 grondilu oh wai
13:55 grondilu oh wait
13:55 grondilu I know
13:55 jast which is >20 characters
13:55 tadzik ah, but you have to print the first 31
13:55 AlexDaniel each on new line, yeah
13:55 AlexDaniel … saves you two characters already
13:56 AlexDaniel mspo: I think you can't
13:56 AlexDaniel which is rather unusual
13:56 mspo useful
13:57 mspo maybe the stack exchange one is better
13:57 mspo too bad
13:58 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 mcmillhj joined #perl6
13:58 tadzik oh, 18 is some black magic then
13:59 AlexDaniel you can get 19 without black magic :)
13:59 AlexDaniel but with ».say though
13:59 timotimo bad idea :)
13:59 AlexDaniel which is incorrect, but oh well…
14:00 grondilu I used .put
14:01 ilmari what's bad about ».say?
14:01 moritz &[+] isn't shorter than *+* :(
14:01 AlexDaniel ilmari: it prints stuff in random order
14:01 moritz ilmari: it doesn't process in order
14:02 AlexDaniel mspo: one problem with stack exchange is that they count the number of bytes
14:02 ilmari ah, indeed
14:02 AlexDaniel which is… uhhhhh…
14:02 ilmari «Note that all hyper operators are candidates for autothreading and will cause tears if the methods have side effects.»
14:02 mspo :)
14:02 mspo AlexDaniel: tough onn perl6
14:04 mr-foobar joined #perl6
14:05 ilmari also, 832040) isn't any shorter than *)[^30] :(
14:05 moritz can't you hard-code the 31's pasc... what ilmari said :(
14:05 grondilu ilmari: I got somthing for that pat hehe
14:05 grondilu *part
14:05 moritz maybe if it's the first of the numbers that has a unique divisor
14:05 moritz than you do do ...*%%5 or so
14:05 moritz s/do/could/
14:06 grondilu 4chars are enough :)
14:06 grondilu oh wait
14:07 moritz m: for 2..99 { say $_ if 1346269 %% $_ }
14:07 camelia rakudo-moar bb4579: ( no output )
14:07 grondilu isn't there a unicode alt for ... ?
14:07 AlexDaniel
14:07 grondilu :)
14:07 AlexDaniel \o/
14:07 AlexDaniel told ya, 19 isn't hard
14:07 grondilu still one char chort
14:09 * timotimo chortles
14:10 ilmari feature requests: subscript digits for numbers in other bases: HU08₃₆
14:10 ilmari s/ts/t/
14:10 AlexDaniel heh, another use for subscripts
14:11 timotimo time for a slang
14:13 headcase joined #perl6
14:16 mcmillhj joined #perl6
14:16 Aaronepower joined #perl6
14:19 ugexe is it normal for some systems copyfile api to not truncate by default?
14:20 timotimo it's windows we're talking about here ;) ;)
14:20 ugexe its win32/osx vs linux/bsd it looks like
14:20 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
14:21 timotimo 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?
14:21 timotimo don't think so
14:24 Khisanth joined #perl6
14:25 Zoffix With only 34 options, you could just do 34 ops :)
14:26 Zoffix Oh wait, it won't know that HU is a number :) nevermind
14:32 AlexDaniel Zoffix: hey, I know that you know. Why does this happen?
14:32 AlexDaniel m: $_ = 1; say $++ xx 5
14:32 camelia rakudo-moar bb4579: OUTPUT: «(0 1 2 3 4)␤»
14:33 grondilu yeah me! I got the lead in Pascal's triangle :)
14:33 AlexDaniel :O
14:33 AlexDaniel damn triangle
14:33 Zoffix AlexDaniel: what happens?
14:33 AlexDaniel grondilu++
14:33 AlexDaniel Zoffix: well, why is it not 1 1 1 1 1?
14:33 jnthn xx thunks
14:34 Zoffix and you assigned 1 to $_, which isn't used by the code
14:34 AlexDaniel right
14:34 Zoffix m: for ^5 { say $++ }
14:34 camelia rakudo-moar bb4579: OUTPUT: «0␤1␤2␤3␤4␤»
14:34 jnthn Yeah, I was wondering what the $_ = 1 was for :-)
14:34 Zoffix AlexDaniel: ^ same as here, basically
14:35 AlexDaniel but if I do something like
14:35 AlexDaniel m: $_ = 5; say .succ xx
14:35 camelia rakudo-moar bb4579: OUTPUT: «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␤»
14:35 AlexDaniel m: $_ = 5; say .succ xx 5
14:35 camelia rakudo-moar bb4579: OUTPUT: «(6 6 6 6 6)␤»
14:35 Zoffix Because you're not saving the result
14:35 Zoffix $ is a state variable
14:35 Zoffix and ++ saves the new value in it
14:36 Zoffix m: $_ = 5; say $_.=succ xx 5
14:36 camelia rakudo-moar bb4579: OUTPUT: «(6 7 8 9 10)␤»
14:36 AlexDaniel m: $_ = 5; say .=succ xx 5
14:36 camelia rakudo-moar bb4579: OUTPUT: «(6 7 8 9 10)␤»
14:36 AlexDaniel okay
14:36 Zoffix huh
14:36 mr-foobar joined #perl6
14:36 AlexDaniel yeah I have no idea
14:36 Zoffix m: $_ = 5; .=succ for ^5
14:36 camelia rakudo-moar bb4579: OUTPUT: «Cannot modify an immutable Int (0)␤  in block <unit> at <tmp> line 1␤␤»
14:36 Zoffix m: $_ = 5; for ^5 -> $ { .=succ }
14:36 camelia rakudo-moar bb4579: ( no output )
14:36 AlexDaniel m: $_ = 5; say .++ xx 5
14:36 camelia rakudo-moar bb4579: OUTPUT: «(5 6 7 8 9)␤»
14:37 Zoffix Weird, I thought .=foo didn't work.
14:37 Zoffix Wonder if I thought that because in some cases it actually doesn't :)
14:37 Zoffix (maybe I'm just confusing it with .»foo not working (not assuming $_ before the dot)
14:38 grondilu seems so, .=foo is a common idiom, like in .=new
14:39 Zoffix my $x .= new is, but can't say I saw .=new (with the $_ as the variable)
14:41 geekosaur that's just because it's something of an odd circumstance
14:48 alexk joined #perl6
14:48 Zoffix man the subscript slang doesn't wanna assemble :(
14:49 alexk m: class Foo is Int {};  my Foo $x .= new: 42; say $x; say $x.WHAT;
14:49 camelia rakudo-moar bb4579: OUTPUT: «Type check failed in assignment to $x; expected Foo but got Int (42)␤  in block <unit> at <tmp> line 1␤␤»
14:49 committable6 joined #perl6
14:49 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 rakudo-moar bb4579: OUTPUT: «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␤   …»
14:49 Zoffix I guess the identifier+op matches first somehow. Oh well, too bad :)
14:50 Zoffix alexk: Int.new returns an Int.
14:50 Zoffix alexk: core classes aren't yet polished enough for easy subclassing like that. Especially something as basic as an Int
14:50 releasable6 joined #perl6
14:50 bloatable6 joined #perl6
14:50 quotable6 joined #perl6
14:50 squashable6 joined #perl6
14:51 statisfiable6 joined #perl6
14:51 alexk Zoffix: It does work with an older rakudo version ...
14:52 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 Zoffix s: 42, 'new', \()
14:52 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/bb45791c5/src/core/Mu.pm#L112
14:52 Zoffix s/buy/guy/
14:52 Zoffix s: 42, 'new', \(42)
14:52 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/bb45791c5/src/core/Int.pm#L25
14:53 alexk Zoffix: I found this: http://blogs.perl.org/users/zoffix_znet/2016/04/extra-typical-perl-6.html
14:53 Zoffix Ah, at least it wasn't totally useless: "Fix Int.new for large values"
14:55 Zoffix Yeah, that patch is crap. It uses .Int to coerce to an Int
14:57 wamba joined #perl6
14:59 AlexDaniel ok
14:59 AlexDaniel now how much do I need for this…
15:00 AlexDaniel grondilu: :)
15:01 lostinfog joined #perl6
15:01 erratum left #perl6
15:02 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 rakudo-moar bb4579: OUTPUT: «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␤␤»
15:03 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:04 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 Zoffix Ctrl+arrows skips by words on my terminal
15:04 mr-foobar joined #perl6
15:04 rindolf joined #perl6
15:05 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 rakudo-moar bb4579: OUTPUT: «42␤(Foo)␤»
15:05 timo joined #perl6
15:05 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.
15:05 geekosaur joined #perl6
15:07 khw joined #perl6
15:13 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 rakudo-moar bb4579: OUTPUT: «(signal SEGV)»
15:13 Zoffix fun
15:14 timotimo that shouldn't happen :)
15:15 Zoffix Filed: https://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
15:16 Geth ¦ doc: 67bc4c3f2f | (Wenzel P. P. Peppmeyer)++ (committed by Zoffix Znet) | doc/Type/IO/Socket/Async.pod6
15:16 Geth ¦ doc: Better example for IO::Socket::Async, closes #1546 (#1547)
15:16 Geth ¦ doc:
15:16 Geth ¦ doc: * Better example, closes #1546
15:16 Geth ¦ doc:
15:16 Geth ¦ doc: * Update Async.pod6
15:16 Geth ¦ doc:
15:16 Geth ¦ doc: * Update Async.pod6
15:16 Geth ¦ doc: review: https://github.com/perl6/doc/commit/67bc4c3f2f
15:16 timotimo moarvm should never segfault unless you use NativeCall to do evil things
15:16 moritz really?
15:16 timotimo yeah
15:16 jnthn In this case it should be boxing
15:16 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;'
15:16 camelia rakudo-moar bb4579: OUTPUT: «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␤       …»
15:16 timotimo somehow the repr_data ends up being a null pointer
15:16 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;
15:16 camelia rakudo-moar bb4579: OUTPUT: «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␤␤»
15:17 timotimo in the copy_to reprop, apparently
15:17 timotimo P6opaque's copy_to i mean
15:17 jnthn But it's in a code path that's barely used, so...
15:17 Zoffix is there a nqp::box_bi or nqp::getattr_bi or nqp::box_a_bigint_into_this_subclas_of_int?
15:17 jnthn Zoffix: No, what you wrote should probably do it though
15:17 Zoffix OK. cool.
15:17 jnthn Except the SEGV
15:17 Zoffix :)
15:18 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:22 llfourn joined #perl6
15:23 Zoffix .in 4d fix what you broke, bruh: https://rt.perl.org/Ticket/Display.html?id=132128
15:23 yoleaux Zoffix: I'll remind you on 23 Sep 2017 15:23Z
15:24 Zoffix alexk: I filed your issue as https://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
15:28 AlexDaniel .tell Hotkeys I remember you liked golfing in perl 6 https://code-golf.io
15:28 yoleaux AlexDaniel: I'll pass your message to Hotkeys.
15:28 AlexDaniel .seen Hotkeys
15:28 yoleaux I saw Hotkeys 26 Jul 2017 19:09Z in #perl6: <Hotkeys> I'd have to go through my answers though
15:37 mr-foobar joined #perl6
15:40 dogbert17 ==24818== ERROR: AddressSanitizer: SEGV on unknown address 0x00000000 (pc 0xb567a972 sp 0xbf9d4030 bp 0xbf9d4078 T0)
15:40 dogbert17 #0 0xb567a971 in copy_to /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/P6opaque.c:89
15:40 dogbert17 #1 0xb567e076 in bind_attribute /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/P6opaque.c:354
15:40 dogbert17 Zoffix ^^
15:42 Zoffix dogbert17++ thanks.
15:43 Zoffix Maybe I'll play with it tonight. Hone in my newly acquired C-foo :)
15:47 geekosaur joined #perl6
15:49 itaipu joined #perl6
15:50 Cabanossi joined #perl6
15:51 timotimo huh, now that is fascinating. the copy_to of P6opaque is called on a p6bigint object
15:53 timotimo got the fix
15:53 timotimo Zoffix: sorry :(
15:54 Zoffix timotimo: nah, it's cool :)
15:54 Zoffix I have plenty of other stuff to fix :D
15:54 timotimo i should spectest it before it goes in, though
15:55 Zoffix I'll write the tests and try to fix that Int.new bug
15:58 nadim joined #perl6
15:59 gregf_ joined #perl6
16:01 Aaronepower joined #perl6
16:05 mr-foobar joined #perl6
16:10 ChoHag joined #perl6
16:15 geekosaur joined #perl6
16:17 mcmillhj joined #perl6
16:30 mcmillhj joined #perl6
16:30 nadim joined #perl6
16:35 mr-foobar joined #perl6
16:41 mcmillhj joined #perl6
16:50 Cabanossi joined #perl6
16:52 mcmillhj joined #perl6
16:58 teatime joined #perl6
17:07 Rawriful joined #perl6
17:08 piojo joined #perl6
17:17 Aaronepower joined #perl6
17:34 Ven`` joined #perl6
17:35 Cabanossi joined #perl6
17:38 andrzejku_ joined #perl6
17:39 domidumont joined #perl6
17:46 Geth ¦ doc: b8f14bf6c9 | (Zoffix Znet)++ (committed using GitHub Web editor) | html/.htaccess
17:46 Geth ¦ doc: De-404 /type/int* docs
17:46 Geth ¦ doc:
17:46 Geth ¦ doc: So URLs in form /type/$some-type work for native int types
17:46 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b8f14bf6c9
18:09 andrzejku_ joined #perl6
18:26 headcase joined #perl6
18:27 headcase_ joined #perl6
18:32 cdg joined #perl6
18:42 ChoHag joined #perl6
19:01 smls joined #perl6
19:03 Zoffix m: class Foo is Int {};  my Foo $x .= new: 42; say $x; say $x.WHAT;
19:03 camelia rakudo-moar 083403: OUTPUT: «42␤(Foo)␤»
19:03 Zoffix alexk: there, fixed forever.
19:07 El_Che jnthn: https://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:08 El_Che jnthn: https://travis-ci.org/nxadm/rakudo-pkg/jobs/277273232
19:08 El_Che I just restated the job as the bug suggest it's a random fail. So far it fails 2 out of 2
19:10 jnthn El_Che: Was fixed since the release
19:10 El_Che jnthn: then I am hitting something else since I use moarvm .1
19:11 jnthn .1 didn't have the fix, I meant
19:11 jnthn I fixed it yesterday or something
19:11 jnthn The test has been vulnerable to that failure since it was added some months ago, though.
19:11 El_Che Ah ok. Let's see if I get 3 out of 3
19:11 El_Che running now
19:12 El_Che will you publish a .2?
19:12 El_Che with the fix I mean?
19:12 jnthn No
19:12 El_Che ok
19:12 jnthn The problem has been in like 3-4 previous releases
19:13 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
19:14 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
19:14 jnthn Of note, native calling got faster
19:15 El_Che I wonder why only fedora 25 has the problem in my setup
19:15 El_Che while 26 doesn't
19:15 jnthn For me it failed something like 1 time in 20
19:15 jnthn Or less
19:15 jnthn On a loaded system it was more like 1 time in 5
19:15 El_Che 2 out of 2 is of course not really representative
19:16 El_Che but 2 out of 2 was for each OS
19:16 sjn o/
19:16 * sjn plays around with Cro today o/
19:16 El_Che (as in all pass, and the same fails)
19:17 sjn is the TLS work that's been done lately finished? (having some errors about "no shared cipher" with the default fake certs)
19:18 jnthn sjn: Haven't seen that one before. Though am still hunting https://github.com/jnthn/p6-io-socket-async-ssl/issues/19 which is proving to be very hard to track down
19:18 * jnthn bbi30
19:18 espadrine joined #perl6
19:18 El_Che jnthn: the third run passed
19:22 El_Che jnthn: thx for the help!
19:38 avalenn joined #perl6
19:41 Aaronepower joined #perl6
19:45 sjn looks like the "no shared cipher" error message is made by openssl
19:49 firecat joined #perl6
19:50 geekosaur modern web servers have a lot of older ciphers disabled for security reasons
19:52 sjn hm. that would mean the default ciphers used by IO::Socket::Async::SSL and/or Cro::TLS are all old
19:53 sjn I get that error when opening the cro service with my browser
19:53 sjn (Firefox 55.0.2 on Ubuntu)
19:57 timotimo sjn: https://superuser.com/questions/109213/how-do-i-list-the-ssl-tls-cipher-suites-a-particular-website-offers - you could try the shell script in the second answer to see what cro offers
19:59 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 https://github.com/jnthn/p6-io-socket-async-ssl/blob/master/lib/IO/Socket/Async/SSL.pm6#L291 is where to look in the code
20:00 jnthn 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
20:00 timotimo oh, is this about the cro https client?
20:01 sjn timotimo: no, I'm setting up a service with cro
20:01 sjn in fact, I'm trying the default service that cro stub creates
20:02 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?
20:05 timotimo just a case of a missing try i expect ;)
20:11 cdg joined #perl6
20:16 cdg_ joined #perl6
20:16 rindolf joined #perl6
20:24 kybr joined #perl6
20:32 rindolf joined #perl6
20:42 firecat left #perl6
20:45 Zoffix moritz++ # fun example of primality test with regexes in the book :)
20:46 Zoffix (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 Zoffix and finish before Monday EST
20:53 TEttinger joined #perl6
20:59 firecat joined #perl6
21:01 firecat p6:say 5
21:01 timotimo m: say 5
21:01 camelia rakudo-moar 083403: OUTPUT: «5␤»
21:02 timotimo seems like it really wants a space after the :
21:02 firecat p6: say 3;
21:02 camelia rakudo-moar 083403: OUTPUT: «3␤»
21:02 firecat y
21:10 headcase joined #perl6
21:27 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 raschipi joined #perl6
21:27 weabot this is thread specific and too temporary to be worth defining as a global variable
21:28 timotimo you can "temp @*ARGV"
21:29 timotimo perl6 -e 'say @*ARGS; { temp @*ARGS; unshift @*ARGS, $*PROGRAM-NAME; say @*ARGS; }; say @*ARGS' 1 2 3
21:29 timotimo try this
21:30 epony joined #perl6
21:31 weabot these are only arguments to give to a subroutine that I parse and append myself
21:31 timotimo ooooh
21:31 timotimo you mean like this:
21:32 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")
21:32 camelia rakudo-moar b66f5e: OUTPUT: «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")␤»
21:32 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")
21:32 camelia rakudo-moar b66f5e: OUTPUT: «a 9, b hi, c weabot␤»
21:33 weabot hmm
21:33 weabot I think that's it yeah
21:33 timotimo cool
21:35 weabot actually that doesn't modify @args in the calling function if I'm understanding this correctly but I can make this work
21:35 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 rakudo-moar b66f5e: OUTPUT: «a 9, b hi, c weabot␤»
21:35 timotimo you can modify @args in that function just fine :)
21:35 weabot ooh nice
21:35 Cabanossi joined #perl6
21:36 cpage_ joined #perl6
21:38 weabot hmm
21:39 weabot sub test (@argv) { @argv.append("arg3"); } my @argv = ["arg1", "arg2"]; test(@argv); put(@argv);
21:39 weabot m: sub test (@argv) { @argv.append("arg3"); } my @argv = ["arg1", "arg2"]; test(@argv); put(@argv);
21:39 camelia rakudo-moar b66f5e: OUTPUT: «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…»
21:40 weabot you see, I want this to add "arg3" to @argv
21:40 weabot m: sub test (@argv) { @argv.append("arg3"); }; my @argv = ["arg1", "arg2"]; test(@argv); put(@argv);
21:40 camelia rakudo-moar b66f5e: OUTPUT: «arg1 arg2 arg3␤»
21:40 weabot wait
21:41 weabot is all I've ever believed wrong? do functions that are passed arrays modify them?
21:42 Zoffix yup
21:43 Zoffix Same with any other object.
21:43 weabot is that if they don't have any return values or..?
21:43 Zoffix At all times
21:44 weabot how have I written so much perl 6 without knowing this, and without screwing things up?
21:44 weabot holy hell
21:44 teatime Zoffix: so when would you have to use 'is rw' in signature?
21:45 troys joined #perl6
21:45 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
21:46 weabot 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
21:46 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
21:46 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
21:47 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 :)
21:47 Zoffix So don't feel bad
21:47 weabot I mean I do avoid modifying arguments usually
21:48 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.
21:49 El_Che New Linux packages: https://github.com/nxadm/rakudo-pkg/releases/tag/2017.09.1
21:49 Zoffix \o/
21:49 Zoffix El_Che++
21:49 teatime so if you 'is rw' a @-sigil'd argument, you can reassign a different Array to the @variable in the calling scope?
21:49 teatime or is it just for $scalars
21:50 teatime 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
21:50 weabot I'm surprised that rakudo wasn't ported to freebsd yet
21:50 weabot I compiled it succesfully the other day on there
21:51 Zoffix teatime: it'll complain about it :)
21:51 Zoffix m: -> @ is rw {}
21:51 camelia rakudo-moar b66f5e: ( no output )
21:51 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.
21:51 Zoffix m: -> @ is rw {}()
21:51 camelia rakudo-moar b66f5e: OUTPUT: «Too few positionals passed; expected 1 argument but got 0␤  in block <unit> at <tmp> line 1␤␤»
21:51 Zoffix orly
21:51 Zoffix m: sub (@ is rw) {}()
21:51 camelia rakudo-moar b66f5e: OUTPUT: «Too few positionals passed; expected 1 argument but got 0␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:51 Zoffix m: sub (@x is rw) {}()
21:51 camelia rakudo-moar b66f5e: OUTPUT: «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␤»
21:51 Zoffix m: -> @x is rw {}()
21:51 camelia rakudo-moar b66f5e: OUTPUT: «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␤»
21:51 geekosaur so do i. so I try to remember to do it in /query first :)
21:52 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: https://docs.perl6.org/language/containers
21:53 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
21:54 weabot nope, doesn't seem like it
21:54 weabot I mean it was dropped I guess
21:54 Zoffix Filed the inconsistency as https://rt.perl.org/Ticket/Display.html?id=132133
22:04 pilne joined #perl6
22:05 Cabanossi joined #perl6
22:22 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 Ulti my expectation was utf8-c8 would be less expensive than the default was that wrong?
22:24 timotimo there's a fast-path in the decoder for utf8, probably none for utf8-c8
22:25 cognominal joined #perl6
22:25 yoleaux Zoffix: fix make xtest on docs
22:28 jnthn utf8-c8 is a lot more expensive, because it's got to keep track of a bunch more
22:29 jnthn 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
22:29 * Zoffix hopes there are few failures
22:30 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?
22:30 Ulti so stuff like length is based on graphemes?
22:30 jnthn With utf8-c8?
22:30 Ulti yeah
22:30 jnthn What are you using it for?
22:31 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
22:31 Ulti given that feels a bit like an impossible task
22:31 Ulti ok
22:31 jnthn The point of it is to let people pretend a filename is a Str
22:32 jnthn And appending '.bak' to it and feed it back to the OS and get the Right Thing happening
22:32 jnthn It's a pretty bad idea to use it for general input
22:32 headcase joined #perl6
22:33 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
22:34 Ulti about 10x off of perl5 hacktastic strings that everyone secretly really wants >:P
22:34 Ulti if you made perl5 do exactly the same job it must be getting close now
22:35 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 headcase joined #perl6
22:35 jnthn There's output buffering now too, so output is within a factor of about 1.2x or so
22:36 jnthn (Again, assuming utf8-8 encoding)
22:37 Ulti the real issue in the world is that bioinformatics uses ascii bytes for something that can be 2-3bit encoded
22:39 jnthn Yeah, I guess for bioinformatics folks, it's ASCII performance (or "I don't care" performance :-)) that really matters.
22:40 Ulti yeah :( plus everything is gzipped all the time everywhere because of the stupid encoding and DNA itself having lots of runs
22:41 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
22:41 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)
22:42 Ulti 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
22:42 Ulti the idea being its then easy to jump in and index
22:43 Ulti but bzip2 already has that block concept built in :/
22:43 raschipi Right, isn't that what dealing with DNA needs for performance?
22:44 Ulti basically
22:44 Ulti Im fairly sure its like 2x faster since I last checked this I could have sworn it was about 30s for a 1GB file
22:45 Ulti not DNA though just a giant CSV where 50% of it is DNA sequence which shouldnt matter one way or the other
22:46 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:47 Ulti thats fairly awesome jnthn++
22:47 Ulti I think the last time was around when Zoffix had done a bunch of work
22:48 Ulti 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
22:49 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. :-)
22:49 jnthn Especially when I know we've more to win yet :)
22:49 Ulti raschipi nope :)
22:50 jnthn It's just that the opts gradually get scarier. :-)
22:51 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:52 Ulti 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:56 Ulti http://blog.honeybadger.io/ruby_unicode_normalization/  hmmmmm
22:57 weabot can I use variables in s/ replace?
22:57 weabot like s/$var1/$var2/
22:57 Zoffix weabot: yes, what you show works
22:57 weabot thank you
22:57 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"
22:58 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
22:58 weabot Zoffix $var2 won't be interpreted as text?
22:59 raschipi weabot: Tha'ts what the $ is for.
22:59 weabot yeah I just assumed both are regex since it's all between //
22:59 grondilu joined #perl6
23:00 jnthn Only the stuff between the first two are parsed as regex
23:00 jnthn The others are parsed like a quoted string
23:00 teatime weabot: the s/pattern/replacement/ operation takes a string for replacement in every language.
23:00 weabot alright
23:00 teatime weabot: plus usually some special syntax like \1 for backreferences
23:00 Ulti timotimo: yeah I think so to for the vast majority of software written today it makes complete sense to normalise all the things
23:00 weabot thank you :)
23:01 timotimo Ulti: until timo comes along and wants to write a json parser ;)
23:01 timotimo "but json is so simple!" i hear you say
23:01 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
23:01 timotimo no, nobody says that. everybody knows nowadays
23:01 teatime Zoffix: I'm curious how /<$var>/ and /<{$var}>/ differ
23:02 Ulti timotimo: well simpler than XML :P
23:03 jnthn teatime: iirc they're the same semantics, but the second will burn a tad more CPU cycles
23:03 jnthn <$var> looks up a variable and treats it as regex code to compile and run
23:04 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
23:04 teatime there was a previous discussion, seems like <$var> did something weird when used multiple times ...
23:05 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
23:05 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. :-)
23:05 adu joined #perl6
23:06 weabot Zoffix I understand better now, thanks, just needed some clarifications
23:06 weabot basically it replaces every match from the first field with the string from the second
23:06 teatime jnthn: I doubt it, I have a bad memory
23:06 Zoffix weabot: not every, just the first. You need to use s:g/// to replace every
23:07 Zoffix There's an article on S///, BTW: https://rakudo.party/post/Perl-6-S---Substitution-Operator
23:07 weabot right
23:07 teatime jnthn: however, both <$var> and <{$var}> are difficult to find documentation on, e.g. https://docs.perl6.org/language/regexes does not mention "interpolation" or the string "<$" ... maybe worth a ticket?
23:07 jnthn teatime: I'd say so
23:09 teatime aside: having ^ and $ match begin/end-of-*string* + providing ^^ and $$ is a thing of beauty
23:10 jnthn :)
23:10 jnthn Sleep time for me; 'night
23:10 timotimo nite jnthn
23:14 pecastro joined #perl6
23:23 Geth ¦ doc: 63190963a1 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Type/SetHash.pod6
23:23 Geth ¦ doc: add idiom for adding a new SetHash element
23:23 Geth ¦ doc:
23:23 Geth ¦ doc: per example from Zoffix, needs utf8 quotes
23:23 Geth ¦ doc: review: https://github.com/perl6/doc/commit/63190963a1
23:27 BenGoldberg joined #perl6
23:27 Geth ¦ doc: 0e4fc28568 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/SetHash.pod6
23:27 Geth ¦ doc: Use utf8 quotes; add example for multiple keys
23:27 Geth ¦ doc:
23:27 Geth ¦ doc: Also declare the variable; pretty sure make xtest would complain
23:27 Geth ¦ doc: otherwise.
23:27 Geth ¦ doc: review: https://github.com/perl6/doc/commit/0e4fc28568
23:28 * Zoffix retreats into zofcave for a week
23:28 timotimo have a good one!
23:30 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 tbrowder i'm sure Zoffix can fix that!
23:31 timotimo isn't there some pod command that lets us put in code that gets run but not rendered?
23:31 timotimo but in general it's nice to have code you can actually copy-paste and run immediately
23:33 tbrowder um, you migh
23:34 tbrowder *might add a note highlighting the >> operator for old eyes on the multi add
23:35 tbrowder s/old/weak/
23:43 pecastro joined #perl6
23:48 cdg joined #perl6
23:50 AlexDaniel joined #perl6
23:58 AlexDaniel grondilu: if you did pascal's triangle in 33 you should be able to do fibonacci in 18
23:59 headcase joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo