🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
AlexDaniel o/ 00:06
Nileee I have a question.. 00:55
sacomo hi timotimo 07:09
cpan-raku New module released to CPAN! Gnome::Gtk3 (0.27.5) by 03MARTIMM 07:19
v_m_v Hello. Yesterday I've found that solution on rosseta code: rosettacode.org/wiki/Hofstadter-Co...uence#Raku It is really nice...but also really slooow. 36 times slower then Perl. Do you know why? Can we speed it up somehow? 08:05
lizmat v_m_v: am working on refactoring the series (...) operator, which will make this run about 4x as fast without any change 08:06
but that's just the setting up... hhmmm 08:07
v_m_v lizmat: it will be still 9 times slower. Maybe something is wrong with the solution? 08:08
lizmat runs a profile 08:11
on my machine, that runs for 25.5 seconds, 17 of which are in the precalculating of the sequence 08:19
so my refactoring would take it down to about 12.5 seconds, so about 2x as fast
v_m_v here it is 36s vs 0.9s from Perl. 08:21
v_m_v can we precalculate the sequence in the other (faster) way? 08:23
lizmat my refactoring of ... will be close to optimal with all the JITtiing 08:30
so don't expect much there for manual rewriting
in the profile, that drowns out all of the other stuff, so not very useful to look at now 08:31
I suspect the Z/ Z=> to be relatively expensive
v_m_v I am just wondering...maybe we should move raku to different existing VM? One of the biggest issues right now is not the lack of functionalities but the speed / resources ratio. 08:34
lizmat have you seen jnthn's latest video presentation ?
v_m_v no. Do you have a link ?
lizmat main article in the last Rakudo Weekly News: rakudoweekly.blog/2020/04/13/2020-...-surprise/ 08:35
v_m_v Oh, with RakuAST it should be quite easy to move it to llvm or Graal ..right? 08:36
lizmat possibly, it is higher level than AST 08:38
MasterDuke v_m_v: pmurias has started to port the jvm backend to graalvm/truffle github.com/Raku/nqp/tree/truffle 08:49
some completely artificial microbenchmarks (that have to be run long enough to compensate for the jvm's slow startup) have shown to be faster than moarvm 08:52
El_Che being unix centrix, I have some trouble running my tests on windows: 'run' failes (I check the exitcode and output). I've tried several incarnations with "cmd.exe /c". Here is the test in question. Pointers appreciated: github.com/nxadm/SuperMAIN/blob/ma...kutest#L11 09:11
sena_kun AlexDaniel, I think it lacks a newline somewhere: gist.github.com/Altai-man/50db11ae...e91209ae80 ? 09:21
sena_kun What I'd be more happy about is how to get rid of those strange broken modules that somehow succeed for for any old revision (even though they are broken for years) and then are bisected to some nonsense commit, because most of the items in this gist are those. 09:23
AlexDaniel sena_kun: fixed: gist.github.com/AlexDaniel/223d187...51813890d0 11:16
AlexDaniel Altai-man_: ↑ 11:16
I'll also patch blin…
Altai-man_ AlexDaniel, the new format looks great! I wonder if now we can investigate how some of the modules listed can pass on every old revision regardless of what you try, while being obviously broken for years, and failing to install when you try it out locally with the same revision. 11:20
AlexDaniel Altai-man_: example?
Altai-man_ E.g. November is listed (and about every other from this list, not all of them). 11:21
I was running it with `--old=2020.02`. On my local 2020.02 it dies just fine.
But Blin somehow gets it working.
tadzik wow. I wrote myself a Perl script for a work tool, it starts up slow because it uses DateTime. I ported it to Raku for comparison and Raku is *almost* faster 11:22
Altai-man_ AlexDaniel, and the commit it "bisects" them too is always the `new` revision.
tadzik (at least in wallclock time, CPU time is almost twice as much as Perl)
Altai-man_ So no matter what new and old you set, November will be always showing up as Fail and "bisected" to new. 11:23
Xliff o/
m: my $a = 'abcdefg'; sub separate (Str $s) { ( $s.substr(0, $s), $s.substr($s, *) ) }; $a.&separate(3).say 11:24
camelia Too many positionals passed; expected 1 argument but got 2
in sub separate at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my $a = 'abcdefg'; sub separate (Str $s, Int $p) { ( $s.substr(0, $p), $s.substr($p, *) ) }; $a.&separate(3).say
camelia (abc defg)
AlexDaniel Xliff: what's the meaning of this .chomp? github.com/Raku/Blin/commit/2049de...5cd6b54d1#
lizmat tadzik: care to gist ? see if we can make it faster still? :-) 11:25
tadzik lizmat: I started by updating Raku to something form this year :) But yes, will do
Xliff AlexDaniel: It takes that last carriage return OUT of the output since say already will emit one.
tadzik both versions can probably be improved...
Xliff I thought that was pretty clear.
AlexDaniel Altai-man_: that's absolutely bizarre I have never seen it behave this way 11:26
Altai-man_ :(
AlexDaniel Xliff: yeah cuz we're lacking some newlines… :D
Xliff If that fixes the problem, feel free to remove it.
Altai-man_ I wonder if I can reproduce this using only a single module...
AlexDaniel Xliff: yeah, testing it right now
Xliff m: my $a = 'abcdefg'; sub separate (Str $s, Int $p) { ( $s.substr(0, $p), $s.substr($p, *) ) }; $a.&separate(3).say 11:27
camelia (abc defg)
tadzik lizmat: gist.github.com/tadzik/ca52a6ef8d1...45b92ed913
Xliff ^^ Is there a String op for this, or
tadzik Rakudo 2020.02 seems *slightly* faster, but still slower than Perl 11:27
lizmat tadzik: ++$date ? 11:28
tadzik I thought they're immutable...
but they're not apparently :)
equally fast though, it seems
AlexDaniel 6c: gist.github.com/AlexDaniel/531999d...291c3744bf 11:29
lizmat tadzik: Date objects are immutable, but if they're in a container, it can fill the container with a new Date object :-)
AlexDaniel maybe 10000 is too much :)
Altai-man_ I was recently running some 2009 time benchmarks from examples repo. Not 1600 times slower these days, but github.com/Raku/examples/blob/06cd...ut/RESULTS
tadzik lizmat: oh, right :) 11:30
AlexDaniel let's try 100 times first xD 11:31
AlexDaniel 6c: gist.github.com/AlexDaniel/531999d...291c3744bf 11:31
committable6 AlexDaniel, gist.github.com/02c20773701dbb95d1...c33ffa93aa 11:32
Xliff m: (2**15).base(2).^name
camelia ( no output )
Xliff m: (2**15).base(2).^name.say
camelia Str
lizmat tadzik: also, superstitious parens ? 11:33
tadzik lizmat: yes. Relic from Perl :)
lizmat not that that will matter for ececution
tadzik there were actually very little changes I had to make from one version to the other, mostly removing the `use`s :) 11:34
lizmat sometimes I wonder whether we should have a "last-day-of-the-month" method 11:34
you could then do something like: say ($date .. $date.last-day-of-month).grep( *.day-of-week < 6 ).elems 11:36
tadzik ^^
tadzik lizmat: ah, that's elegant :) last-day-of-month and such I usually just do with .month++;day=1 11:48
lizmat that's the first of next month ? 11:48
AlexDaniel 6c: gist.github.com/AlexDaniel/531999d...291c3744bf 11:49
committable6 AlexDaniel, gist.github.com/678d3da87ed5788d9b...562384b91a
AlexDaniel 6c: gist.github.com/AlexDaniel/531999d...291c3744bf 11:50
tadzik lizmat: oh, right. One more day-- then ;)
lizmat yeah, but that's very resource consuming
there is actually a "days-in-month" method 11:51
tadzik I guess the overall slowness is still mostly just startup time
committable6 AlexDaniel, gist.github.com/9b269534e4320008db...cde4e9ab29
tadzik the reason it "matters" to me is because I use this in tools I run very often, like "it's in my .zshrc" often 11:52
AlexDaniel lizmat, tadzik: ↑ oh wow :)
tadzik and the tools are in Rust, but I do have Perl hooks in there ;)
AlexDaniel: ha. We've come a long way :) 11:53
AlexDaniel I wonder if it's throwing away a bit too much of code… let's try printing the stuff…
6c: gist.github.com/AlexDaniel/531999d...291c3744bf
tadzik AlexDaniel: you're only say() ing once :) 11:54
AlexDaniel yeah because otherwise it'll say 2000 times :)
tadzik but again: even `time raku -e 'say "ok"'` is slower than the Perl version 11:55
committable6 AlexDaniel, gist.github.com/f82a3ee46c10d55c85...ea6840ceaf
tadzik so I don't think anything in code itself can be much improved :)
lizmat yeah, in Perl compiling the DateTime module is what is costing you
tadzik yeah 11:57
lizmat AlexDaniel: the gist should probably read "say now - INIT now", as you don't want improvement / worsening of parsing to be included? 12:27
then again, "now" itself has also become about 2x as fast recently :-)
AlexDaniel lizmat: don't think it matters, but feel free to fork it and rerun : 12:28
:)
tbrowder hi folks 13:02
i have a grammar question: 13:03
tbrowder um, belay that, not ready yet... 13:05
jjatria I'll go then: I have code that broke when I moved classes into their own files. Raku complains about not being to resolve a method: gitlab.com/jjatria/widget-experime...it/49ad3da 13:06
Any ideas why?
Geth_ ecosystem: nxadm++ created pull request #486:
Add SuperMAIN to ecosystem
ecosystem: 0fe174566e | (Claudio Ramirez)++ | META.list
Add SuperMAIN to ecosystem

