Perl 6 language and compiler development | Logs at colabti.org/irclogger/irclogger_log/perl6-dev | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
Set by Zoffix on 27 July 2018.
00:08 lucasb left
patrickb I'm not merging my spaces-in-path PRs in nqp and rakudo yet. Travis for the nqp PR fails. Interestingly the exact same command that fails on travis works locally (it's the linker not finding references to some functions in libmoar.so). I'm pretty clueless as to what could be the cause or how to debug sumething like that. 00:32
travis-ci.org/perl6/nqp/jobs/560773407 <- that's the failing job 00:33
I'm open for any clues on what could be done to track this down. 00:34
The nqp-configure and MoarVM PRs that belong to the same set are already merged, but shouldn't break anything else.
patrickb is off to bed
o/ 00:35
00:35 patrickb left
AlexDaniel so I'm about to autocreate a bunch of rakudo github releases 00:49
please don't kill me if it goes wrong :)
00:54 Kaiepi joined
Geth rakudo: ecf2b1e4fa | (Aleks-Daniel Jakimenko-Aleksejev)++ | tools/releasable/github-release.p6
Add a script for managing github releases

This script was used to upload all previously released tarballs to github releases.
03:13
AlexDaniel done!
github.com/rakudo/rakudo/releases github.com/perl6/nqp/releases github.com/MoarVM/MoarVM/releases
moarvm releases are a bit LTA because there's no announcement file, but feel free to hack a bit of code to pull sections from the changelog 03:14
I can the rerun it and it'll update descriptions
03:39 pamplemousse left 05:14 Kaypie joined, Kaiepi left 05:36 squashable6 left 05:37 squashable6 joined
lizmat Files=1281, Tests=108646, 200 wallclock secs (27.06 usr 7.97 sys + 2781.76 cusr 288.49 csys = 3105.28 CPU) 06:33
06:43 hankache joined
nine I just read that the 2012.06 release is finally out of the door. About time! 06:45
yoleaux 18 Jul 2019 22:26Z <MasterDuke> nine: what is github.com/perl6/nqp/blob/master/mbc.nqp used for?
Geth nqp: cf84b86dd4 | (Stefan Seifert)++ | mbc.nqp
Remove prototype for the bytecode writer

