🦋 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. |
|||
00:10
thundergnat joined
|
|||
thundergnat | m: say Date(now) | 00:11 | |
camelia | Type check failed in binding to parameter '$dateish'; expected Str but got Instant (Instant.from-posix(<85342309...) in block <unit> at <tmp> line 1 |
||
tellable6 | 2020-05-11T15:41:16Z #raku <tigerpaws> thundergnat: Thanks, I'll have a look, with the understanding they are out of date. | ||
thundergnat | bisectable6: 2020.01 say Date(now) | ||
bisectable6 | thundergnat, Using old=2020.01 new=HEAD in an attempt to do what you mean | ||
thundergnat, Bisecting by exit code (old=2020.01 new=110324d). Old exit code: 0 | |||
thundergnat, bisect log: gist.github.com/5c4297b65b3da90a89...dd1eddb18a | |||
thundergnat, (2020-02-29) github.com/rakudo/rakudo/commit/d9...d198747f09 | |||
thundergnat | sigh | 00:12 | |
submitted issue GH#3683 | 00:19 | ||
linkable6 | GH#3683 [open]: github.com/rakudo/rakudo/issues/3683 Date(now) no longer works | ||
00:23
aborazmeh joined,
aborazmeh left,
aborazmeh joined
00:35
Black_Ribbon joined
01:03
guifa left
01:06
konvertex left
01:07
thundergnat left
01:18
stoned75 joined
01:29
Doc_Holliwould left
01:33
gdonald left
01:40
molaf left
01:48
aborazmeh left
01:50
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:53
molaf joined
|
|||
cpan-raku | New module released to CPAN! Sparrow6 (0.0.20) by 03MELEZHIK | 02:08 | |
02:11
pilne left
|
|||
jdv79 | if there is a libicuuc.so shoudn't it just be "is native('icuuc')"? | 02:21 | |
02:34
Cabanossi left
02:37
Cabanossi joined
02:42
zacts joined,
stoned75 left
|
|||
jdv79 | how does one handle an arg that is a pointer to a typedef enum? | 02:56 | |
04:01
molaf left
04:23
stoned75 joined
04:43
aborazmeh left
04:53
zacts left
04:54
zacts joined
04:56
rindolf joined
05:13
brtastic joined
05:20
kensanata joined
|
|||
eiro | it seems there is no p6doc in the rakudostar bundle. is there something to install with zef? | 05:43 | |
05:43
sauvin joined
05:55
stoned75 left
05:57
stoned75 joined,
dd070 joined
06:03
Doc_Holliwould joined
06:04
Itaipu left
06:06
Itaipu joined,
zacts left
06:07
zacts joined,
brtastic left
06:21
dd070 left,
dd070 joined
06:22
Itaipu_ joined
06:23
Itaipu left
06:24
kensanata left
06:41
farcas1982regreg left
06:45
gnufr33dom left
06:47
xelxebar left
06:48
xelxebar joined
06:57
sjm_uk joined
06:59
brtastic joined
07:01
dd070 left
07:05
dd070 joined
07:11
sjm_uk left
07:18
kst left
07:22
zacts left,
pecastro joined
07:25
dd070 left
07:26
dd070 joined
07:41
Doc_Holliwould left
07:59
dakkar joined,
dakkar left
08:00
dakkar joined
08:05
MasterDuke joined,
dd070 left
08:06
Altai-man_ joined
08:17
sena_kun joined
08:19
Altai-man_ left
08:22
cpan-raku left,
cpan-raku joined,
cpan-raku left,
cpan-raku joined
08:23
SCHAPiE left
08:50
jjmerelo joined
|
|||
jjmerelo | Hey, I got in. Anyone else had trouble this morning getting in? | 08:50 | |
09:12
jjmerelo left
09:13
KindOne left
|
|||
lizmat | jjmerelo: no, I didn't | 09:22 | |
tellable6 | lizmat, I'll pass your message to jjmerelo | ||
lizmat clickbaits rakudoweekly.blog/2020/05/11/2020-...e-release/ | 09:30 | ||
09:35
gnufr33dom joined
09:36
chloekek joined
09:45
jjmerelo joined
10:08
Guest43 joined
10:09
Guest43 is now known as hungrydonkey,
hungrydonkey left,
hungrydonkey joined
10:16
Altai-man_ joined
10:19
sena_kun left
|
|||
Dwarf | I'm trying to write a dice roll program but it seems I'm getting stuck around line 16. I expected it to sum all the rolls, but it seems that since it's just one die it won't do that bpa.st/MTHA | 10:20 | |
So the result is always zero even if line 25 returns a number | 10:21 | ||
Geth | doc: JJ self-assigned False positives in routine-definitions.t github.com/Raku/doc/issues/3395 1bd6b05bfb | (JJ Merelo)++ | xt/routine-definitions.t |
10:26 | |
linkable6 | DOC#3395 [open]: github.com/Raku/doc/issues/3395 [docs] False positives in routine-definitions.t | ||
10:31
farcas1982regreg joined
|
|||
Geth | doc: 5355f2ce93 | (JJ Merelo)++ | 2 files Checked false positive, closes #3395 |
10:34 | |
linkable6 | DOC#3395 [closed]: github.com/Raku/doc/issues/3395 [docs] False positives in routine-definitions.t | ||
10:34
Doc_Holliwould joined
|
|||
hungrydonkey | Hello,everyone. How to check two arrays have the same value? | 10:36 | |
Geth | doc: 69cf105abf | (JJ Merelo)++ | 2 files Eliminating two #3390 errors |
10:38 | |
doc: 369c4abe4d | (JJ Merelo)++ | 3 files Eliminating several #3390 errors |
|||
linkable6 | DOC#3390 [open]: github.com/Raku/doc/issues/3390 [docs][xt] xt/routine-definitions.t failures | ||
Dwarf | hungrydonkey: one & two should return the intersection of the arrays docs.perl6.org/language/operators#..._%E2%88%A9 | 10:39 | |
Geth | doc: d623c0a591 | (JJ Merelo)++ | doc/Type/Any.pod6 Latest fixes, closes #3390 |
10:40 | |
linkable6 | Link: docs.raku.org/type/Any | ||
DOC#3390 [closed]: github.com/Raku/doc/issues/3390 [docs][xt] xt/routine-definitions.t failures | |||
10:44
KindOne joined
10:45
_dev_zero left
10:49
ufobat joined
10:50
_dev_zero joined
10:53
caterfxo left
11:00
konvertex joined
11:05
gdonald joined
11:08
molaf joined
11:09
Ekho left
11:22
Ekho joined
11:30
chloekek left
11:34
stoned75 left
11:36
gnufr33dom left
|
|||
tbrowder | .tell Altai-man_ I took care of completing Rakudo issus #3682. | 11:43 | |
tellable6 | tbrowder, I'll pass your message to Altai-man_ | ||
Altai-man_ | tbrowder++ | 11:44 | |
12:09
chloekek joined
12:17
sena_kun joined
12:19
Altai-man_ left
12:24
chloekek left
12:30
Doc_Holliwould left
12:31
kent\n left
12:36
kent\n joined
12:39
Black_Ribbon left
|
|||
libertas | hi, I've built a really small script to count the number of odd and even numbers in each line of text and print some statistics. | 12:49 | |
But it's very slow to run | 12:50 | ||
can you please check whether there's something that is causing this slowness? | |||
The script's in pastebin.com/uJYdqdPt | |||
lizmat | for "aa.txt".IO.lines -> $line | 12:51 | |
would not copy all lines into memory | |||
also, the "values" is unnecessary | |||
also, why not set up the %oe_count directly, why the extra @odd_evens array ? | 12:54 | ||
12:57
chloekek joined
|
|||
[Coke] | installed cro. raku -MCro::HTTP::Server -e1; runs for a bit then I get "Abort trap: 6". ... will update raku and report back. | 12:57 | |
(it's from 2020.01 vintage) | |||
12:57
jjmerelo left
|
|||
libertas | it's only my first script :-) | 12:58 | |
Geth | doc/master: 4 commits pushed by Coke++ | ||
libertas | the "aa.txt" file has circa 26MB | ||
lizmat | then the for "aa.txt".IO.lines -> $line should be helpful already | 12:59 | |
libertas: if you switch odds and evens around, you could do: | 13:01 | ||
my @pair = 0,0; @pair[$_ % 2]++ for @nrs | 13:02 | ||
libertas | good | 13:03 | |
lizmat | or actually: @pair[$_ % 2]++ for $line.words[2..6] | ||
[Coke] | rakubrew.org still giving a cert error. Do we need to buy a new cert? | 13:05 | |
Dwarf | SSL certificates are free with letsencrypt.org | 13:06 | |
13:07
Itaipu_ left
|
|||
Dwarf | You probably meant a different kind of certificate huh | 13:08 | |
[Coke] | (I am surprised to see that rakubrew is a binary file) | ||
libertas | I've changed the script but still it's as slow as before, although more idiomatic for sure | 13:13 | |
I'm evaluating raku and tcl for some work, and raku is 11x slower than tcl, which is a lot for my purposes | 13:14 | ||
[Coke] | Anything in particular that's slow? Sometimes rewriting as idiomatic raku can help with speedups. | 13:16 | |
lizmat | libertas: what's the current version of your script? the gist appears unchanged? | ||
[Coke] | Can't run rakubrew binary on mac - it complains about not being able to verify the author. | 13:18 | |
libertas | lizmat: it's pastebin.com/F4rrQGPS | 13:20 | |
sena_kun | libertas, can you please provide a bit of test data you are using? Not necessarily exact one, but something for people to tests against. | 13:22 | |
libertas | sena_kun: sure. In total, I'm testing aa.txt with 933000 lines. The first 1000 are in pastebin.com/J7N2W144 | 13:25 | |
if that data is file aa.txt, then for f in {1..9}; do cat bb.txt >> cc.txt; done | 13:28 | ||
sorry, {1..933} instead of {1..9} will give a file of some size | 13:29 | ||
[Coke] | (reinstalled raku, still getting the abort trap on raku -MCro::HTTP::Server -e1;) | ||
libertas | I can post the tcl script for you to compare relative speeds | 13:30 | |
I could try it in perl5, but don't know the language | |||
13:34
xinming_ left
13:35
xinming_ joined
13:38
clarkema joined
|
|||
[Coke] | libertas: do you need to be keeping 'odd_evens' for anything other than the math? | 13:40 | |
I imagine keeping all those around has a cost. | |||
Dwarf | I have a text file with regexes on each line. I read these strings with 'file.txt'.IO.lines, but I want to read these as regex and not as Str type. I've tried .map(*.regex) but that's sadly not a thing. Any pointers? | ||
libertas | [Coke]: I need them just for the math | 13:41 | |
timotimo | i wonder how much faster it would be to `split(" ", $line).skip(2).head(4)` | 13:43 | |
libertas: ^ | |||
13:43
chloekek left
|
|||
timotimo | Dwarf: you can write this: /<$variable>/ and it will interpret the contents of $variable as regex syntax and compile it for you. beware code execution, though. you must trust the input file for this to be ok | 13:43 | |
sena_kun | golfed to gist.github.com/Altai-man/ecb0e116...ecc69f0e7f | 13:44 | |
[Coke] | Dwarf: I think you want docs.raku.org/language/regexes#Reg...erpolation | ||
sena_kun | but it seems `split(' ')` is what takes the most time, everything else is cheap. | ||
timotimo | cool, there's the skip+head | ||
sena_kun | [Coke], regexes would be even slower I'm afraid. | ||
Dwarf | Ah! Awesome, thank you both | 13:45 | |
[Coke] | so then if you have a $string, you can say $regex = / <$string> /;, I think | ||
sena_kun | It takes from ~290 to 350 milliseconds to me, but if you just leave `for "aa.txt".IO.lines -> $line { $line.split(' ') }` in the script it takes 180-230 milliseconds. | 13:46 | |
[Coke] | sena_kun: I was answering Dwarf's question about regex there. | ||
sena_kun | *The whole script from 290 to 350 | ||
[Coke], oh, sorry, silly me. | |||
I have to keep up with the converstaion better... | |||
tobs | fwiw, my take on "idiomatic" appears to be somewhat slower hastebin.com/ikacawopic.pl | ||
sena_kun | Anyway, I'd say both `.words` or `.split(' ')` seem like the main source of slowness here. | 13:47 | |
[Coke] | wonder if a grammar would be faster. | 13:49 | |
13:50
MilkmanDan left
|
|||
timotimo | are these numbers simple? do they need full number parsing? | 13:50 | |
13:50
MilkmanDan joined
|
|||
timotimo | if you don't expect a 0x or so in front, and no decimal point, you can just check the last character against 0, 2, 4, 6, 8 | 13:51 | |
but since it's mostly the split that takes so long, that may not be worth anything much | 13:52 | ||
[Coke] | if the lines all have the same format, maybe substr is faster? | 13:54 | |
timotimo | did anybody try race-ing it yet? | ||
[Coke] | ah, not quite the same length | ||
sena_kun | [Coke], they differ in length. :S | ||
libertas | timotimo: with your suggestion, run time dropped to half, from 1m48 to 55s | ||
timotimo | what? wow! | ||
nice | |||
still 5x slower than tcl, sadly | 13:55 | ||
lizmat | libertas: could you try gist.github.com/lizmat/ca60dd89924...c1dd1128f4 ? | ||
timotimo | lizmat: should it be head 5 or 4? | 13:56 | |
lizmat | [2..6] was in the original code, no? | ||
[Coke] | lizmat: useless join at the end? | ||
13:56
Doc_Holliwood joined
|
|||
timotimo | ah, that's inclusive, of course right | 13:56 | |
lizmat | [Coke]: it's a map! | ||
timotimo | just some python brain damage :) :) | ||
[Coke] | oh | 13:57 | |
timotimo | with just the 1k lines it finishes way too fast to measure sensibly :) :) | ||
libertas: would it be representative to just repeat the 1000 lines you gave us a bunch of times? | |||
libertas | lizmat: it's quicker, 47s instead of 55 | 13:58 | |
konvertex | I have a good one as well. Did some more advent of code and that's a hefty-defty slowdown: gist.github.com/dweqv/3f686b6f4615...f813158d96 Part2 takes four times as long. And that type of puzzle comes up again later on. :( | ||
libertas | timotimo: yes, that's what I did, it's just an experiment for me | ||
timotimo | OK! | ||
lizmat | ok, now stick in a '.race(:batch(1024))" after the .lines and before the .map | ||
13:59
MilkmanDan left
|
|||
timotimo | ahaha, i should maybe have a moarvm with C optimizations enabled | 13:59 | |
14:00
MilkmanDan joined
|
|||
lizmat | libertas: ok, now stick in a '.race(:batch(1024))" after the .lines and before the .map | 14:00 | |
libertas | timotimo: that is using all the cores... it's down to 15s | 14:01 | |
lizmat | libertas: that's with the .race ? | ||
libertas | yes | 14:02 | |
lizmat | cool! | ||
you might want to twiddle a little with the 1024 value, try doubling it / halving it | |||
libertas | ok | ||
thanks all | 14:03 | ||
14:03
mowcat joined
|
|||
timotimo | a quick profile shows Str's Numeric method takes the most time in sena's version | 14:06 | |
lizmat | yeah, also in mine | ||
timotimo | i think libertas tried my optimization of only checking the last character, as a string, against the even digits | 14:07 | |
and got a 2x speedup | |||
sena_kun would like to see the code for it | |||
timotimo | could it have been the 2..5 has been wrong? | 14:11 | |
have we been getting a Failure all this time? | |||
lizmat | that would have thrown in the % 2 , would it not ? | 14:14 | |
timotimo | "1 20150103 22 48 49 30 31" | 14:15 | |
this line is what made my code wrong | |||
libertas: how would you like this kind of datum to be interpreted? | |||
14:16
Altai-man_ joined
|
|||
timotimo | oh whoops, when i catted the files together to make a bigger file i ended up with a double-sized line on each seam :D | 14:17 | |
libertas | at this time I'm not interested in the date | ||
timotimo | an empty entry tripped up one of my versions :D | 14:18 | |
14:19
sena_kun left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
timotimo | aww, ends-with can't be inlined because takenextdispatcher | 14:28 | |
lizmat | huh? why would it need a next dispatcher ? | 14:30 | |
timotimo | not sure, it just starts with takedispatcher, then takenextdispatcher | ||
14:31
xinming_ left
|
|||
lizmat | what are the ends-with parameters you're looking at ? | 14:31 | |
14:32
xinming_ joined
|
|||
lizmat | I mean, ends-with is pure nqp with an optional private method call if things go awry | 14:32 | |
it's a multi, but so are many other methods ? | 14:33 | ||
timotimo | i don't know much about the current dispatcher mechanism, only about the upcoming one %) | 14:34 | |
lizmat | does substr-eq suffer from the same issue ? | 14:36 | |
timotimo | i'm glad that at least $even and $odd being int are being incremented using a proper add_i instead of a call | ||
14:37
Doc_Holliwood left
|
|||
timotimo | yes it does | 14:38 | |
14:39
rouking left
14:40
chloekek joined
|
|||
lizmat | ok, than it's probably in the named parameter handling ? | 14:43 | |
timotimo | cannot inline &infix:<->, cannot inline substr, cannot inline sink, but at least using eq on a "str" variable generates an actual eq_s op without a call | 14:44 | |
all of these prevented by takenextdispatcher | |||
jnthn | I thought the dispatcher stuff got reverted ahead of the last release? | 14:45 | |
timotimo | perhaps it was brought back after the release | ||
14:45
aborazmeh left
|
|||
timotimo | oh or maybe my nqp is old | 14:45 | |
Geth | doc: tbrowder++ created pull request #3398: Add warning info for sprintf use |
14:46 | |
timotimo | i'll just rebuild my everything | ||
14:54
Doc_Holliwood joined
14:59
Itaipu joined
|
|||
timotimo | i think my rakudo was wildly out of date :) | 15:01 | |
like 45 commits | |||
15:02
brtastic left
|
|||
timotimo | much better | 15:05 | |
sorry about all the confusion! | |||
15:10
donaldh joined
|
|||
[Coke] | 'cro stub app app' dies for me with Abort Trap: 6 | 15:11 | |
timotimo | can you gdb that? | ||
or lldb or whatever | |||
anyway, with ends-with, all the ends-withs are inlined | 15:12 | ||
but calculating the end position once and using substr-eq may be more efficient | |||
[Coke] | running lldb on cro seems painful, since it's a script calling a script calling ... | 15:13 | |
timotimo | also, ends-with grabs the string out of the self twice in a row. i wonder if it's possible to get that faster | ||
oh crap good point | |||
gdb can "follow the child on every fork", but that could be wrong, too | |||
ah, the obvious solution is core dumps | |||
15:17
mowcat left
|
|||
[Coke] finally installs brew so he can install gdb so he can .. | 15:19 | ||
if I had gdb, how would I run 'cro stub...' under it? | 15:24 | ||
15:26
jjmerelo joined
|
|||
timotimo | normally you'd raku-gdb-m the script | 15:27 | |
[Coke] | raku-gdb-m - not found | 15:30 | |
I assume it wasn't installed because I didn't have gdb when I ran the installer? | |||
ah, no. perl6-gdb-m is installed... | |||
timotimo | oh, little oversight clearly | 15:31 | |
MasterDuke | might have raku(do)-lldb-m | ||
jdv79 | so i learned today that icu suffixes their func names with the lib ver - there's no clever way around having to manually find that out beforehand, right? | 15:32 | |
MasterDuke | some of those are only installed as rakudo-*, not raku | ||
[Coke] | MasterDuke++ | ||
jdv79 | not a huge deal i guess | ||
15:32
molaf left
|
|||
[Coke] | so how to run the cro script with args? | 15:33 | |
15:33
Doc_Holliwood left
|
|||
jjmerelo | [Coke] what do you mean? Can't you simply use args? (or, better, environment variables) (Just curious, I've used Cro only very shallowly) | 15:37 | |
[Coke] | jjmerelo: in gdb | ||
timotimo | ok, substr-eq doesn't have to recalculate the position every time, but it does have to verify that the integer isn't a big integer and that it's not negative | ||
jjmerelo | [Coke] ah, OK. Don't know, but environment variables will still be transmitted, right? | 15:38 | |
timotimo | actually | 15:39 | |
if you can get it to pause in between somehow | |||
you can attach gdb to the running process at the right moment | |||
ctrl-z can potentially do it if you manage to hit it when the right process is already started but hasn't crashed yet | |||
[Coke] | checking... | 15:45 | |
if I start cro, there are like 4 rakudo processes running doing precomp | 15:46 | ||
haven't I lost the ability to follow the children at that point? | 15:47 | ||
(5, not 4) | |||
timotimo | attaching to running processes goes by pid, so that should be fine | 15:48 | |
15:49
chloekek left
15:50
chloekek joined
16:00
molaf joined
16:03
sena_kun joined
16:05
Altai-man_ left
|
|||
[Coke] | I can't find the right process to connect to. looks like there are lot of short lived processes running with target=mbc, and by the time I try to connect to them, they're gone. Wonder where the parent process is. | 16:26 | |
... ah. cro is still calling to 'perl6', not 'raku' | |||
Unable to find Mach task port for process-id 2087: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8)) | 16:27 | ||
so, more work to do on my end to figure this out. :| | 16:29 | ||
16:29
dakkar left
|
|||
timotimo | ah, of course | 16:30 | |
gdb isn't allowed to do stuff because security | |||
which is a very sane thing to do as an OS | 16:31 | ||
but annoying to deal with | |||
is there a way to get around this with sudo perhaps? | |||
[Coke] | sudo gdb gets me further. if I don't have a rakudo with debug symbols enabled, is this going to be at all helpful? | 16:32 | |
jnthn | Probably not, though it's only MoarVM that you need rebuild with them | 16:33 | |
[Coke] | when I connect, I get: Error calling thread_get_state for GP registers for thread 0x1603 | 16:34 | |
timotimo | jnthn: i humbly petition we always build with debug symbols. opinions? | ||
16:35
sour joined
|
|||
MasterDuke | +1 from me. i always do and have noticed extremely minimal slowdown whenever i've bothered to compare | 16:36 | |
16:36
lichtkind joined
|
|||
[Coke] | if I continue from that point, the trap eventually happens, but gdb says "[Inferior 1 (process 2330) exited normally]" | 16:36 | |
jnthn | I've noticed they can be misleading as heck when you have an optimized build. | 16:37 | |
Though maybe the info they give is better than nothing, if taken with the appropriate grain of salt | |||
timotimo | there's a way to get debug symbols split off from the main .so so they can be loaded in gdb afterwards | ||
jnthn | (The backtraces are generally OK, but values of variables in optimized builds can be all over the place.) | ||
timotimo | i think you don't even get line numbers without debug symbols | ||
MasterDuke | jnthn: misleading how? my usual build is optimized, but with debugging | ||
16:37
xinming_ left
|
|||
[Coke] | timotimo: (gdb) bt | 16:38 | |
#0 0x00007fff69066296 in ?? () | |||
MasterDuke | oh, yeah. there are a lot of optimized out values | ||
timotimo | oh, may also want to MVM_JIT_DISABLE=1 | ||
jnthn | MasterDuke: Often I see totally bogus values (doesn't even say optimized out) | ||
timotimo | hmm | ||
jnthn | Maybe latest versions of compilers etc. do better at it. | ||
I've just learned that if I don't want to go on a wild goose chase because foo pointer is corrupt, I'd better debug a non-optimized build. | 16:39 | ||
MasterDuke | i'm using arch linux, so usually have pretty recent versions of stuff | ||
16:39
xinming_ joined
|
|||
[Coke] | timotimo: MVM_JIT_DISABLE=1 # still abort traps, still get "exited normally" | 16:40 | |
timotimo | disabling jit makes backtraces make more sense much of the time | ||
i don't even know what trap number 6 would be. like it got signal 6, but some piece of code somewhere caught it and just called "exit(0)" for some reason? | |||
Geth | ¦ p6-sake: AlexDaniel self-unassigned “Sake” is overused, come up with something else github.com/perl6/p6-sake/issues/19 | 16:42 | |
[Coke] | stack overflow says trying to access memory you don't own (typically with strcpy) | ||
timotimo | how do you bp that | ||
[Coke] | bp? | 16:43 | |
found another suggesting "unhandled C++ exception"... :) | |||
timotimo | breakpoint | 16:44 | |
16:44
mowcat joined
|
|||
[Coke] | how do I build a non-optimized build of rakudo? | 16:45 | |
(as opposed to a debug version) | 16:46 | ||
16:46
caterfxo joined
|
|||
[Coke] | (MVM_SPESH_DISABLE=1 MVM_JIT_DISABLE=1 cro stub app app - still abort traps) | 16:49 | |
16:50
brtastic joined
16:51
sour left
|
|||
[Coke] needs to just give up on this and go full docker route. :| | 16:51 | ||
timotimo | sorry coke, i'm sidetracked | 16:54 | |
the optimization flags go in the moarvm configure.pl | |||
which with --gen-nqp and such will be called for you, but there's also --moar-opts or something in the rakudo configure.pl | 16:55 | ||
[Coke] | Yah, that's a lot to dig through. | 16:57 | |
16:57
xelxebar left
|
|||
[Coke] | for now, will try to get cro working in docker instead. | 16:57 | |
16:58
mowcat left,
xelxebar joined,
mahafyi joined
17:01
molaf left
17:02
sour joined,
hungrydonkey left
17:04
zacts joined
17:13
gnufr33dom joined
17:14
farcas1982regreg left
17:16
mowcat joined
17:20
zacts left
17:25
xinming_ left,
xinming_ joined
17:36
mowcat left,
sjm_uk joined
17:42
xinming_ left
17:43
xinming_ joined
17:44
guifa joined
17:45
squashable6 left,
squashable6 joined
18:04
Altai-man_ joined
|
|||
[Coke] | cro.services/docs/docker-deployment suggests an old version of the docker container, btw. | 18:07 | |
18:07
abraxxa left
|
|||
sour | I have a newbie question, how would one represent a tagged union in raku? Something like a sealed class in scala / sum type in haskell | 18:07 | |
18:07
sena_kun left
|
|||
[Coke] | like a Junction? | 18:07 | |
m: my $a = True | False | 18:08 | ||
camelia | ( no output ) | ||
[Coke] | docs.raku.org/type/Junction # if so | ||
18:08
Doc_Holliwood joined,
abraxxa joined
|
|||
MasterDuke | sour: i think Kaiepi has some modules that might be relevant | 18:09 | |
[Coke] | though glancing over www.schoolofhaskell.com/user/Gabri...sum-types, maybe it's more like a where clause on a subset. | 18:10 | |
[Coke] defers to MasterDuke . :) | |||
sour | like an enum with associated data types | 18:11 | |
useful for representing ASTs, for example | |||
18:11
mowcat joined
|
|||
sour | representing ASTs, for example, in Java with Java classes is eh | 18:11 | |
big eh | |||
[Coke] | yah, guessing 'subset X of Y where ...' is what you want. you can pick a top level class that is shared (or Any/Mu), and you can specify a where clause with specific limits, like explicit types, or "has this method"... | 18:14 | |
then you can declare your variables of the type of the subset. | |||
docs.raku.org/language/typesystem#subset | |||
sour | very interesting mechanism, thanks all | 18:17 | |
there is multi after all, that helps a bit with this | 18:19 | ||
[Coke] | ah, yes, if you're just trying to restrict on parameters, you don't even need the subset then, just X multis. | 18:21 | |
(and you can define a coercion in the signature definition if all you're doing is casting) | |||
guifa2 | So.... what exactly is {YOU_ARE_HERE} ? | 18:23 | |
there's no documentation on it in docs.raku.org but it's definitely still in the grammar, but I'm not quite getting the intent based on the synopses | 18:24 | ||
[Coke] | it's part of a setting - your code basically runs as if it were in the setting at that point, if I remember correctly. | 18:25 | |
m: say {YOU_ARE_HERE} | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> The use of {YOU_ARE_HERE} outside of a setting is reserved (use whitespace if not a setting, or rename file with .setting extension?) at <tmp>:1 ------> 3say {YOU_ARE_HERE}7⏏5<EOL> |
||
18:28
jjmerelo left
18:30
sauvin left
|
|||
sour | is there some more general mechanism behind having the Promise.start be a keyword? Was that done just because it is aesthetically pleasing? Wouldn't it then make sense to have some Channel operations be keywords? | 18:38 | |
vrurg | sour: It just doesn't make sense for a channel. | 18:53 | |
18:54
girafe2 joined
18:55
girafe left
|
|||
jnthn | sour: Partly that common things deserve shorter spellings, but in this case also because a `start` block also declares a fresh `$/` and `$!` in the block's scope, which helps one with correctness. | 18:55 | |
sour | D: I don't know man it irks me | ||
I still think channels deserve their own keywords | 18:58 | ||
jnthn | Also, you *can* use the `whenever` syntax to consume a channel | ||
sour | hmmm | ||
jnthn | (It's not syntax especially for channels, just general enough that it will work out) | ||
sour | have you got some links for how that works? | 19:02 | |
nevermind, I found (on the old design docs) that whenever competes for values | 19:04 | ||
design.raku.org/S17.html#Channels | |||
this is pretty noteworthy imo | |||
19:08
poohman left
19:10
poohman joined
19:14
sour left
19:18
stoned75 joined
19:33
xinming_ left
19:35
camelCaser left,
xinming_ joined,
camelCaser joined
19:40
MasterDuke left
19:42
lucasb joined
20:00
sjm_uk left
20:03
xinming_ left
20:04
xinming_ joined
20:05
sena_kun joined
20:07
Altai-man_ left
20:09
poohman left
20:10
mowcat left
20:12
mahafyi left
20:18
sjm_uk joined
20:21
aborazmeh joined,
aborazmeh left,
aborazmeh joined
20:22
rindolf left
20:23
molaf joined
|
|||
Geth | doc/fix-link-param-roles: bc05f269ed | (Stoned Elipot)++ | doc/Type/Associative.pod6 Fix link to parameterized roles |
20:24 | |
doc: stoned++ created pull request #3399: Fix link to parameterized roles |
20:25 | ||
20:31
tlcu_ joined
|
|||
guifa2 | Should there be a third type of pod link? Instead of just linking to POD sections and external URL, it would be nice to also be able to link to specific blocks | 20:35 | |
tlcu_ | hello raku community, I want to know if I am doing something wrong because my raku scripts are running really slow | ||
lizmat | tlcu_ : do you have a gist ? | 20:43 | |
tlcu_ | lizmat rosettacode.org/wiki/Roman_numerals/Encode#Raku | 20:44 | |
it is taking about 430ms to execute, while perl takes 42ms. Seems impossible | 20:45 | ||
lizmat | well, at those scales, you should remember that Raku takes abour 120 msecs to start up | 20:47 | |
jnthn | I suspect rosettacode solutions are often written for pretty rather than speed. The use of multi dispatch to match the 0 case is neat, but (at least under the current implementation) rather slower than just using an `if` to check it. | 20:52 | |
20:52
tlcu_ left
|
|||
lizmat | jnthn: a profile shows that about 2/3 of the time is spent in saying the result | 20:57 | |
hmmm... maybe not | 20:59 | ||
20:59
Black_Ribbon joined
|
|||
jdv79 | why does Pair.kv and Hash.kv return different things? | 21:01 | |
just noticed that | |||
lizmat | m: dd (a => 42).kv | ||
camelia | ("a", 42).Seq | ||
lizmat | m: dd {a => 42}.kv | 21:02 | |
camelia | ("a", 42).Seq | ||
lizmat | they do? or not? | ||
hmmm... running a --profile on that rosetta code entry explodes pretty much | |||
21:03
tlcu_ joined
|
|||
jdv79 | weird. idk what i just ran into then. | 21:03 | |
tlcu_ | lizmat jnthn thanks for clarifying | 21:06 | |
21:06
Glinderhest joined
|
|||
lizmat | tlcu_: using "0" as a candidate in a signature, is short for: Int:D where * == 0 | 21:07 | |
which implies that *every* dispatch needs to execute Raku code to see if it was 0, and then select that candidate | |||
21:08
poohman joined
21:09
Glinderhest left
21:13
ctilmes joined
|
|||
ctilmes | m: use NativeCall; class Foo is repr('CStruct') { has uint16 $.x is rw }; class Bar is repr('CStruct') { HAS Foo $.foo }; my $bar = Bar.new; $bar.foo.x = 2; | 21:14 | |
camelia | Cannot bind attributes in a Foo type object in block <unit> at <tmp> line 1 |
||
ctilmes | With "HAS", the struct should be embedded, how can it possibly be a 'type object'? | 21:15 | |
21:20
chloekek left
|
|||
jnthn | ctilmes: The marshalled view of the data structure being embedded doesn't mean that the Raku-level model of it will be (and I'm pretty sure it isn't, because there's isn't any general concept of "reference to part of an object"). | 21:23 | |
So it probably is, in Raku terms, represented as object containing object, and flattened out as it's mapped | 21:24 | ||
21:24
poohman left,
poohman joined
|
|||
ctilmes | I'm passing it to C that is supposed to be returning some bytes to me, but Raku thinks it is a type object. How do I tell Raku that the bytes are really there? | 21:26 | |
21:26
melezhik joined
|
|||
ctilmes | (I don't even allocate it -- it is allocated by C and returned to me.) | 21:27 | |
21:30
brtastic left
21:35
Cabanossi left
|
|||
jnthn | ctilmes: Not sure, I'm afraid (and a bit tied up with something else to go digging), though did you try calling native-refresh (or whatever the sub is called) on it? | 21:36 | |
21:38
clarkema left,
melezhik left
21:42
sjm_uk left
|
|||
lizmat | jnthn: I have a patch that makes "42".Numeric 4.3x as fast, "+42".Numeric unchanged, and "42.35".Numeric about 12% slower | 21:46 | |
so, should I commit that ? | |||
21:47
Cabanossi joined
|
|||
jnthn | Hm, it's probably a net win overall | 21:49 | |
lizmat | I guess I should at one point look at val() processing | ||
(again) | |||
ok, will commit then | 21:50 | ||
(after a final spectest test) | |||
21:50
sena_kun left
21:52
ufobat_ joined
21:55
ufobat left
21:59
poohman left,
Kaiepi left
|
|||
timotimo | there is the ADT module (that i made) ;) | 22:00 | |
oops i was scrolled way up | 22:01 | ||
22:02
melezhik joined
22:03
tlcu_ left
22:04
pecastro left
22:05
pecastro joined
22:11
Cabanossi left,
MasterDuke joined
22:18
aborazmeh left
22:24
poohman joined
22:28
scovit joined
|
|||
scovit | ctilmes did you try to nativecast your struct to a CArray and extract the values from memory? | 22:29 | |
if the struct is filled by C code it should work | |||
22:29
poohman left
|
|||
scovit | ctilmes , jnthn , IMHO nativecall has a bug. That can be worked around by accessing the bytes. As can be seen by running this gist gist.github.com/scovit/8d2e0254fdc...a177a5fe03 | 22:33 | |
timotimo | i wasn't aware we have working assign-struct-to-structy-attribute now | 22:37 | |
m: gist.github.com/scovit/8d2e0254fdc...a177a5fe03 | |||
camelia | 12 11 3 94392304 0 3 |
||
scovit | timotimo buggy you mean? | 22:41 | |
I have a fix | |||
first I opened an issue github.com/rakudo/rakudo/issues/3687 | |||
timotimo | is $!a set to anything when TWEAK runs? | 22:43 | |
scovit | I guess it is set with the value of the pointer | ||
but this is incorrect | |||
timotimo | m: say 94392304.base(16) | 22:44 | |
camelia | 5A04FF0 | ||
scovit | this need to handle that github.com/MoarVM/MoarVM/blob/mast...uct.c#L612 | ||
let me write a patch | 22:45 | ||
timotimo | cool | ||
scovit | timotimo, could you test this patch? github.com/MoarVM/MoarVM/pull/1285 | 22:49 | |
timotimo | is there a proper check that the size used for the memcpy source has enough space in the target struct? | 22:50 | |
like, is there a way to assign from the wrong type or something? | |||
scovit | that is typechecked by higher level code | 22:52 | |
I think | |||
22:52
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
scovit | I tried and it gives me error | 22:52 | |
Type check failed in binding; expected IntStruct but got .. | |||
timotimo | anything you can do with deriving? | 22:53 | |
scovit | I don't know, CStruct are quite rigid. You might get good ideas for breaking it | ||
One thing is that binding could be done automagically by the constructor, I do not know if it was meant to be that way? | 22:54 | ||
timotimo | m: class IntBase is repr<CStruct> { has int32 $.a; has int32 $.b }; class IntDerived is IntBase { has int64 $.x; has int64 $.y }; | ||
camelia | ( no output ) | ||
timotimo | i guess it would have to. you're thinking of a change in the buildplan? | ||
scovit | yes, but I would have to figure out how to approach it | 22:57 | |
timotimo, for the moment maybe this fix is enough | 22:59 | ||
it mirrors more or less what need to be done in the not inlined case | |||
23:03
Doc_Holliwood left
23:09
pecastro left
23:13
donaldh left
23:17
lichtkind left
23:30
donaldh joined
23:31
scovit left
|
|||
ctilmes | scovit, jnthn, timotimo: thanks. I just cheat and pull the inside structure out with nativecast(my structure, Pointer.new(nativecast(Pointer,self)+offset of inside structure)) | 23:31 | |
23:34
tlcu_ joined
23:40
ctilmes left
|