»ö« 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.
00:03 pierre_ joined 00:18 pierre_ left, dalek left, AlexDani` joined 00:19 nebuchad` joined, dalek joined, ChanServ sets mode: +v dalek, kst` joined 00:20 kaare__ joined, kaare_ left, AlexDaniel left, Celelibi left 00:21 pierrot left, pierrot joined, bjz left, baest_ left 00:22 bjz joined, Celelibi joined 00:25 AlexDani` is now known as AlexDaniel 00:27 pierre_ joined 00:31 pierre_ left 00:33 baest joined 00:39 cdg left 00:40 pierre_ joined, labster left 00:41 pierre_ left
japhb .ask masak What's up with the IR clog spelunking? Is there a project afoot? 00:47
yoleaux japhb: I'll pass your message to masak.
00:49 pierre_ joined, bjz left
japhb .tell lizmat We once had OpenGL, because back when Parrot was the only backend, I wrote those bindings. Sadly it's been a while since I've messed around with those; maybe after I finish github.com/japhb/Terminal-Print/bl.../rpg-ui.p6 ... which, uh, may be a while. 00:50
yoleaux japhb: I'll pass your message to lizmat.
00:53 pierre_ left 00:54 pierre_ joined 00:55 Shin_ joined 00:57 nadim left
Shin_ Hi all... 01:00
m: my @a = <a a b c>; my @b = (20,1,5,4); say sort({$^a cmp $^b}, @a); say sort({$^b cmp $^a}, @b);
camelia rakudo-moar 839e52: OUTPUT«(a a b c)␤(20 5 4 1)␤»
Shin_ so, is there a perl6 way to code a sorting for both columns at the same time,thag could take advantage of auto threading? 01:01
Like an Sql saying 'order by @a asc, @b desc' 01:03
01:03 baest left 01:04 sufrostico left
grondilu .values given sort *.key, (@a >>[=>]<< @b); 01:05
Shin_ Wow, that looks cryptic :) 01:08
And for 3 or more columns, what strategy is suggested. I just want to tale davantage of perl6 lazyness and autothreading if possible. 01:09
01:11 kurahaupo left 01:12 bjz joined
grondilu your sort can not do parallelism by definition, so the only parallelism is in computing the sorting criteria. So you may just create a data structure with all sorting criteria in it, and to do so you can use parallelism. 01:13
01:15 baest joined
grondilu something like race @a.map( { $_ => [&criterium1($_), &criterium2($_)] } ); 01:15
01:22 vendethiel joined, itaipu joined 01:23 Khisanth left, vendethiel- left
Hotkeys m: say (1..3 Z 1..3), (3..1 Z 1..3) 01:28
camelia rakudo-moar 839e52: OUTPUT«((1 1) (2 2) (3 3))()␤»
Hotkeys What's going on here ^
Why does an ascending range work fine with zip
But a descending range doesn't
Juerd m: say 3..1
camelia rakudo-moar 839e52: OUTPUT«3..1␤»
Juerd Heh.
01:29 Actualeyes joined
Hotkeys m: list 3..1 01:29
camelia ( no output )
Hotkeys m: say list 3..1
camelia rakudo-moar 839e52: OUTPUT«()␤»
Hotkeys So are descending ranges not a thing
Juerd Descending ranges don't really exist.
Hotkeys Whoops
Juerd You can use a generated list: 3 ... 1
Hotkeys Right
Thanks 01:31
01:34 grondilu left 01:37 Khisanth joined
Shin_ Thanks grondilu 01:40
01:46 cibs left
MasterDuke is there a way for a grammar to get/know where in the overall thing it's parsing it is, i.e., the line number of the file? 01:47
01:48 cibs joined, pierre_ left
gfldex MasterDuke: you have to count line numbers by hand 01:48
MasterDuke ugh. not sure how i would do that in a grammar? 01:49
gfldex MasterDuke: i got some code for that somewhere, will take a minute or two
MasterDuke sure, np 01:50
gfldex MasterDuke: gist.github.com/gfldex/fcd52d39ae9...52d13717c0 01:51
make sure to count the line before doing any matching
MasterDuke cool, thanks 01:52
01:53 pierre_ joined 01:55 Shin_ left 01:56 pierre_ left, pierre_ joined 01:58 aborazmeh joined, aborazmeh left, aborazmeh joined 02:02 R_I_D joined 02:04 eliasr left
R_I_D question: how am i supposed to be productive in another language now that i know about perl6? 02:04
timotimo we are very sorry 02:05
you can use Inline::Python and Inline::Perl5 (and Inline::Perl6) to share code between languages
so you can keep a few things in perl6
R_I_D Inline Python? youre kidding 02:06
thats awesome
timotimo it's a thing :) 02:07
02:08 R_I_D left
seatek i have gone from a day-long, seething loathing of grammars into excited happiness in a matter of 5 minutes. 02:11
i was thinking, what wholly inadequate documentation there is on them... if i ever figure it out, i'll write up some better. but now i realize how hard that would be. seems like it's one of those things that just has to "click" eventually. 02:14
now to start creating chaos with actions 02:15
02:17 Rawriful left 02:23 itaipu left 02:25 bjz left 02:27 pierre_ left 02:31 bjz joined 02:33 pierre_ joined 02:37 pierre_ left 02:44 pierre_ joined 02:45 ilbot3 left 02:47 ilbot3 joined
SmokeMachine____ Is there a way to get the $=pod from another code? 03:03
AlexDaniel seatek: I've always thought that docs.perl6.org/language/grammars is quite decent 03:20
03:22 Actualeyes left
seatek AlexDaniel: it is if you already know about them. It jumps straight into Protoregexes without even talking about what Grammars even are, except to say they're a "data structure" made by grouping regexes 03:22
AlexDaniel seatek: haha 03:23
seatek yeah ;) 03:24
03:27 Lucas_One joined
seatek i'm still not clear in actions why the heck and when you'd use "make" even. 03:28
and i've read just about everything there is 03:29
AlexDaniel it's if you want to build AST 03:30
seatek i know it's supposed to create an "AST", but trying to find what that is I have no idea
yes, exactly what the docs said
AlexDaniel okay, well. Once you parsed something, you have a parse tree, right?
seatek sure -- that's all very new to me though 03:31
AlexDaniel now, if the data you are parsing is complex enough, it means that your grammar is probably a bit complex too.
seatek you have component parts stored in methods
AlexDaniel so chances are you'll get a lot of crap in your parse tree
seatek it looks like make is used on things that need to map array and such 03:32
AlexDaniel (to the point that it is not very convenient to work with it)
seatek yeah
AlexDaniel so you build an AST! Which does not contain as much information about the original text and how exactly it was parsed 03:33
seatek ah ok... strips it down a bit
AlexDaniel yea, and you can do some extra stuff there too, depending on your needs 03:34
seatek so basically with actions, you're taking the return value that comes out of TOP, yes? 03:35
AlexDaniel well, it will call a corresponding method for every rule/token/regex it matches, not just TOP. But the value you get from $match.made is from TOP, yes 03:37
seatek right :)
that took FOREVER to figure out.
i could just be dull :) 03:38
AlexDaniel no, it is indeed not that obvious 03:39
seatek i'm basically looking at grammars as a means to create data structures i can have predictable and consistent things to work with
AlexDaniel but if you try to write some basic parser you'll probably figure it all out
03:39 skids left
AlexDaniel … or maybe some basic programming language, not just parser… 03:39
seatek yeah that's what i've been doing -- a basic REST construct as my plaything
with "made"... do you need to call that on things you've have "make"'d? i haven't really dug into those guys much yet 03:41
if make is just stripping things down, i don't see why you would 03:42
yet so many of the examples use it without saying why
you look up make -- and it says Sets the AST to $ast, and returns it. 03:43
ah! i understand! ;)
and made.... Returns the payload that was set with method make. 03:44
oh silly me ;)
and an ast is An AST or Abstract Syntax Tree is a partially processed representation of a program. 03:45
why would i want my action to become a partially processed representation of a program? I mean, I can imagine... but how do I work with that? 03:47
i'm not complaining -- i'm just sharing my journey... ;) 03:48
AlexDaniel m: grammar Foo { rule TOP { <int> ‘+’ <int> }; token int { \d+ } }; class Addition { has $.a; has $.b }; class BarAct { method TOP($/) { make Addition.new(a => $<int>[0].made, b => $<int>[1].made) }; method int($/) { make +~$/ } }; my $match = Foo.parse(‘42 + 60’, actions => BarAct.new); say $match; say $match.made
camelia rakudo-moar 839e52: OUTPUT«「42 + 60」␤ int => 「42」␤ int => 「60」␤Addition.new(a => 42, b => 60)␤»
AlexDaniel seatek: you might want to split that into a few lines :) 03:49
seatek AlexDaniel: exactly what I started doing :)
AlexDaniel I'm not sure if it explains anything, but that's the idea 03:51
03:52 khw left
seatek i'm still trying to format it to read. emacs can't even help! :) 03:53
no, that's no help at all 03:56
thanks though
i need to be let by the hand with a lollipop and all i get is punk rock ;) 03:57
when this will be a help, i'll have come to understand what i need to ;)
oh wait 03:59
AlexDaniel seatek: well, you can always work with your parse tree if you want to
03:59 noganex joined
seatek maybe if i stare at it for a while 03:59
AlexDaniel m: gist.github.com/AlexDaniel/15ac3d5...ffa3272cef 04:00
camelia rakudo-moar 839e52: OUTPUT«「42 + 60」␤ int => 「42」␤ int => 「60」␤Addition.new(a => SuperInteger.new(value => 42), b => SuperInteger.new(value => 60))␤»
seatek why are the 2 $<int>[*] things getting .made called on them at that point ... they were never 'make'ed
AlexDaniel seatek: they were
seatek they get maked if they come from the grammar automatically? 04:01
AlexDaniel no, there's a method BarAct.int
04:02 noganex_ left
seatek it knows to call that method? 04:03
AlexDaniel yes, by its name 04:04
seatek oh i see, because int gets pulled in from the grammar, then it's already been changed for the TOP method
so duplicate token names get put into an array automatically too eh? had no idea about that one. 04:10
AlexDaniel yes 04:11
seatek i don't understand how 'value' could come out 04:12
i mean, how it's added, yes... but how it's outputted i can't see that
AlexDaniel seatek: that's .gist of our object that we created 04:13
seatek just as an element of the data structure i suppose.
and then we just pick out the juicy bits we want 04:14
AlexDaniel committable6: gist.githubusercontent.com/AlexDan...c4/file.p6 04:15
committable6: help
committable6 AlexDaniel, Like this: committable6: f583f22,HEAD say ‘hello’; say ‘world’
AlexDaniel committable6: HEAD gist.githubusercontent.com/AlexDan...c4/file.p6
committable6 AlexDaniel, Successfully fetched the code from the provided URL.
AlexDaniel, gist.github.com/8bf643f794c8f3d1b0...bc0eb131dc
AlexDaniel I should have started doing it in reverse polish notation… :) 04:16
seatek no! :) 04:17
AlexDaniel yes, because to make it work properly with infix notation you'd have to basically build your predence table… :)
which is doable, but uhh! 04:18
seatek yes i've noticed how some simple things are complicated an some complicated get simple
AlexDaniel seatek: anyway, what I wanted to show here is that there is no “operation” in our AST
04:19 kent\n joined
seatek so really, it's a bit of a discovery to find out what you've created in your AST then 04:19
04:19 pierre_ left
AlexDaniel not sure what you mean by that :) 04:19
seatek i think i'll have to ;) to that 04:20
AlexDaniel seatek: but anyway, if you don't feel any need in AST then perhaps you don't need one in this particular task 04:21
seatek AlexDaniel++ this has been so incredibly helpful.. thank you so much
AlexDaniel just go over your parse tree and get what you need, that works too
seatek i think i probably don't at this point... but i'm going to anyway. i want to get this all feeling second nature
i can see how useful this could be in lots of stuff. i could have been done a couple days ago with this last task but keeping to regexes... but when i see a rabbit hole... ;) 04:23
and this seems so core to everythign in the language, so it seems worth the effort 04:24
AlexDaniel well, it is core, it parses the whole damn thing :) 04:25
seatek i would throw myself into the creek first, than trying to write that. 04:26
can't even imagine at this point 04:27
though i have briefly peeked ;)
AlexDaniel interestingly, one of the example in our docs abuses the whole AST to pass calculated values around… not sure if that's a great example 04:28
04:28 pierre_ joined
AlexDaniel ast thing* 04:28
seatek there is all manner of voodoo going on in those docs related to grammars 04:29
i did at first imagine using grammars to do class factories directly in the actions, but have since second-thought that 04:30
04:30 Actualeyes joined
AlexDaniel anyway, I have to sleep :) 04:32
see you 🙋
seatek: and feel free to open a couple of tickets in doc repo
seatek: your complaints are correct 04:33
04:33 pierre_ left
AlexDaniel it should not jump straight into protos, that's true 04:33
and yes, it should have a bit more text explaining why somebody would need an AST
seatek i'll help write some up gladly. least i can do for your kind help AlexDaniel. thank you again 04:39
04:39 AlexDaniel left 04:45 wamba joined 05:02 canopus left 05:07 canopus joined 05:09 kent\n left 05:13 brillenfux joined 05:16 Sgeo left 05:21 labster joined 05:29 pierre_ joined 05:34 pierre_ left 05:35 Cabanossi left 05:39 Cabanossi joined 05:44 dwarring left 05:49 wamba left 05:52 aborazmeh left 05:53 Sgeo joined 06:02 bjz left 06:11 pierre_ joined 06:46 brillenfux_ joined, brillenfux left 06:47 pierre_ left 06:48 RabidGravy joined, darutoko joined 06:55 pierre_ joined 06:59 pierre_ left 07:00 pierre_ joined 07:06 labster left
samcv what do you guys use for terminal emulators on linux? i sorta use st and konsole, but st is way too minimal and konsole has problems displaying unicode text properly (cuts characters off and makes the line placement off sometimes for a larger character) 07:16
curious what you guys use
07:18 CIAvash joined, CIAvash left, neuraload joined
moritz I use xfce4-terminal, mostly because it's the default on xubuntu 07:22
so far I didn't have any Unicode trouble with it 07:23
samcv hmm
i will try that then
hmm tried it and at least it doesn't glitch the spacing of the lines for tall characters like 「this」 but they still get cut off vertically 07:26
but i use a really tiny font
arnsholt I've mostly used gnome-terminal
But not with a tiny font 07:27
samcv a.uguu.se/fNSHlsqDwQHv_Screenshot_...202455.png
arnsholt Modern screens are big, so I can afford the luxury of a big font too =)
samcv hah
i only have 1366 x 768 on my laptop and it's what i use 95% of the time
arnsholt Hah! Apparently the corporate firewall doesn't like your site 07:28
07:28 RabidGravy left
samcv heh 07:28
arnsholt, try this i.imgur.com/Tx2CaUq.png
it's a bitmap font so only one size. but i love it so much. can fit tons on my screen and it's pretty readable 07:29
07:36 firstdayonthejob joined, firstdayonthejob left 07:37 domidumont joined 07:39 wamba joined
samcv i find it annoying as hell that st, which is only has 10k lines of code is the only one that actually renders text right :( 07:40
idk why it's so hard to resize too big characters to fit inside the box given that terminals are supposed to do monospaced fonts
07:52 wamba left 07:53 grondilu joined 07:55 CIAvash joined 08:02 labster joined
samcv tried terminator, termite, konsole, xfce4-terminal, yakuake, terminology, xterm, urxvt-unicode, roxterm. ugh 08:06
bonsaikitten mrxvt seems pretty ok 08:07
tabbed rxvt, mostly sane
08:09 pierre_ left, seatek left
samcv well i've gotten urxvt working except only basically specifying the fallback fonts be like 1/2 the size they should be 08:10
if they're too big urxvt will just not show them at all :\ 08:11
other ones either cut them off or they go into the other lines
08:13 cdg joined
samcv st is the only one that actually shows properly, and it even works for full width symbols too, but always makes sure the height fits. but fullwidth ones show wider than normal ones. i wish i could use the normal clipboard to paste into it though, and not do middle click 08:14
08:14 pierre_ joined
bonsaikitten haven't seen that issue yet 08:15
08:19 pierre_ left, zakharyas joined 08:20 wamba joined 08:22 nebuchad` is now known as nebuchadnezzar 08:23 pierre_ joined 08:27 Actualeyes left
samcv bonsaikitten, maybe your font isn't small enough ;) 08:27
nine samcv: what version of konsole have you tried? 08:31
samcv hmm even with a bigger font xfce terminal will glitch if i type 🐧 as the first thing, and pad it with like 3 spaces of width and then backspacing over it won't remove the last thing..
i'm running the latest
08:31 nadim joined
samcv i have konsole 16.08.2 running KDE 5.8 08:32
08:33 brillenfux_ left
samcv gonna try something brb 08:34
08:37 dakkar joined
samcv not sure why this isn't working, but konsole isn't doing my custom compose things in ~/.XCompose 08:38
QT_IM_MODULE is set to xim too other programs work, though in kate things like emojis insert but shows a ? box. but works in non qt programs. 08:42
08:42 wamba left 08:44 cdg_ joined 08:46 cdg left 08:47 tokomer joined
lizmat clickbaits p6weekly.wordpress.com/2016/10/31/...-в-perl-6/ 08:50
yoleaux 00:50Z <japhb> lizmat: We once had OpenGL, because back when Parrot was the only backend, I wrote those bindings. Sadly it's been a while since I've messed around with those; maybe after I finish github.com/japhb/Terminal-Print/bl.../rpg-ui.p6 ... which, uh, may be a while.
08:55 tokomer left, tokomer joined 08:56 cooper_ left 09:01 jonas1 joined, pierre_ left 09:04 pierrot left, pierrot joined
[ptc] lizmat++ 09:04
09:06 domidumont left 09:07 pierre_ joined 09:11 TEttinger left, pierre_ left 09:15 pierre_ joined
masak m: sub is-odd($n) { $n % 2 }; .say if 5 ff is-odd($_) for 1..10 09:25
camelia rakudo-moar 839e52: OUTPUT«5␤6␤7␤8␤9␤10␤»
yoleaux 00:47Z <japhb> masak: What's up with the IR clog spelunking? Is there a project afoot?
masak japhb: no, just ended up searching for stuff :)
er, I mean "officially, there's no project afoot" :P
what'm I doing wrong with the `is-odd` thing above?
I'm trying to highlight the difference between ff and fff
masak checks the test suite 09:38
m: say join "", (/B/ ff /B/ ?? $_ !! "x" for <A B A B A>) 09:40
camelia rakudo-moar 839e52: OUTPUT«Use of uninitialized value <element> of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤ in block <unit> at <tmp> line 1␤Use of uninitialized value <element> of type Any in strin…»
masak oh. precedence. 09:42
m: say join "", ((/B/ ff /B/) ?? $_ !! "x" for <A B A B A>)
camelia rakudo-moar 839e52: OUTPUT«xBxBx␤»
masak for some reason I expected infix:<ff> to be tighter than infix:<?? !!>
but they're on the same prec level -- hm 09:43
and right-associative
so... I don't understand why the parens make a difference there...
m: say join "", ((/B/ fff /B/) ?? $_ !! "x" for <A B A B A>)
camelia rakudo-moar 839e52: OUTPUT«xBABx␤»
masak anyway, the spectests deliver. the above is a difference between ff and fff 09:44
dalek c: acd772d | gfldex++ | doc/Type/Regex.pod6:
show how to declare named Regex
c: 9246bf3 | gfldex++ | doc/Language/functions.pod6:
index prefix &
09:53 cdg_ left
dalek c: b1e96ff | gfldex++ | doc/ (2 files):
name a sigil a sigil
10:05 pierre_ left 10:08 pierre_ joined
masak m: class A::B {}; class C { has A::B $.ab .= new } # RT #126975 10:08
camelia rakudo-moar 839e52: OUTPUT«===SORRY!===␤Could not locate compile-time value for symbol A::B␤»
masak one of these days curiosity is going to get the better of me, and I will have to check why that one doesn't find the "compile-time value for symbol A::B" :) 10:09
this works:
m: class A::B {}; class C { has A::B $.ab = A::B.new }; say "alive"
camelia rakudo-moar 839e52: OUTPUT«alive␤»
masak so it's gotta have something to do with the `.=` somehow
10:12 silug left 10:13 auerland joined, auerland left 10:14 wamba joined 10:23 labster left, Matthew[m] left, M-Illandan left, tadzik left, ilmari[m] left, Guest95971 left, Matias[m] left 10:27 silug joined 10:31 brillenfux joined
jferrero m: say 4 == (1E12.log10 / 3).Round 10:31
camelia rakudo-moar 839e52: OUTPUT«No such method 'Round' for invocant of type 'Num'␤ in block <unit> at <tmp> line 1␤␤»
jferrero m: say 4 == (1E12.log10 / 3).round 10:32
camelia rakudo-moar 839e52: OUTPUT«True␤»
10:33 kent\n joined 10:41 itaipu joined 10:50 ilmari[m] joined 10:56 tadzik joined, enick_127 joined, M-Illandan joined, Matthew[m] joined 10:59 dakkar left, tokomer_ joined, pierre_ left 11:00 itaipu left 11:01 tokomer left, BuildTheRobots left, dakkar joined 11:02 DarthGandalf left, andrzejku joined, DarthGandalf joined, BuildTheRobots joined
masak m: say 1E12.log10 / 3 11:03
camelia rakudo-moar b5780f: OUTPUT«4␤»
masak m: say 4 == 1E12.log10 / 3
camelia rakudo-moar b5780f: OUTPUT«False␤»
11:03 itaipu joined
masak m: say 4 ≅ 1E12.log10 / 3 11:03
camelia rakudo-moar b5780f: OUTPUT«True␤»
11:03 CIAvash left 11:04 gregf_ joined 11:06 mohae_ left 11:07 mohae joined 11:08 Matthew[m] left, tadzik left, ilmari[m] left, enick_127 left, M-Illandan left 11:10 Actualeyes joined, rindolf joined 11:17 Rawriful joined 11:19 ilmari[m] joined 11:22 kent\n left, kent\n joined 11:23 tokomer_ left 11:26 M-Illandan joined, Matthew[m] joined, tadzik joined, Guest99321 joined, Matias[m] joined 11:39 CIAvash joined 11:42 pierre___ joined 11:52 domidumont joined 12:06 pierre___ left, pierre_ joined 12:11 AlexDaniel joined 12:25 nicq20 joined
nicq20 Hello o/ 12:28
masak m: say "ohayo nicq20!" 12:29
camelia rakudo-moar b62321: OUTPUT«ohayo nicq20!␤»
12:32 rurban left, kaare__ left
dalek c: 0acb8ea | coke++ | doc/Type/Regex.pod6:
use our standard phrasing here
12:48 gensym left 12:49 gensym joined 12:52 vendethiel left, vendethiel joined 13:10 ab6tract joined 13:26 rurban joined 13:32 vendethiel- joined 13:33 skids joined, vendethiel left 13:34 cdg joined
ab6tract long ago i started working on making (^) work with bags 13:34
13:35 pierre_ left, kurahaupo__ joined
ab6tract anyone feel strongly about it? 13:36
13:36 pierre_ joined 13:38 LeCamarade joined
LeCamarade Hello, Perl 6; I have Raspbian on a Pi. The Rakudo is from 2014. Will I succeed in compiling one there, or is there a .deb somewhere? 13:39
The Rakudo from the repositories is pre-Christmas. I had trouble compiling before on thin machines like this one. Need I bother? Anybody done done it before? 13:40
13:40 pierre_ left
timotimo compiling on a raspberry pi will definitely require a bunch of swap space 13:41
and multiple days of waiting :)
debian's got debs for multiple architectures of moarvm as least, i think?
LeCamarade Right. So I will settle for a pre-compiled ... if I should be able to locate one. 13:42
lizmat github.com/nxadm/rakudo-pkg/releases
13:42 sufrostico joined 13:43 khw joined, sufrostico left, sufrostico joined 13:46 sufrostico left, sufrostico joined 13:47 ponzii joined, sufrostico left, sufrostico joined
ponzii Is there a more efficient way to do this: for 'logs.txt'.IO.lines -> $_ { .say if $_ ~~ /<<\w ** 15>>/; } 13:48
13:48 sufrostico left
masak mebbe: for 'logs.txt'.IO.lines { .say if any(.words>>.chars) == 15 } 13:49
13:49 sufrostico joined
masak or .say if .words.first(*.chars == 15) 13:50
timotimo really depends on what you need the << and >> for
masak 's mental colomon wakes up and tells masak to use .grep there, not .first 13:51
ponzii That's a regex not a char count
timotimo because words splits on space, doesn't it?
masak oh, right
yes, those are not identical
more similar would be to do .comb(/\w+/), not .words
13:52 sufrostico left
ponzii The Python3 and Ruby 2.4 equivalents are still 5 times faster. That's with October Rakudo. 13:53
timotimo yeah, our regexes aren't really very fast
masak I'm happily surprised to hear the others are only 5 times as fast ;)
ponzii timotimo: That's weird as in a lot of math examples Perl6 can be 25 time faster than Python. 13:54
13:54 grondilu left
timotimo of course 13:54
except if you compare perl6 vs pypy. then it's pretty much impossible to beat python :)
ponzii timotimo: ... and strings/regex has traditionally been Perl's forte
arnsholt It's pretty easily explained 13:55
Perl 5 regexes are souped-up automata
Perl 6 regexes are top-down parsers
13:55 sufrostico joined
timotimo still, a whole bunch of perl6 regexes can become completely automata-based 13:55
... in theory 13:56
13:56 grondilu joined
ponzii arnsholt: Does that mean they'll never be as efficient as Perl5 then? 13:56
13:56 sufrostico left
arnsholt Not necessarily 13:56
Lots of it can be optimized to a more efficient form
masak they could probably be a bunch faster still
arnsholt Yeah, definitely
13:56 sufrostico joined, Actualeyes left, lizmat left
masak we're just pressed for time doing all the obvious optimizations ;) 13:56
arnsholt Yeah, lots of things to do, not so many people to do it 13:57
timotimo i'm pretty sure there hasn't been a bit of work done on the regex optimizer in the last year
ponzii masak: On my machine that log file parse took Perl6 11.03 secs while PHP71 took 0.43 secs. 13:58
masak: Still perplexed how PHP7 is significantly faster than Node and Perl5
14:00 Actualeyes joined, pmurias joined
pmurias ponzii: significantly faster in general or on one particular benchmark? 14:00
ponzii pmurias: Well, file i/o + parsing but yes, Perl6 math is pretty impressive 14:01
timotimo if you think perl6 math is impressive, wait until we're able to remove all those NativeRef allocations ... 14:02
and the boxing/unboxing
and jit small-bigint-math
for math stuff, there's definitely room for improvement still 14:04
ponzii timotimo: Well, that's certainly great but maybe Perl6 adoption is going to be affected more by how well it does what Perl5 did well, ie. strings/regex?
timotimo: Perception counts for adoption.
timotimo you're certainly free to invest time in that
did you see the recent commits, btw? 14:05
lizmat made almost everything related to invoking regexes a whole bunch faster
you were saying you're using an "october rakudo"?
i think the majority of these improvement commits have been made after that release, but i could be mistaken
ponzii timotimo: Yes, just tested the latest version.
timotimo: Sorry, latest public .dmg, not recent commits. 14:06
pmurias ponzii: speed is the biggest thing holding Perl 6 back 14:10
LeCamarade And that is just a matter of time. Goodness is the main thing holding every other alternative back. And that cannot be fixed for them. 14:11
Sorry, fundamentalist Perlist here. Tried to resist. Couldn't. 14:12
viki Yes, the .match improvements were after the 2016.10 release.
timotimo i bet we can make a scan for a << much faster 14:13
14:13 Bname joined
timotimo currently it'll be trying to match a LWB every character by looking one back and one in front 14:13
we should be able to jump 2 chars each time instead of just 1
14:14 CIAvash left
viki ponzii: to me, it feels strange to measure up Perl 6 to Perl 5. It's a very different language. I'd expect people to use Perl 6 more for large OO projects, due to its rich and expressive object model. The "string and regex" sounds more like the perl -pi -e '' one liner you run at your command line. 14:15
ponzii: a crude comparison of equivalent Perl 6 and Rust code, for my point: twitter.com/zoffix/status/792398913521192960 14:16
I don't even notice Perl 6's performance issues that much any more. I think comparing to language XYZ is a bit meaingless. Real world code is what matters. 14:17
buggable: eco
14:17 LeCamarade left
buggable viki, Out of 739 Ecosystem dists, 165 have warnings and 0 have errors. See modules.perl6.org/update.log for details 14:17
ponzii viki: I think from an insider's viewpoint you're probably right but I suspect that in the job market Perl6 will be judged according to how well it does what Perl5 does well. Unfortunate but probably the case. 14:18
viki ^ if Perl 5 code does that .3s faster, I couldn't care less.
ponzii: how did you arrive to that conclusion? My impression is "the job market" doesn't want much to do with Perl 5. Why would they be comparing other langs to it?
ponzii viki: Because it's still called Perl :( 14:20
viki :)
Fair enough.
AlexDaniel heh
ponzii viki: Perl5, Perl6 invites the comparison in publications such as InformIT etc. Yes, I know they're crap but they still have influence with CTOs. 14:21
viki Well, I think our optimizations are progressing nicely. I'm putting my chips behind TimToady's remarks that we want nice organic growth; not too slow, not to fast and so far it's working.
ponzii viki: Sure, I get that. 14:22
timotimo anybody up for trying an experiment with the left-word-boundary regex thing? 14:23
i'm willing to give someone step-by-step help 14:24
viki is burnt out and is taking a ~2-3 week break.
timotimo that's fine :)
AlexDaniel I'm not quite sure why people care about optimizations so much… Like you know, we have some really basic stuff not working properly… 14:25
timotimo AlexDaniel, performance is holding me back from doing stuff i consider fun. that's why i'm interested in things getting faster 14:26
AlexDaniel timotimo: well, if you actually start doing that stuff (ignoring performance problems), you'll probably stumble upon a couple of nasty random segfaults… 14:27
so what's more important…
14:28 kaare__ joined
timotimo it's not like an optimization is as hard as fixing a nasty segfault 14:28
14:28 canopus_ joined 14:29 canopus left
jnthn AlexDaniel: As I've noted before, the things that people most want optimized are generally not the same set of things that have reliability issues. 14:29
14:30 lizmat joined
AlexDaniel which is weird, because once you stumble upon performance issues you very often start to parallelize things 14:30
jnthn: by the way, any news on #129781 ? 14:31
timotimo when i last had a performance issue and wanted to parallelize it got many times slower :)
ab6tract lizmat: i think it would be much nicer for (^) to return a bag 14:32
if any of the args were bags
lizmat well volunteered :-) 14:33
timotimo i seem to recall a big patch series to fix all manner of bag-related things
that was probably yours?
ab6tract i have a feeling i had already patched it and it got optimized away :)
timotimo: indeed :)
lizmat ab6tract: I generally don't optimize away functionality 14:34
ab6tract then i never implemented it properly :D
timotimo must have missed spec tests :<
ab6tract right now the implementation is quite nice because it gets to be an only
whereas i (think i) would need to create different candidates
jnthn AlexDaniel: github.com/perl6/nqp/commit/522487...f3efff9e89 and github.com/perl6/nqp/commit/c0e80f...53eae12a2f may well have helped with the original problem 14:35
AlexDaniel: But the ticket got mis-golfed
AlexDaniel: Valgrind uses --full-cleanup, and all the issues in the further golfed versions are nothing to do with the bug that was initially considered. 14:36
But rather, a --full-cleanup issue
14:37 pierre_ joined
ab6tract i don't suppose we use subsets/where clauses in CORE very often? 14:39
timotimo well, hopefully not :) 14:40
they're slow ;)
14:41 pierre_ left
ab6tract slower than doing the same check inside the sub anyway? 14:43
timotimo good question 14:44
14:44 sufrostico left
AlexDaniel jnthn: not sure if it helped, the issue is still there 14:47
not sure if it is the same one though, but the snippet does not run reliably 14:48
14:49 brillenfux left 14:51 sufrostico joined 14:54 synopsebot6 joined
timotimo #129781 14:54
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129781
ab6tract luckily there is a smarter way to deal with it 14:56
the tricky thing about "symmetric difference" of a list of bags/mixes
is that order matters
which means you kind of lose the symmetry bit
so maybe it is fine that they get converted to Set if there is a list of them 14:57
timotimo here i have an explosion where MVM_string_gi_init falls over a b0rked "first" when called via MVM_repr_at_key_o
lizmat ab6tract: if the order matters, how can Set/Bag/Mix wo