This code has long moved on to QASTCompilerMAST and friends. Thanks to MasterDuke++ for noticing!
06:47
nine .tell MasterDuke what mbc.nqp? I don't see an mbc.nqp. Why would there be a leftover prototype lying around? You must be imaginging things! *slowlybacksoutoftheroom* 06:48
yoleaux nine: I'll pass your message to MasterDuke.
06:53 robertle_ joined 07:01 hankache left 07:07 patrickb joined 09:35 robertle_ left 09:37 robertle_ joined
lizmat www.reddit.com/r/perl6/comments/ce...h/eu7gzbe/ 10:15
11:14 patrickb left 11:37 patrickb joined 11:49 patrickb left 11:58 patrickb joined
lizmat m: my \foo = "a"; dd (foo => 42) # wonder if that is a bug or not 12:54
camelia :foo(42)
lizmat one could also expect :a(42) as the result
m: sub foo() { "a" }; dd (foo => 42) # I guess not, as with subs it's the same 12:55
camelia :foo(42)
jnthn Not at all, `<ident> \h+ '=>'` always beats just the name as a term in LTM
(By design.)
It'd be pretty horrible if you couldn't reason about that syntactically :) 12:56
lizmat still, I don't see what LTM has to do with this ?
isn;t it about what it matched and how that gets interpreted ? aka the "foo" ? 12:57
ahh... **including** the fat comma
ok, gotcha
jnthn No, it literally wins in the parse because `<ident> \h+ '=>'` is the longest token :)
"token" :)
lizmat somehow "token" means "whitespace delimited" in my head :-) 12:58
but it's not :-)
twitter.com/khaledelboray/status/1...8859364353
nine I love reading blog posts where people stumble upon cases where Perl 6 is just faster than Perl 5 :) 13:06
timotimo something must be wrong!! 13:07
lizmat yeah: what's wrong is that you shouldn't do "use bigint" in Perl 5 13:10
[Coke] I know that the was the plan, but it does surprise me (happily) to read those.
lizmat also: in the code of blogs.perl.org/users/veesh/2019/07/...l#comments
I found that 90+% of CPU is spent in stringfying the value 13:11
my startup of rakudo is .12, total run is about .38, and .2 is for stringifying 13:12
the 90+% is from a --profile 13:13
the .2 is from timing the actual stringification
timotimo does the figure change much when you use now - $before?
lizmat which figure ?
I mean, the .2 is just that
timotimo i mean does the profiler overhead skew the result noticeably? 13:14
lizmat my $a := A($m, $n); my $then = now; my $s := $a.Str; say "stringification took { now - $then } seconds";
profiler said it ran for .21 13:15
timotimo wonderful
lizmat so the .2 I'm seeing is definitely in the 90+% range in respect to that
jnthn I thought that stringifying a bigint largely delegated to libtommath and so the hard work is done in C code. Hmm.
lizmat maybe it is just a lot of hard work :) 13:18
I mean, turning it into hex should be a lot easier :-) 13:19
timotimo yeah, probably
jnthn callgrind it, maybe :) 13:24
[Coke] jnthn: no pressure, but have you seen my Proc::Async ticket? 13:28
jnthn [Coke]: Yes, if it's the handle leaking one 13:30
[Coke] Cool. I did try to remove the conditional close that bind-stdin does (and just close all the time), same error, so I've exceeded my cleverness setting. :) 13:31
Thanks, again, no pressure. 13:32
|Tux| Rakudo version 2019.07-69-gecf2b1e4f - MoarVM version 2019.07-15-g53a6308c4
csv-ip5xs0.703 - 0.717
csv-ip5xs-205.242 - 5.446
csv-parser21.936 - 22.213
csv-test-xs-200.417 - 0.426
test6.349 - 6.839
test-t1.711 - 1.753
test-t --race0.774 - 0.806
test-t-2028.082 - 28.463
test-t-20 --race8.977 - 9.153
14:17
14:21 discord6 left, discord6 joined, discord6 left, discord6 joined
patrickb I'm still puzzled by this travis failure which I'm unable to reproduce locally: travis-ci.org/perl6/nqp/jobs/560773407 14:22
timotimo yes, wtf happened there 14:23
nine So, I successfully restored the performance optimized code paths after fixing my Inline::Perl5 memory leak and could run a first test: csv-ip5xs took 3x as long with the fix
patrickb Any hints on what I could do to debug this are very welcome.
[Coke] nine, that sounds amazing.
nine Then I did a first optimization of the new code and got rid of a `$value.^mro.grep: {$_.HOW ~~ Inline::Perl5::ClassHOW}` in the cases where I knew that to be True and I'm now down to ~10% performance loss 14:24
timotimo good 14:25
nine I'm actually surprised how little it is 14:26
timotimo patrickb: any reason why perhaps MVM_PUBLIC wouldn't have the right value? 14:27
patrickb timotimo: But it links libmoar.so to which the moar executable of the preceding moar build already linked to successfully 14:28
timotimo hum ... 14:29
nine That's an odd error indeed
patrickb The error message would be different if it didn't find libmoar.so, right?
timotimo i think so 14:30
sometimes the problem is the order of -l flags, but it doesn't seem to be the case here either
nine Btw. for my memory leak fix I implemented creating P5 wrapper packages for P6 classes. This will eventually lead to a `use v6-inline 'Foo'; Foo->new` for Perl 5 code. 14:41
jnthn nine++ 14:42
vrurg jnthn: I just have opened a problem-solving ticket with perhaps a biggest language design problem I've seen so far: github.com/perl6/problem-solving/issues/71 14:44
14:47 lucasb joined
nine Of course, there's also new issues: t/use.t .............. Can't load '/home/nine/Inline-Perl6/blib/arch/auto/Inline/Perl6/Perl6.so' for module Inline::Perl6: libmoar.so: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.28.1/x86_64-linux-thread-multi/DynaLoader.pm line 193. 14:50
patrickb: any idea?
Seems like the library path no longer gets compiled into Inline::Perl6' Perl6.so 14:51
14:51 robertle_ left
nine needs to get off the train 14:52
discord6 <Nobody> Does Rakudo do tail call optimizations? 14:53
timotimo it doesn't
discord6 <Nobody> Ok, thanks
timotimo not automatically anyway
discord6 <Nobody> Was this the wrong channel to ask this
timotimo no, it's fine
i'm not entirely sure if nextsame will keep the number of stack frames the same 14:54
patrickb nine: That's also a strange one.
nine: I'll have a look later. 15:00
15:10 patrickb left 15:12 squashable6 left 15:16 squashable6 joined 15:27 pamplemousse joined 15:45 robertle left
AlexDaniel c: all sub f(--> Nil) { say "{1}"; }; sub g(--> 2) { say "{1}"; }; sub h { say "{1}"; }; f; g; h; 16:02
committable6 AlexDaniel, gist.github.com/5d984e23482807fb04...05e10e3d6f 16:03
16:04 pamplemousse left
Geth Ā¦ rakudo: AlexDaniel assigned to chloekek Issue String interpolation with block evaluates to declared return value of enclosing routine, if any github.com/rakudo/rakudo/issues/3070 16:05
ugexe something weird about that is `say 1` should be returning True, and thus fail the Nil type check. but it doesnt? 16:08
m: sub f(--> Nil) { say 1; }; say f()
camelia 1
Nil
ugexe m: sub f(--> Bool) { say 1; }; say f() 16:09
jnthn --> Nil isn't a type check, but rather a request to return Nil
camelia 1
True
ugexe ah of course 16:10
16:45 pamplemousse joined
timotimo i just turned a bunch of modules and a bin/ script into one single file with a little perl6 script :3 17:03
17:07 MasterDuke joined
MasterDuke lizmat: code.activestate.com/lists/tcl-core/13692/ would seem to suggest libtommath could be made a bunch faster at stringifying big numbers 17:08
yoleaux 06:48Z <nine> MasterDuke: what mbc.nqp? I don't see an mbc.nqp. Why would there be a leftover prototype lying around? You must be imaginging things! *slowlybacksoutoftheroom*
MasterDuke nine: my mind must be playing tricks with meā€¦ 17:09
17:09 MasterDuke left
timotimo github.com/timo/App-MoarVM-Confpro...e_script.p 17:09
github.com/timo/App-MoarVM-Confpro..._script.p6
is it bad and i should feel bad? 17:39
ugexe it is bad. but you should not feel bad 17:40
timotimo i'm relieved
do you have ideas how to improve upon it? i mean, string replacement is of course not a great idea in general for code :)
but maybe something i can change that's not an amount of work equivalent to a full rewrite? 17:41
ugexe all the problems i see with it i'm sure you're well aware of lol 17:45
timotimo haha
i had to put a "don't make a dependency of a module to itself" check in because the ConfprogCompiler module has some pod in it with a usage example that has "use [...]ConfprogCompiler" in it 17:46
ugexe what does $?FILE output? 17:47
timotimo in what position? 17:48
17:50 robertle joined
ugexe inside a module that is packed with the script 17:52
will it give the module file path, the script file path, or non-sense?
timotimo i'd assume the script file path 17:59
yes, that is the case 18:01
ugexe i wonder how we'll get scripts that use e.g. $*DISTRIBUTION or %?RESOURCES working with that 18:02
18:27 patrickb joined
timotimo build a slang that has some special syntax to cut the module into pieces? 18:54
i mean, perl5's FatPack or what it's called is dependency-less, right? apart from perl5's core? 18:55
core and included modules
ugexe i guess it'd juts have its own CUR to handle that 19:07
patrickb is setting up a xenial ubuntu VM to reproduce the travis environment :-S 19:16
vrurg Funny, CORE.setting doesn't build if default language is set to 6.c... 19:28
19:34 lucasb left
TreyHarris Anyone happen to know if I can subscribe and configure Slack/GitHub integrations (er, "apps" now I guess) on (for instance) perl6/perl6-mode (for which I'm an admin) on my family Slack without its affecting anyone else? 19:55
It's a nicer interface than email to watch the stream of issues go by 19:56
The docs are rather unclear since they appear to envision GitHub orgs as having one-to-one relationships with business groups who would have a single Slack 20:00
20:07 MasterDuke joined
patrickb nine: I can't manage to reproduce the Inline::Perl6 test failure. 20:13
nine: I have installed a perl6 2019.07 using rakudobrew, then a perl 5.30 using perlbrew, then `zef install Inline::Perl5`, then cloned Inline-Perl6, `perl Makefile.PL`, `make`, `make test` 20:15
TreyHarris timotimo: did you write that script by hand? B/c it seems like nearly every package will have a "use <itself>" line in pod in a synopsis or something 20:18
AlexDaniel jnthn++ 20:21
(great progress on problem-solving tickets)
timotimo TreyHarris: i wrote it by hand 20:22
AlexDaniel jnthn: re ā€œsearching the IRC log doesn't seem to workā€, maybe try quotable?
quotable6: QuantHash
quotable6 AlexDaniel, OK, working on it! This may take up to three minutes (4582161 messages to process)
AlexDaniel slow but you can give it any perl6 regex
quotable6 AlexDaniel, 193 messages (2013-10-02āŒ2018-04-12): gist.github.com/649fd2ad0865dec41d...6719815678 20:23
patrickb YAAAY I can reproduce the travis failure!
I start to suspect the gcc version used on travis 20:24
AlexDaniel aw crap :)
patrickb: favorite kind of issues github.com/rakudo/rakudo/issues/2988 20:25
patrickb it's gcc 5 on travis 20:26
ugexe openbsd probably uses some old ass gcc too 20:27
patrickb it's the order of arguments 20:33
-lmoar needs to be behind the .o file
timotimo it does?
why doesn't it have to be before?!
patrickb Dunno. But I guess I know what I'll have to do now. 20:34
Yup. Stuff is working now. 20:46
Geth nqp/master: 23 commits pushed by (Patrick Bƶker)++
review: github.com/perl6/nqp/compare/cf84b...70e4214753
patrickb Is there a way to retrigger an appveyor build of a PR? 20:49
Wait, I think an nqp bump might be in order anyways. How does one do that? 20:50
timotimo aye, on the appveyor page of the build there's a restart button
i used to know how to do that but then the files moved
patrickb timotimo: Not for me
timotimo also there's a script that gives you a nice output of the commits your bump brought in
patrickb I'll just look at a previous bump... 20:51
timotimo that ought to do it
patrickb tools/templates/NQP_REVISION is the file 20:52
jnthn AlexDaniel: Can you constrain quotable6 to a nick?
patrickb timotimo: Where's the bump utility? 20:56
jnthn quotable6: TimToady set flattening
quotable6 jnthn, OK, working on it! This may take up to three minutes (4582161 messages to process)
timotimo the Z script has one, at the very least
but it really wants to own your checkouts of moar, nqp, and rakudo 20:57
quotable6 jnthn, 4 messages (InfāŒ-Inf): gist.github.com/41ea817936a4a81147...b2c651cd19
jnthn Inf? :D 20:58
oh...it's Perl 6 regex
quotable6: TimToady .+ "set flattening" 20:59
quotable6 jnthn, OK, working on it! This may take up to three minutes (4582161 messages to process)
jnthn, Found nothing!
patrickb TIL the string in the version file is just the output of `git describe`. 21:00
[Coke] :) 21:01
jnthn quotable6: TimToady .+ "set" .+ "flattening"
quotable6 jnthn, OK, working on it! This may take up to three minutes (4582161 messages to process)
jnthn I don't seem to be very good at this bot :)
I'm sure the topic was about sets, flattening, and set of set 21:02
quotable6 jnthn, Found nothing!
jnthn afk for a bit 21:03
AlexDaniel timotimo: not exactly, I use separate repos for that 21:04
but I only use it for bumps
jnthn: I don't think you can constrain it to some specific nick :( 21:05
github.com/perl6/whateverable/issues/271 21:06
it's unlikely I'll ever work on quotable6 unless it is fixed to work with colabti, or something
quotable6: .+ "set" .+ "flattening" 21:07
quotable6 AlexDaniel, OK, working on it! This may take up to three minutes (4582161 messages to process)
AlexDaniel timotimo: github.com/rakudo/star/issues/141 21:08
timotimo: can you fix that?
same link but should be rakudostar.com/latest/star/win64 I think 21:09
so a redirect will do
timotimo but we don't have rakudo star releases on github? 21:10
AlexDaniel rakudostar.com/latest/star/
we have them here :)
for now, at least
quotable6 AlexDaniel, Ā«timed out after 180 secondsĀ» Ā«exit signal = SIGHUP (1)Ā»
timotimo oh
not the same link as the other redirects you mean
AlexDaniel yeah
timotimo seems to work now 21:11
AlexDaniel timotimo: the one for windows doesn't: rakudo.org/latest/star/win64 21:13
other ones have an extra slash after a redirect: rakudo.org/files/star//macos
21:14 rml joined
timotimo ah, it must turn win64 into windows? 21:15
that works now
AlexDaniel timotimo: thank you! 21:16
ā€œFYI, rt.perl.org went read-only for Perl6 bugs ~4 months ago.ā€ 21:17
xD
I didn't know
is anybody waiting for a point release, by the way? 21:20
does it make sense to make one?
here's the discussion: github.com/rakudo/rakudo/issues/3067
fwiw even though the next one is scheduled for September, there's no guarantee that it will actually happen in September 21:21
given how explosive the current development efforts are
timotimo moar had some very important changes just after the release
AlexDaniel timotimo: ā€œsomeā€ which are linked from that ticket or not? 21:22
( github.com/rakudo/rakudo/issues/3067 )
timotimo i'd also love the confprog changes 21:23
9cf16bb7b and e07c0f252 21:24
patrickb appveyor currently shows some test failures for my spaces-in-path PR. I looked a bit in to them, they are all far away from any build system concerns. I'm inclined to merge. Any objections?
AlexDaniel timotimo: leave a comment, please
patrickb: you can do whatever you want on master :) 21:25
especially that far from the next release
timotimo OK
Geth rakudo/master: 11 commits pushed by (Patrick Bƶker)++
review: github.com/rakudo/rakudo/compare/e...28730e7023
21:26
AlexDaniel patrickb: why is appveyor unhappy though? Didn't we fix that 06-struct.t issue?
MasterDuke interesting. my first attempt at implementing that Barrett stringification algorithm starts getting faster than plain ~ at around 2**75000, which has 22578 chars
patrickb AlexDaniel: ci.appveyor.com/project/rakudo/rak...lyug97qbxc
MasterDuke and that's implementing it in pure perl6 21:27
AlexDaniel patrickb: that's not right, please file a ticket :S
patrickb: and yeah, the struct problem is still thereā€¦
this was the ticket: github.com/rakudo/rakudo/issues/3009 21:28
MasterDuke though i've not done it exactly right, my stringification is a couple chars shorter 21:29
timotimo that's pretty neat 21:31
patrickb AlexDaniel: Any objections to merging te binary release guide? 21:43
AlexDaniel ah, that PR was not merged
geez
patrickb I didn't want to merge it before the spaces-in-path thing was in.
I guess that's a yes. :-) 21:44
AlexDaniel no, not that one
this github.com/MoarVM/MoarVM/pull/1138
ok, merged it
Geth nqp: 8e7ba123a7 | (Aleks-Daniel Jakimenko-Aleksejev)++ | tools/templates/MOAR_REVISION
[MoarVM Bump] Brings 5 commits