See github.com/nxadm/SuperMAIN
13:07
ecosystem: 2c75110477 | nxadm++ (committed using GitHub Web editor) | META.list
Merge pull request #486 from nxadm/master

Add SuperMAIN to ecosystem
tadzik ah, nice that %SUB-MAIN-OPTS<named-anywhere> = True is a thing 13:08
I used to this by sorting @*ARGS :>
El_Che tadzik: lizmat++ added after my nagging 13:09
tadzik El_Che++ lizmat++ :)
is there a module yet that'd do MAIN canditate disambiguations? 13:10
El_Che tadzik: what do ou mean? Which applies when multi is used?
tadzik: what do ou mean? Which MAIN applies when multi is used?
tadzik I wrote it manually myself recently for my worktracker: tadzik.net/ss/xujYqW9zz.png 13:11
(that's in Rust though)
it's how mercurial does it, I think
El_Che nice
the lines are after a tab?
like shell completion on steroids? 13:12
tadzik those are the proposed solutions, yes
El_Che make working with it very nice
tadzik well, it doesn't do anything with the shell. It's basically just multi-matching with some leniency :)
El_Che a leftover MAIN that catches everything? 13:13
tadzik git.tadzik.net/tadzik/work-rs/src/...in.rs#L347
El_Che if so, nice idea
tadzik I don't know how that'd work in Raku
(the code above is a bit overly complicated :)) 13:15
El_Che tadzik: that would be a dream PR for SuperMAIN and probably tripple the line count :P 13:15
tadzik :D
tadzik I wonder if you could hook somehow into the exception that gets thrown where multiple multi canditates fit 13:16
and then just list them all in a subset of --help, basically
El_Che it would complicate things because you want it to work also when nothing matches 13:18
tadzik hrm, right 13:19
El_Che tadzik: you're man with good idea's, sir
tadzik hehe, just a long (selective) memory
El_Che as long as you don't start loosing your short one, it's a great thing :) 13:20
tadzik someone was advocating mercurial to me, some 10 years ago and I thought "I think I prefer git but this prefix matching is really nice"
El_Che: losing my short what?
:>
El_Che tadzik: what you talking 'bout? :P
tadzik what a confusing conversation!
El_Che tadzik: who are you sir and why don't you have any trousers on?? 13:21
:)
tadzik ha, but I have! Since this whole quarantine business there's actually two people in my home office, which requires some discipline 13:23
El_Che Where do you live nowdays? Poland? Viena? 13:24
tadzik Poland, Warsaw 13:25
no changes, yet...
I wish I moved out of here before I planted the roots, even if they're not very deep yet
El_Che last time I saw you, you had I baby, I think 13:26
tadzik oh, that must've been a different person then 13:27
unless I do have a really bad memory :D
El_Che no, it was you, maybe the baby thing was my bad memory :)
tadzik :)
timotimo i just learned about new readable syntax for some regex constructs in perl 17:14
timotimo (*nlb:pattern) 17:15
(*negative_lookbehind:pattern)
chloekek Nice. 17:17
timotimo our perl5re support is, of course, rather poor at the moment :( 17:21
adding these syntaxes will not do much for their usefulness i guess
chloekek wanna write something in Perl 17:31
[Coke] wonders if it's worth improving our perl5re support if Inline::Perl5 exists. 17:40
timotimo it'd be amazing if we could come up with sensible semantics for mixing p5 and rk regexes in literally the same regex 17:42
the rules for determining capture numbering differ quite a bit, so that could be very weird 17:43
[Coke] O_o
I feel like if you want p5 regexes, you are all in on that.
timotimo but being able to rewrite regexes line-by-line and trying to keep tests green ... that could be amazing
Grinnz i think it was previously suggested to allow use of PCRE and delegate to Inline::Perl5 for perl5re, which seems more future proof
[Coke] mix and match seems too much
timotimo mhh
fwiw, i'd appreciate if we had regex modules for a boatload of dialects (but i wouldn't appreciate it enough to actually work on it) 17:44
Grinnz otherwise you are just making another PCRE :P
timotimo like, being able to just copypaste a regex from js, from java, from python, from an html5 attribute, from sed, from awk, ... 17:45
[Coke] any nqp jvm users here?
Grinnz luckily half of those are probably PCRE
js is not
[Coke] (have a PR which deletes a bunch of stuff that could use some testing)
timotimo recently i wished to make a point to someone that "pcre is great because all languages have it!" by showing them a table with how each dialect calls the different constructs 17:46
but i could not find any such table
maybe i'm actually wrong and they are all actually very much the same
Grinnz i would say they are very much not the same unless they are actually just linking to PCRE
and of course, there's now pcre1 and pcre2 17:47
chloekek RCRE when.
Grinnz when you write it as a C lib ;)
timotimo offer it via an RPC mechanism :D 17:48
literally a dbus-activate-able service for rk regex evaluation 17:49
robertle I am wondering: if I want to do some closed-source raku development in my mega-corporation, I need some sort of private CPAN or so where my legion of developers and their CI jobs can upload module tarballs and where they can fetch it with zef. How could I set this up? 18:06
MasterDuke robertle: i think nine or ugexe are the people to ask 18:07
lizmat robertle: depending on your sense of paranoia, you could use private repos on Github / Gitlab 18:08
robertle lizmat: right, but a git repo isn't the same as an artifact store for built and versioned modules, of course with some overlap due to the way zef works... 18:09
lizmat well, the concept of a recommendation manager was to allow a company to set up its own recommendation manager for in-house usage 18:10
that could use internal as well as external content storage
robertle and I am not very paranoid :) but the workflow needs to be right, kinda around how you release a module versio and then use it in other builds... 18:13
and how you automatically test new versions
I am kinda on the edge of cobbling something together and am wondering whether that's stupid or already exists... 18:18
lizmat I'm afraid there's nothing for that out of the box atm
and I would be willing to help you with implementing some recommendation manager ideas :-)
robertle I don't quite understand what you mean with that, could you elaborate? where does the "recommendation" part come in? 18:19
sena_kun I suspect if you have a legion of developers or at least one, you might simply patch zef upstream to have a nice implementation of deathbyperl6.com/zef-plugins-a-ver...a-glimpse/ and then write a plugin that'll work with your custom repos and so on. 18:21
lizmat robertle: design.raku.org/S22.html#recommendation_manager
robertle sena_kun: correct, and also an artifact server where you can push your tarballs to, that's exactly what I mean. just wondering if that artifact server already exists 18:23
not sure you need a zef plugin if you use the cpan method, but I guess it would need patches to support some form of authentication 18:24
lizmat design.raku.org/S22.html # maybe more inspiration ?
sena_kun robertle, AFAIK, zef (or "raku package manager") is agnostic to ecosystem, if the question is "how to create such an ecosystem", I wonder if pinging patrickb makes sense. 18:26
robertle aha, now I get it. I think what I am looking for is the "content storage" service! 18:27
patrickb Hi! 18:32
hankache hello #raku 18:52
what is the native type equivalent to wchar_t? 18:53
patrickb ping tadzik 18:57
tadzik: We didn't finish our conversation a few days ago...
tadzik ah, indeed 19:20
I'm okay with deprecating rakudobrew
so feel free to throw in a fitting README change in a PR :)
El_Che I think many people still use it 19:22
patrickb tadzik: OK, will do! 19:24
El_Che: What do you think is the best way forward?
El_Che I think binaries and source is the way forward, and rakudobrew could still be a ecosystem tool for those that like or need the functionalities 19:26
patrickb El_Che: Not sure I understand. Is there any functionality that rakudobrew provides and rakubrew regressed at? 19:27
El_Che rakudobrew let's you build the source easily. I don't use it myself, but I think some people find that useful 19:29
lets
tadzik is the maintainer, so it's up to him anyways. Just my 2c
tadzik El_Che: rakubrew is basically patrickb picking up rakudobrew, improving it and maintaning since I stopped, it makes sense to direct users there these days. The usecase is pretty much the same 19:32
patrickb is rebooting to linux. Back in a minute or so 19:33
[Coke] tadzik++ patrickb++ 19:39
El_Che both your work is appreciated 19:50
Geth_ doc: jjatria++ created pull request #3342:
Corrects minor mistakes on DEPRECATED Attributes
20:02
Geth_ doc: 6b5e37ba35 | (Konrad Bucheli)++ | doc/Type/Iterable.pod6
how to flatten itemized sublists
20:10
doc: e8a9199591 | (Konrad Bucheli)++ | 2 files
add 'the' where it makes sense
linkable6 Link: docs.raku.org/type/Iterable
doc: f9b80c73cb | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 2 files
Merge pull request #3341 from kbucheli/decontainerize_before_flat

