🦋 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:08
Black_Ribbon joined
00:13
dogbert11 joined
00:16
dogbert17 left
00:19
guifa2 left
00:28
japhb joined
|
|||
summerisle | i'll add that the only noticeable slowness (for what i've been doing) seems to be from the parse phase, which i'm sure could be optimized | 00:31 | |
leont | Which is really slowness in the grammar engine | 00:38 | |
Which is exactly what it's so difficult | 00:39 | ||
00:55
pecastro left
00:58
guifa2 joined
01:05
guifa2 left,
guifa2 joined,
cgfbee joined
01:08
squashable6 left
01:11
squashable6 joined
01:32
MasterDuke left
01:37
dogbert11 left
01:42
DiffieHellman left
01:43
DiffieHellman joined
01:55
gnufr33dom joined
02:03
kvw_5_ joined
02:06
kvw_5 left
02:16
codesections left,
codesections joined
02:21
codesections left
02:22
codesections joined
02:26
codesections left,
leont left,
codesections joined
03:05
codesections left
03:06
codesections joined
03:13
guifa2 left
03:15
codesections left,
codesections joined
03:17
codesections left,
codesections joined
03:21
codesections left,
codesections joined
03:23
Garbanzo joined
04:07
gnufr33dom left
04:17
gnufr33dom joined
04:49
Black_Ribbon left
04:56
kaiwulf left
05:49
sortiz joined
|
|||
summerisle | playing with the lazy keyword and i notice that it's really only friendly to loops, wheras if i say `my $foo = lazy frobnicate;` then `frobnicate` is called and lazy is treated as a prefix call (e.g. lazy on invocant) | 06:21 | |
moritz | yes, lists can be lazy in raku, scalars not so much | 06:29 | |
summerisle | that's what i was wondering | ||
06:30
jmcgnh left
06:35
jmcgnh joined
06:47
Discipulus joined
06:51
Discipulus left
06:54
Discipulus joined,
aluaces joined
07:03
ZzZombo joined
07:04
ZzZombo left
07:31
gnufr33dom left
07:38
Sgeo_ joined
07:41
Sgeo left
07:42
stoned75 left
07:58
wamba joined
08:00
stoned75 joined
08:13
domidumont joined
08:31
parabolize left
08:46
jmerelo joined
08:50
Sgeo_ left
09:19
pecastro joined
09:46
Scimon joined
09:48
imcsk8 joined
09:59
wamba left
10:29
wamba joined
|
|||
lizmat | summerisle: maybe modules.raku.org/dist/Object::Delayed is what your looking for, specifically "slack" ? | 10:32 | |
10:37
El_Che joined
11:13
abraxxa left
11:37
wamba left
11:40
leont joined
11:53
wamba joined
12:03
rindolf joined
12:10
Black_Ribbon joined
12:29
sivoais_ joined
13:04
Discipulus_ joined
13:05
Black_Ribbon left,
Discipulus left
13:19
aborazmeh joined,
aborazmeh left,
aborazmeh joined
13:23
sortiz left
13:50
guifa2 joined
13:55
Sgeo joined
13:56
guifa2 left
14:06
wamba left
14:18
aborazmeh left
14:34
wamba joined
15:08
gnufr33dom joined
15:52
gnufr33dom left
15:58
patrickb joined
16:08
wamba left
16:48
dogbert11 joined,
dogbert11 left
|
|||
summerisle | lizmat: yeah, that's it | 16:51 | |
17:00
parabolize joined
17:11
dogbert17 joined
|
|||
tonyo | i'd kind of expect a lazy &x to behave like haskell and only call x when the scalar is used | 17:27 | |
17:38
aborazmeh joined
17:39
wamba joined
17:45
codesections left
17:46
codesections joined
17:53
Scimon left
18:14
guifa2 joined
18:16
domidumont left
18:18
wamba left
18:28
wamba joined
18:37
_jrjsmrtn joined
18:38
__jrjsmrtn__ left
18:47
aborazmeh left
18:55
MasterDuke joined
19:55
evalable6 left,
linkable6 left
19:56
evalable6 joined
19:57
linkable6 joined
20:08
wamba left
20:14
guifa2 left
20:16
Garbanzo left
|
|||
tbrowder | hi, gang. | 20:53 | |
codesections | o/ | ||
tbrowder | is there any way to get raku to return the same sequence from pick on multiple calls? | 20:54 | |
codesections: hey! | |||
something like setting the initial seed to a constant. | 20:55 | ||
codesections | I'm confused. That sounds like you just want a sequence. Why use pick at all? | 20:56 | |
tbrowder | it would be handy in some use cases, like repeated monte carlo runs. | ||
hm, maybe so | |||
20:57
patrickb left
|
|||
tbrowder | i have an ordered list of numbers and i want to randomize the list one time | 20:57 | |
every time the script is run i should get the same result unless i change the seed | 20:58 | ||
codesections | Oh, I see | 20:59 | |
tbrowder | hm, i'll look into rand/random some more | ||
thnx | |||
codesections | yeah, there is docs.raku.org/type/Num#sub_srand but that's not quite it | 21:00 | |
tbrowder | i'm having non-secure connection problems again and can't see that :-( | 21:05 | |
codesections | (my first thought is just to do that with a cache of some sort - either compute it at compile time and then use that value until the module is re-compiled or compute it once and read it to disk. But that might be more work/IO than you want to do) | ||
tbrowder | yepper! | ||
codesections | > sub srand(Int $seed --> Int:D) | 21:06 | |
> Seeds the pseudo random number generator used by Num.rand with the provided value. | |||
tbrowder | it's easy in perl as i recall, but my perl foo is very rusty. | ||
ok, thnx, i'll go play with that a bit, bye. | 21:07 | ||
raydiak | p6: for ^10 { srand 0; (^10).pick.say } | 21:15 | |
evalable6 | 4 3 3 3 3 3 3 3 3 3 |
||
raydiak | why is the first one different? | ||
21:24
guifa2 joined
21:26
guifa2 left
21:37
rindolf left
21:40
rypervenche joined
|
|||
MasterDuke | that's...interesting... | 21:50 | |
tbrowder | codesections: success. it took 127 tries to collect all 29 numbers in a random order. script gave repeatable results | 21:52 | |
codesections | ooh, cool. What's the trick? | ||
tbrowder | time was almost instantaneous | ||
codesections | So what do you do to get it to work? Does it use srand? | 21:55 | |
tbrowder | i had to use a hash and an array. while the hash.elems < 29, get the int for 30.rand. next if zero, next if it's in the hash; put in hash, push to array. spit out array which is list of 29 random numbers | ||
clunky but i'm sure someone can golf into much less | 21:56 | ||
codesections | I'm sure! | 21:57 | |
tbrowder | i started the script with settin srand | ||
the use case is i have to pick 5 candidates out of 29 for board members on college grad assoc. i've read all 5 and think they're all pretty much qualified, so i'm picking 5 to study closer. | 22:00 | ||
read all 29! | |||
Raku to the Rescue! | 22:01 | ||
thnx for hint | |||
22:02
guifa2 joined
|
|||
codesections | No problem. Thanks for telling me how you got it to work | 22:02 | |
guifa2 | New module! github.com/alabamenhu/IntlNumberPlural | 22:34 | |
(not that this is one anyone will use probably but me lol) | 22:37 | ||
22:39
aborazmeh joined
22:48
sortiz joined
23:07
Discipulus_ left
|
|||
codesections | guifa2: that actually looks _very_ useful. I've written at least two hacky &pluralize functions in the last couple of months – and that was just to support English, with only two grammatical numbers. I don't know if/when I'll internationalize anything, but if I do that will *definitely* be in my dependencies | 23:24 | |
guifa2 | codesections: if you're doing a lot of localized text, you'll probably want one of the localziation modules (which in turn will depend on this one) | 23:26 | |
I've actually now got enough stuff rewritten to the new version of Intl::CLDR that I'm going to go back and rewrite Fluent from scratch | |||
instead of building in the localization manager into the module, I'm going to split them, that way the localization manager can pull from any number of localization formats that will (hopefully) have a mostly standardized API or be able to have 1-2 liner bridging functions | 23:28 | ||
codesections | well, by the time I need to localize anything, it sounds like it'll | 23:29 | |
*be a pretty smooth experience! | |||
guifa2 | Also the Plural module will need to be rewritten when RakuAST comes out haha | 23:30 | |
So much rewriting to do haha | 23:31 | ||
codesections | also, I was reading this man page the other day and thought of you when I got to the second item in the BUGS section at the bottom: www.gsp.com/cgi-bin/man.cgi?sectio...;topic=MTM | 23:33 | |
23:36
MasterDuke left
|