MoarVM bump brought: github.com/MoarVM/MoarVM/compare/2...ga7563e71b a7563e71b Merge pull request #1138 from Kaiepi/cstruct-inlined-arrays 53a6308c4 Get moar build working with spaces in path f0978d6a5 Jit getuniprop_(int|bool|str) c3c9d7dfa Bump level until after instrumenting 67384082e Fix pointer arithmetic in inlined CArrays in CStruct/CPPStruct REPRs
rakudo: 7da5744976 | (Aleks-Daniel Jakimenko-Aleksejev)++ | tools/templates/NQP_REVISION
[NQP Bump] 8e7ba123a [MoarVM Bump] Brings 5 co [ā€¦]

NQP bump brought: github.com/perl6/nqp/compare/2019....g8e7ba123a
AlexDaniel patrickb: yes, call it release-guide-binary.md :) 21:46
patrickb: release_guide.pod needs to be renamed anyway
patrickb I tried to align it to release_guide.pd
OK
AlexDaniel or somethingā€¦ that's perl5 pod?
21:47 rml left
AlexDaniel patrickb: otherwise yeah, it's good to go 21:48
Geth rakudo: 3427391631 | (Patrick Bƶker)++ | 8 files
Files for binary releases

Documentation + auxiliary files for doing binary releases.
21:49
rakudo: cde40557d3 | (Patrick Bƶker)++ (committed using GitHub Web editor) | 8 files
Merge pull request #3049 from patzim/binary-release