how to flatten itemized sublists on an Iterable
doc: 04965f86fc | (José Joaquín Atria)++ (committed using GitHub Web editor) | doc/Type/Attribute.pod6
Corrects minor mistakes on DEPRECATED Attributes

The previous phrasing made it sound like calling `DEPRECATED` was somehow mandatory for attributes marked as such, which is probably not what is meant.
This patch also corrects the name of a variable used in an example.
linkable6 Link: docs.raku.org/type/Attribute
doc: 3df3f38478 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Type/Attribute.pod6
Merge pull request #3342 from jjatria/patch-1

Corrects minor mistakes on DEPRECATED Attributes
patrickb tadzik: github.com/tadzik/rakudobrew/pull/152 21:12
tadzik patrickb: merged, thanks :) 21:14
guifa2 What is the advantage to using proto token foo:sym<bar> instead of just proto token foo:bar ? 21:15
chloekek p6: say vCard.raku; 21:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
vCard used at line 1
jdv79 how does one interpolate a method call in a regex? 21:32
m: class c { method m {"asdf"}; method r {"foo" ~~ /<{self.m}>/} }; c.new.r 21:33
camelia No such method 'm' for invocant of type 'Match'
in method r at <tmp> line 1
in block <unit> at <tmp> line 1
guifa2 The self in that case ends up giong to the Regex object IIRC, I'd store self in a var and reference that 21:52
jdv79: m: class c { method m {"a"}; method r { my $self := self; "abc" ~~ /<{$self.m}>/} }; c.new.r 21:54
m: class c { method m {"a"}; method r { my $self := self; "abc" ~~ /<{$self.m}>/} }; say c.new.r
camelia 「a」
jdv79 .seen ufobat 22:26
tellable6 jdv79, I saw ufobat 2019-12-12T16:29:03Z in #raku: <ufobat> what would you suggest to install raku, rakudobrew or install the sources from rakudo.org (manually)?
discord6 <BrightLight> Hello, new to Raku; I come with a background of Common Lisp, D, and Forth. I have a question about Raku's compilation model - are there any particular semantics in Raku that make it difficult for it to be fully native code? In the common lisp world, despite being dynamically typed and image-based, most implementations are high-performing native, incremental compilers. Even the most dynamic of code (redefinition of classes and metaobject 23:53
protocol stuff) is compiled to machine code. What pitfalls does Raku have that prevent it from doing the same? Thank you in advance.
timotimo with moarvm we're relying on dynamic specialization to gain performance, which also includes jit-compiling to machine code 23:55
i can answer more specific questions 23:57
discord6 <BrightLight> Is there an option of AOT compilation to machine code?
timotimo there is not, unless someone secretly developed such a thing 23:58