🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is still being worked out. If you're a beginner, check out the #raku-beginner channel! Set by lizmat on 16 August 2021. |
|||
00:02
reportable6 left
00:06
reportable6 joined
00:17
justsomeguy joined
00:38
evalable6 joined
01:22
neshpion left
01:36
Sgeo left
01:39
Sgeo joined
01:54
ameameFan joined,
justsomeguy left
02:03
ameameFan left
02:08
jess left
02:09
jess joined
|
|||
[Coke] | submitted a trivial PR to Cro, that's something, anyway. | 02:10 | |
02:26
ameameFan joined
02:37
linkable6 joined
03:21
jess left
03:24
neshpion joined
03:38
jmcgnh left
03:48
jmcgnh joined
04:12
neshpion left
04:40
squashable6 left
04:41
squashable6 joined
04:55
squashable6 left
04:57
squashable6 joined
05:05
squashable6 left,
squashable6 joined
06:00
frost joined
06:02
reportable6 left
07:02
unicodable6 left,
bloatable6 left,
statisfiable6 left,
sourceable6 left,
committable6 left,
quotable6 left,
tellable6 left,
greppable6 left,
linkable6 left,
releasable6 left,
bisectable6 left,
notable6 left,
benchable6 left,
squashable6 left,
shareable6 left,
evalable6 left,
nativecallable6 left,
coverable6 left
07:03
greppable6 joined,
sourceable6 joined,
bloatable6 joined
07:04
coverable6 joined,
evalable6 joined,
statisfiable6 joined
07:05
unicodable6 joined,
quotable6 joined,
shareable6 joined,
notable6 joined
07:25
abraxxa joined
07:30
abraxxa left
07:31
abraxxa joined
07:37
jmcgnh left
07:43
dakkar joined
07:46
Sgeo left
07:47
jmcgnh joined
08:04
linkable6 joined,
releasable6 joined,
nativecallable6 joined
|
|||
lizmat clickbaits rakudoweekly.blog/2021/08/16/2021-...cumbering/ | 08:32 | ||
09:03
squashable6 joined
09:04
tellable6 joined,
bisectable6 joined
09:05
committable6 joined,
benchable6 joined
09:12
ameameFan left
09:22
jo joined
10:04
reportable6 joined
10:33
dogbert11 left
11:07
thundergnat joined
|
|||
thundergnat | Is there a reason that concurrency is not enabled for .first? Or maybe I am just doing it wrong... | 11:08 | |
m: put (^∞).map(1 ~ *).race.map( -> \n { next unless [eq] (2,3,4,5,6).map: { (n × $_).comb.sort.join }; n } ).first; say now - INIT now; | 11:09 | ||
camelia | 142857 0.549896505 |
||
thundergnat | m: put (^∞).map(1 ~ *).map( -> \n { next unless [eq] (2,3,4,5,6).map: { (n × $_).comb.sort.join }; n } ).first; say now - INIT now; | ||
camelia | 142857 0.753836408 |
||
thundergnat | m: put (^∞).map(1 ~ *).race.first( -> \n { [eq] (2,3,4,5,6).map: { (n × $_).comb.sort.join } } ); say now - INIT now; | ||
camelia | 142857 1.010666259 |
||
11:09
sena_kun joined
|
|||
thundergnat | m: put (^∞).map(1 ~ *).first( -> \n { [eq] (2,3,4,5,6).map: { (n × $_).comb.sort.join } } ); say now - INIT now; | 11:09 | |
camelia | 142857 0.775302808 |
||
thundergnat | ^^ .map and .race.map are faster than both .first and .race.first | 11:10 | |
And .race.first is significantly slower than bare .first. (I know, it depends on the load, but this calculation should be heavy enough to benefit from race.) | 11:12 | ||
Or possibly I am just confused... I would certainly not be the first time. (probably not even the first time today 🙄) | 11:14 | ||
I can't stick around, but I read the logs regularly. | |||
11:15
thundergnat left
12:03
reportable6 left
|
|||
kawaii_ | Hello, I have a subroutine which returns some JSON data. I'd like to iterate over each pair in the data and run the amount through my stake-int-friendly routine so the number becomes human readable - but I can't really figure out how to break down the data for iteration. www.irccloud.com/pastebin/UW0o3sD9/ | 12:04 | |
example data ^ www.irccloud.com/pastebin/veHjkNOA/ | 12:05 | ||
sena_kun | kawaii_, is that me or you are doing a loop on values and stake-int-friendly returns not a pair value, and then you try to initialize a hash with those not pair values? | 12:11 | |
maybe you mean something like... | 12:12 | ||
my %stakes = stakers-info<>.map({ $_<delegator> => stake-int-friendly($_<amount>) })? | 12:13 | ||
kawaii_ | oh, hmm, this looks like it makes more sense, let me try it :) | ||
sena_kun | I am really not sure desugaring (unpacking?) in signatures work this way as you probably intend it to. | ||
kawaii_ | sena_kun: thank you, this works perfectly :) | 12:15 | |
sena_kun | m: sub foo { @(%( a => '12001464284108570651140', d => 'rdx1' ),) }; my %hash = do for @(foo) -> $item { $item<d> => ($item<a> * 2) }; say %hash; | 12:16 | |
camelia | {rdx1 => 24002928568217141302280} | ||
sena_kun | the call to .Hash is not necessary | ||
yw | |||
kawaii_ | sena_kun: am I going about trying to iterate over this in a Cro template the wrong way? `<:sub input($_)><@stakes><.amount> : <.delegator></@></:>` | 12:23 | |
`template 'stakes.crotmp', format-stakes;` | |||
sena_kun | kawaii_, your template assumes you are passing a hash with `stakes => ...`, but your `format-stakes` routine returns just a hash? | 12:26 | |
so you probably need something like `%( stakes => format-stakes() )`? | |||
12:27
demostanis[m] joined
|
|||
demostanis[m] | Wouldn't Raku with Rust macros be awesome? | 12:28 | |
lizmat | why not Raku with Raku macros ? :-) | 12:42 | |
demostanis[m] | Raku macros seem less fun than Rust's | ||
lizmat | in their current state: yes, I agree :-) | 12:44 | |
leont | Yeah, it's waiting for RakuAST before it gets really interesting | 12:49 | |
demostanis[m] | What's RakuAST? | 12:50 | |
leont | A big refactor that's currently in progress on how code gets transformed into bytecode | ||
dakkar | or, more relevant to macros, a way for macros to actually look inside their arguments and make sense of them, and also a way to generate code without splicing strings together | 12:52 | |
demostanis[m]: www.youtube.com/watch?v=B5-gNKRw4g...mp;index=8 this video explains what it is, and the current status of the project | 12:53 | ||
lizmat | demostanis[m]: recommended :-) | 13:14 | |
MasterDuke | seconded | 13:23 | |
13:26
Sgeo joined
13:34
codesections joined
13:41
jess joined
|
|||
demostanis[m] | Ahh ok. I understand. It seems like a lot of work. | 13:43 | |
dakkar | yep | 13:44 | |
but necessary | |||
13:57
jaguart joined
14:04
jess left,
reportable6 joined
|
|||
lizmat | thundergnat: there is no .first on hypers yet | 14:20 | |
tellable6 | lizmat, I'll pass your message to thundergnat | ||
leont still has to watch that presentation, but it's in front of their yt queue | 14:24 | ||
14:33
tib joined
|
|||
jdv is wondering if the mem leaking will change incidently by all the new big changes | 14:34 | ||
lizmat has no doubt about that. But if it will leak more or less, that's the question :-) | 14:36 | ||
14:36
clarkema joined
|
|||
tib | Hello, I'm looking for a kind volunteer to proofread a long blog post (long = 22 minutes read according to devto) and report me mistakes (technical and english). Of course it's about raku :) | 14:40 | |
gfldex | I could read it. If that proofs anything, I don't know. :) | 14:41 | |
Altreus | I can do the grammar bit | ||
14:51
wingfold joined
|
|||
MasterDuke | jdv: any mem leaking in particular in mind? | 14:51 | |
frost | m:say DateTime.now | ||
evalable6 | 2021-08-17T16:51:47.136597+02:00 | ||
14:52
frost left
14:56
mattil joined
|
|||
tib | thank you a lot gfldex and Altreus I'm already on it with lizmat :) :) | 14:58 | |
jdv | yes, the very same that mr lembark ran into | 15:00 | |
i can probably repro it these days - maybe i will | |||
i think the prevailing guess was libuv buffers or soemething now that i think about it | 15:01 | ||
Altreus | :) | ||
MasterDuke | jdv: github.com/rakudo/rakudo/issues/3086 ? | 15:02 | |
15:03
abraxxa left
|
|||
jdv | hmm, i don't think so. | 15:06 | |
i'll try to golf it. i'll be back in a few hours probably... | |||
MasterDuke | cool | 15:09 | |
15:12
jo left
|
|||
pat_js | is there a syntax to match on hash keys? | 15:59 | |
Altreus | there's .keys.grep | 16:00 | |
pat_js | m: "!foo"~~/'!' [$({:1foo,:2bar}.keys)]/ | 16:01 | |
camelia | ( no output ) | ||
dakkar | m: say "a" ~~ %(a=>1) | ||
camelia | True | ||
dakkar | m: say "a" ~~ %(b=>1) | ||
camelia | False | ||
pat_js | Altreus: but I want it the other way around (full keys as part of a regex, not parts of keys described by regex) | 16:02 | |
Altreus | m: "!foo" ~~ any( $({:1foo,:2bar}.keys) ); # does any work? | 16:04 | |
camelia | ( no output ) | ||
Altreus | o you'd have to map maybe | ||
m: "!foo" ~~ any( {:1foo,:2bar}.keys.map: / $_ / ); # maybe? | |||
camelia | No such method '!cursor_start' for invocant of type 'Str' in block <unit> at <tmp> line 1 |
||
Altreus | eh something like that | ||
I anticipate you're trying to inject it into an existing regex anyway | 16:05 | ||
dakkar | m: my %a=(foo=>1, bar=>2); say "!foo" ~~ /@(%a.keys)/ | ||
camelia | ï½¢fooï½£ | ||
dakkar | like that? | ||
pat_js | m: my %a=(foo=>1, bar=>2); say "!foo" ~~ /'!'@(%a.keys)/ | ||
camelia | ï½¢!fooï½£ | ||
pat_js | yeah! thank you dakkar! did not know about the @() inside of a regex | 16:06 | |
dakkar | pat_js: the `@(%a.keys)` in that case is expanded to something like `['foo'|'bar']` | ||
Altreus | that's an intelligent DWIM | ||
I like that | |||
dakkar | docs.raku.org/language/regexes#Quo...TM_matches plus the "normal" way to cast something to a list | 16:07 | |
docs.raku.org/language/regexes#Reg...erpolation oh, it's actually mentioned at the end of this section | |||
Altreus | "the longest-match alternation" | 16:09 | |
pat_js | That's where I should have looked better… thank you again | ||
Altreus | m: my @increasingly-edible = <food foo fo f>; say 'food' ~~ /@increasingly-edible/; | ||
camelia | ï½¢foodï½£ | ||
dakkar | the documentation is *vast*, I knew something like that was documented but it still took me a while to find it! | ||
Altreus | m: say 'food' ~~ /< food foo fo f >/ | 16:10 | |
camelia | ï½¢foodï½£ | ||
Altreus | ah! order not important | ||
dakkar | Altreus: yep, lists get interpreted as `|`-alternatives, that do longest-token-matching | ||
m: say 'food' ~~ /[f||fo||foo||food]/ | 16:11 | ||
camelia | ï½¢fï½£ | ||
dakkar | `||` does left-to-right | ||
Altreus | aha | ||
dakkar | I don't think there's a way to have @-interpolations do `||`, though | ||
Altreus | Where to draw the line between "relevant here" and "go and find that out", when writing docs, is difficult | ||
Personally I would have at least nb'd that there were | and || lists | 16:12 | ||
"lists" | |||
in regex | |||
alternations | |||
16:12
linkable6 left,
evalable6 left
16:13
evalable6 joined
|
|||
Altreus | oh I just realised this section is part of the | doc :D | 16:17 | |
16:36
dakkar left
16:57
wingfold left
17:11
b2gills left,
b2gills joined
17:25
sena_kun left
17:42
MoC joined
18:03
reportable6 left
18:04
reportable6 joined
18:10
MoC left
18:14
linkable6 joined
18:27
xinming left,
xinming joined
18:50
avuserow left,
synthmeat left,
avuserow joined,
synthmeat joined
|
|||
mjgardner | New blog post on using Perl modules in Raku: phoenixtrap.com/2021/08/17/perl-ra...frenemies/ | 18:52 | |
18:54
abraxxa-home joined
|
|||
lizmat | mjgardner++ | 18:59 | |
19:12
neither joined
19:15
abraxxa-home left
19:31
discord-raku-bot left,
discord-raku-bot joined
19:45
discord-raku-bot left
19:46
discord-raku-bot joined
20:21
mattil left
20:25
lucasb joined
20:32
jrjsmrtn left
20:34
jrjsmrtn joined
|
|||
gfldex | lolibloggedalittle: gfldex.wordpress.com/2021/08/17/most-fancy/ | 20:42 | |
20:50
clarkema left
20:53
neither left
21:09
Sgeo left
21:12
Sgeo joined
21:38
holyghost joined
22:03
holyghost left
22:04
holyghost_ joined
|
|||
holyghost_ | ugh! network kill. | 22:04 | |
tib | mjgardner Nice post! I think you posted twice the Raku snippet whereas you wanted to post a pure Perl 5 version in the « Perl feed finder » part + there is 2 words without space « typesused » | 22:05 | |
holyghost_ | anyway, hacking perl5 for third Ph.D. Will work more on AI-NLP later on. | ||
tib | But this is a great post with a lot of interesting links as usual (you know I’m a fan) | ||
mjgardner | Thanks tib. The hazards of crossposting to another CMS… | 22:13 | |
Should be fixed now | |||
tib | Fixed mjgardner | 22:14 | |
Thank you for this | 22:15 | ||
23:04
evalable6 left,
linkable6 left
23:05
evalable6 joined
23:21
holyghost joined
23:37
holyghost_ left
|