Files for binary releases
AlexDaniel we can tweak it as we go, it's just docs
dogbert17 hmm, I'm unable to build ... 21:50
"read_config_from_command" is not exported by the NQP::Config module # what am I missing 21:52
patrickb dogbert17: You have a stale nqp-configure submodule. Did you do a `git pull`? 21:53
dogbert17 yup
patrickb It should automatically update that submodule on pull...
dogbert17 I see this: M 3rdparty/nqp-configure
MasterDuke does anyone want to take a look at my Barrett implementation (gist.github.com/MasterDuke17/b7a68...51174226c) and compare it to code.activestate.com/lists/tcl-core/13692/ to see what i've done wrong? knowing tcl might help 21:54
Geth star: ronaldxs++ created pull request #142:
Update README.md
patrickb dogbert17: can you check what `git config --get submodule.recurse` returns?
dogbert17 from the rakudo dir ? 21:56
patrickb Yes
checking in the nqp dir as well might not hurt 21:57
dogbert17 it returns true
building with rakudobrew also fails
patrickb same error?
dogbert17 yup 21:58
I ran "rakudobrew build moar master"
patrickb I start to suspect that submodule recurse business doesn't do how it was intended... 21:59
Something along the lines of `git submodule sync 3rdparty/nqp-configure && git submodule update 3rdparty/nqp-configure` should fix it. 22:01
dogbert17 I'm on git version 2.7.4 if that makes a difference
patrickb For rakudobrew a `rakudobrew nuke moar-blead && rakudobrew build moar-blead` should fix it.
dogbert17 trying now 22:03
if I'm the only one having a problem I guess we can relax a bit :)
AlexDaniel MasterDuke: how off are your results? 22:06
MasterDuke for 2**256, just 2 chars. for 2**300000, 1593 chars 22:07
AlexDaniel MasterDuke: where's `incr index -1` ? 22:08
ah, you simply do $index - 1 later 22:09
MasterDuke i just pass $index - 1 later on instead. otherwise i'd have to `is copy` $index
the missing chars all seem to be 0s, so it's something about the padding
patrickb dogbert17: Does it work? 22:10
dogbert17 patrickb: I wiped my rakudo install and I wiped my moar-master in rakudobrew. That seems to have fixed it 22:13
AlexDaniel MasterDuke: $left is always only 0 or 1 in their version? 22:15
because their format line is a bit different, fwiw 22:16
also could it be the difference between sprintf and tcl's format?
MasterDuke yeah
how is it different?
AlexDaniel ahhh you have precedence error 22:17
hm noā€¦ hold on
no, it's fine
MasterDuke: it's different because if $left is say 2 then their output is "" and yours will be the number itself 22:18
but that doesn't matter if $left is always just 0 or 1
so it's not thatā€¦
could it be something like 22:19
m: say +"0005"
camelia 5
AlexDaniel so in Barrett_todigits_rec you sometimes return a string 22:20
and if that is then numified, it'll drop leading zeroes
MasterDuke but it isn't numified, just concatenated 22:21
fwiw, putting ~ before all the calls doesn't change anything 22:22
AlexDaniel m: sub foo { if True { 60 } else { 42 } }; say foo
camelia 60
AlexDaniel m: sub foo { if False { 60 } else { 42 } }; say foo
camelia 42
22:23 pamplemousse left
patrickb is off to bed 22:31
o/
22:32 patrickb left
timotimo o/ 22:32
AlexDaniel MasterDuke: heh, it's a nice little puzzleā€¦ I'd love to know what's different 22:34
MasterDuke: what about `my @nL = $n;` ? 22:37
MasterDuke: `set nL [list $n]` seems to be like `my @nL = $n;` 22:38
like: set n 1000; set nL [list $n]; puts [lindex $nL 0] # that's 1000 22:39
geez it has been like 5 or more years since the last time I touched tcl, absolutely zero stuff remembered :) 22:40
MasterDuke i've never used it before
but no, that really throws it off, completely the wrong value 22:41
AlexDaniel MasterDuke: did you fix it for shiftL too?
and also @mL
my @nL = $n; my @shiftL = $shift; my @mL = 1049; 22:42
MasterDuke oh ho!
AlexDaniel I'm a bit surprised I didn't see it right away
*even if* the value is wronger now, it's still closer to the actual algorithm :) 22:43
MasterDuke AlexDaniel++ correct value now. though a bunch slower 22:44
AlexDaniel whew, geez
MasterDuke: I don't know what's the current state of rakudo's performance, but what about getting rid of recursion? 22:46
MasterDuke now it doesn't get faster until around 2**250000 22:47
AlexDaniel also I wonder how fast +> is
it should be like really fast, but is it?
MasterDuke AlexDaniel: yeah, now i can start optimizing the implementation. though really it should be done in C
i tested, it's faster than div or /
AlexDaniel nice 22:48
MasterDuke the sprintf is what really slows it down 22:50
is lizmat's experimental one available? 22:52
AlexDaniel it's just 2 zeros, do some if-elses ?
m: my $number = 3; say $number >= 100 ?? $number !! $number >= 10 ?? ā€˜0ā€™ ~ $number !! ā€˜00ā€™ ~ $number; 22:59
camelia 003
AlexDaniel m: my $number = 30; say $number >= 100 ?? $number !! $number >= 10 ?? ā€˜0ā€™ ~ $number !! ā€˜00ā€™ ~ $number;
camelia 030
AlexDaniel m: my $number = 300; say $number >= 100 ?? $number !! $number >= 10 ?? ā€˜0ā€™ ~ $number !! ā€˜00ā€™ ~ $number;
camelia 300
AlexDaniel m: my $number = 3000; say $number >= 100 ?? $number !! $number >= 10 ?? ā€˜0ā€™ ~ $number !! ā€˜00ā€™ ~ $number;
camelia 3000
MasterDuke now it's faster at 2**50000 23:03
at 2**2500000, building the tables takes 7s and the rest of the stringification took 11s 23:05
AlexDaniel what about precompiling the tables? 23:07
how big are the tables anyway?
MasterDuke 86% of the exclusive time is spent here github.com/rakudo/rakudo/blob/mast...#L339-L341 23:09
timotimo is it inlined a lot?
MasterDuke `Inlining eliminated the need to create 8427689 call frames (that's 87.81%).`
timotimo that's not bad 23:10
i didn't even read the code yet 23:11
did you update the gist to the latest code?
MasterDuke the arrays are 18 elems for 2**2500000 23:12
no, i'll do that
timotimo and i guess those numbers are easily outside of 64bit?
MasterDuke gist updated 23:13
@nL and @mL yeah, @shiftL values are pretty small 23:15
timotimo in the recursion step where you concat two invocations of barrett__rec, you could calculate $index - 1 only once!
that's surely a great saving
AlexDaniel interesting: ā€œfor small integer values of n [ā€¦], it's always faster to use direct multiplication rather than exponentiation via std::pow(x, n)ā€ baptiste-wicht.com/posts/2017/09/c...d-pow.html 23:18
timotimo: but then you need a variable :) 23:19
I can probably guess which one is faster :P
timotimo $index could be a native int, surely
MasterDuke making stuff native ints didn't seem to help 23:24
timotimo OK 23:25
MasterDuke neither did not passing around the arrays in every Barrett_todigits_rec call 23:26
timotimo how deep is this recursion? as deep as the elems for the arrays, plus one branch to the other side always?
MasterDuke let's see. 501723 calls to Barrett_todigits_rec 23:27
timotimo oof 23:28
but index is always decremented by 1
i don't know how $q moves, though
how often does the thing happens where it calls todigits_rec only once? 23:29
if that happens a lot, maybe the whole function could become a loop
i.e. manual tail recursion optimization
AlexDaniel I think tcl folks argued that if you want to implement that in C, do it without recursion
for whatever reason, see the original thread :) 23:30
so maybe getting rid of it is a good idea anyway
MasterDuke timotimo: heh, only 6 times for 2**2500000 23:31
timotimo OK, so not worth much, then
does difference change much when you go for different numbers? 23:33
MasterDuke what difference?
timotimo er 23:36
performance*
MasterDuke what kind of different numbers then? i'm assuming you mean roughly the same number of digits, but different in some other way? 23:39
seems to mostly just depend on number of digits 23:40
timotimo oh, hold up, 2 ** 300000 isn't just 10000000000000000000 in base 10
i'm smart today, aren't i 23:41
MasterDuke anyway, i'm off to sleep 23:44
this certainly seems promising, hope we can get it into rakudo somehow 23:45
timotimo good night!
maybe we just ask the libtommath people ...
23:49 MasterDuke left