🦋 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:16 wamba left 00:20 wildtrees left 00:22 shadowpaste joined 00:23 SQuoll left 00:29 shadowpaste left 00:37 caterfxo left 00:39 lucasb left 00:40 SQuoll joined 00:51 ribasushi left 00:54 caterfxo joined 00:57 ribasushi joined 01:13 sena_kun joined 01:15 Altai-man_ left 01:20 k-man left 01:22 k-man joined 01:26 markoong left 01:29 Doc_Holliwood left 01:36 SQuoll left
rypervenche Is it possible to output bytecode into a file? Like using --target=mbc ? I tried that but got: Cannot dump this object; no dump method 01:41
01:48 SQuoll joined 01:50 Black_Ribbon left 01:51 Black_Ribbon joined 01:54 SQuoll left 02:02 MasterDuke left 02:05 SQuoll joined 02:06 molaf left 02:18 molaf joined 02:27 SQuoll left 02:33 SQuoll joined 02:41 sono__ joined 02:42 Black_Ribbon left 03:01 camelCaser left 03:02 camelCaser joined 03:03 molaf left 03:12 Altai-man_ joined 03:15 sena_kun left, molaf joined
timotimo rypervenche: did you also give it a --output=blah? 03:15
03:27 ensamvarg joined 03:53 aborazmeh left 03:58 pilne left 04:16 aborazmeh joined, aborazmeh left, aborazmeh joined 04:18 rindolf joined
MilkmanDan imgur.com/gallery/Wa45rla 04:36
04:48 molaf left 05:13 sena_kun joined 05:15 Altai-man_ left 05:35 aborazmeh left 05:41 sauvin joined 06:01 PavelB joined, rindolf left 06:12 rindolf joined 06:33 ensamvarg left 06:41 domidumont joined 07:13 Altai-man_ joined 07:15 sena_kun left 07:38 stoned75 left 07:41 finanalyst left 08:10 PavelB left 08:11 Kaiepi joined 08:13 xelxebar left 08:16 xelxebar joined 08:36 sauvin left 08:46 vrurg left 08:47 vrurg joined 08:48 abraxxa joined, Geth left 08:49 Geth joined, xelxebar left, cpan-raku left, dogbert11 joined, Kaiepi left, cpan-raku joined, cpan-raku left, cpan-raku joined, Kaiepi joined 08:52 dogbert17 left 08:57 xelxebar joined 08:59 tyil left 09:00 cooper left, cooper joined 09:13 sena_kun joined 09:14 dakkar joined
Altreus lizmat: I put them on github :D 09:14
lizmat Github is a big place 09:15
Altreus your repo is a small one though :)
09:15 Altai-man_ left
Altreus github.com/lizmat/ObjectCache/issues 09:15
lizmat found them :-) 09:16
09:25 wamba joined 09:38 finanalyst joined 09:40 sono__ left, sauvin joined 09:41 sauvin left
lizmat Altreus: new version of ObjectCache, with evict capability, on its way to CPAN 09:42
09:43 pecastro joined 09:57 MasterDuke joined 09:58 Doc_Holliwood joined 10:01 finanalyst left
Altreus woot! 10:19
also TFW you don't notice your SSH has disconnected
even though you closed your laptop for half an hour and changed networks
> The `!EVICT` method returns the object that is removed from the cache, or `Nil` if the object was not in the cache. 10:21
This is why liz code is quality code
I've recently opened an issue on something else that does not behave along a similar pattern 10:22
forgot what mind you
10:30 vike left 10:34 vike joined
lizmat :-) 10:41
Altreus Now I can cache my ButReals and uncache them if I want to be sure of re-fetch 10:59
and the way you force a re-fetch is to evict it
nice nice
Later
:(
lizmat method re-fetch() { self!EVICT; self.bless(id => $!id) } 11:04
method re-fetch() { self!EVICT; self.bless(:$!id) } # shorter :-) 11:05
11:06 aborazmeh joined, aborazmeh left, aborazmeh joined 11:12 Altai-man_ joined
Altreus self!EVICT; self.fetch 11:14
:P
11:15 sena_kun left
lizmat self!EVICT.fetch even :-) 11:18
assuming you're sure the object wasn't evicted before :-) 11:19
Altreus can't be
User might de-cache it Just In Case
honestly I think I might just have uncache as a separate thing 11:20
Then the user can say what they mean
After all, the cached thing is an Object::Delayed, so fetch might not be the thing they do
lizmat hmm... but Object:Delayed needs a container, ObjectCache doesn't give containers ? 11:21
Altreus Indeed, I'll be caching the ButReal 11:23
There are layers going on :)
The idea is that you can freely create the top-level object, which really only has an ID and an Object::Delayed property
Once instantiated, that property now contains a data object that is in the ObjectCache 11:24
That way, if you do (for example) Channel.new(1234), then when you access any data from that channel, the Object::Delayed runs a constructor, which is cached
If it isn't cached, the constructor fetches it
in theory! 11:25
rypervenche timotimo: Yes, I did give it an --output like that. Same error.
11:30 vike left 11:37 theovdh joined
theovdh Hi gurus, getting: 'Cannot find method 'has_hook' on object of type NQPMu' when debugging big program containing Grammar. Suggestions? 11:40
lizmat you could start by making a gist of the output of the stack trace when run with --ll-exception 11:45
11:47 vike joined
theovdh thanks @lizmat 11:51
11:57 _jrjsmrtn joined 11:58 aborazmeh left 11:59 __jrjsmrtn__ left
rypervenche timotimo: Ahh, I think I kind of found my problem. I ran --target=mbc on a script that doesn't expect input and that works fine. I guess it doesn't work if it expects user input. 12:01
12:06 aindilis left 12:10 aindilis joined 12:14 markoong joined 12:25 markong joined, markoong left 12:34 Kaeipi joined, Kaiepi left 12:53 natrys joined 13:02 Voldenet left 13:04 camelCaser left 13:06 camelCaser joined 13:13 sena_kun joined 13:15 Altai-man_ left 13:16 daxim left, Voldenet joined, Voldenet left, Voldenet joined 13:21 daxim joined 13:38 rypervenche left 13:41 rypervenche joined 13:43 Doc_Holliwood left 13:59 lucasb joined 14:02 cpup left, cpup joined, Doc_Holliwood joined 14:07 MasterDuke left
timotimo rypervenche: hum, the script you're using it on shouldn't make a difference i think? 14:26
rypervenche: can you give the exact commandline you're using? 14:27
perl6 --target=mbc --output=blah.moarvm -e 'say "hello world"'
^- this works for me
14:31 tejr left
rypervenche Ahhh, it doesn't seem to work with -o, but does work with --output. I've tried: raku --target=mbc -o /tmp/blah.moarvm ./script.raku and also with -o=/tmp/blah.moarvm 14:37
14:38 tejr joined 14:40 molaf joined 14:43 bdju left 14:44 sarna left 14:49 MasterDuke joined 14:51 molaf left 14:52 sarna joined 14:54 AlexDaniel joined, AlexDaniel left, AlexDaniel joined 14:59 ChanServ sets mode: +o AlexDaniel, camelia was kicked by AlexDaniel (Kicked by AlexDaniel)), ChanServ sets mode: -o AlexDaniel 15:05 bdju joined 15:06 Doc_Holliwood left 15:12 Altai-man_ joined 15:13 evalable6 left 15:15 evalable6 joined, sena_kun left 15:18 evalable6 left 15:21 evalable6 joined 15:26 xelxebar left 15:28 xelxebar joined 15:31 aindilis left 15:32 aindilis joined 15:44 mowcat joined
timotimo maybe "-o blah" not working is something we can fix 16:00
16:09 veesh_ joined 16:12 veesh left, veesh_ is now known as veesh 16:13 regreg_ joined 16:15 Doc_Holliwood joined 16:16 regreg left
rypervenche I'll submit an issue to rakudo then. 16:23
16:23 theovdh left 16:30 tyil joined, tyil left, wamba left
kawaii I have the following snippet of code I'm a little confused about - I've got a subroutine (`start-vote`) which returns a promise which is supposed to last for 60 seconds. It's my understanding that using `.then` means whatever you feed it doesn't happen until something you're awaiting has completed - but all of these things in the code sample just trigger at the same time 16:49
gist.githubusercontent.com/kawaii/...e9/test.p6
16:51 finanalyst joined 16:58 finanalyst left, aborazmeh joined, aborazmeh left, aborazmeh joined
AlexDaniel kawaii: but you're not doing .then on start-vote 16:58
kawaii: you're doing it on send-message, no?
kawaii AlexDaniel: you're right, it's triggering _both_ `.then`'s at the same time 16:59
nice catch, thanks
I need to chain them
AlexDaniel point is I don't see where you call start-vote and if you do at all
aahhh I see now 17:00
right, you're doing .then on the wrong thing :)
17:00 abraxxa left
AlexDaniel for example, it can be inside the parens 17:00
17:02 Guest1277 left
kawaii Yep, I fixed it, thanks :) 17:03
AlexDaniel kawaii: also why don't you just put that whole thing into a react block or something 17:04
you can do whenever Foo { whenever Foo { whenever Foo { } } }
jnthn: btw what's the right way to have whenevers outside the lexical scope? 17:05
jnthn: some of my programs are just… uh… a single react block
sure I can call subs from whenevers but then I don't have the ability to just plug a whenever anywhere in my code
which I do a lot
IIRC it was possible earlier but then we figured out it was accidental and is not supposed to work, but now I really want it :D 17:06
kawaii AlexDaniel: this is really the first thing I've done which makes use of Promises and async in P6, still not entirely sure I'm doing things right but solving one problem at a time 🥴 17:07
gist.githubusercontent.com/kawaii/...voteban.p6
It looks messy but... small steps :) 17:08
AlexDaniel kawaii: it's weird to see .then. Just use react? 17:09
react { whenever ….send-message { whenever start-vote { say ‘ok we're done!’ } }} 17:10
alternatively just make start-vote blocking, you're using it as such anyway
kawaii 🤔
AlexDaniel our docs for react really suck, actually 17:12
we should be advertising it throughout all doc pages
there's this monster example here: docs.perl6.org/type/Proc::Async 17:13
17:13 sena_kun joined 17:15 wamba joined, Altai-man_ left
jnthn AlexDaniel: Factor some of them out to separate `supply` blocks, and `whenever` those 17:16
AlexDaniel jnthn: that may sound easy but in reality it requires some refactoring which I'm not always willing to do :S 17:17
I guess I just need to make a module for myself :) 17:18
it's a common problem when you're dealing with timed sequences of things 17:21
“do this, then sleep, then do that”, but oh wait can't really sleep here
dakkar what's wrong with `await`? 17:22
lizmat dakkar: it's more plumbing than porcelain ?
AlexDaniel dakkar: are you talking about kawaii's code or my problem? :)
dakkar really?
lizmat because you can use a promise in a whenever 17:23
dakkar if I need to go through a sequence of non-blocking calls, `await first-thing();await second-thing();` looks nice to me
`whenever` feels more apt for things that can happen more than once
lizmat m: react whenever Promise.in(3) { say "waited" } 17:24
evalable6 waited
AlexDaniel dakkar: that doesn't make any sense if you have other async events happening
surely you can `start` everything, but then you get all the usual problems
dakkar AlexDaniel: true
(also I can't find examples in my code where I use `await`, but plenty of `whenever`, so maybe I'm just confused today ☺) 17:27
SmokeMachine Hi there! Is there a way of finding what attributes a method use?
moritz SmokeMachine: I'm not aware of one 17:28
SmokeMachine moritz: thanks! Wouldn’t that be good? Find what attributes a method use, what outside variables a closure use... this kind of thing... 17:30
lizmat I think this goes back to a discussion jnthn moritz nine and I had before the GPaRW 17:33
we lose too much introspection opportunities during compilation
*many
SmokeMachine I was trying to find a way of making something like: `class C { has $.a = 2; has $.b is some-trait = $!b + 2 }` and when I do something like: $!a = 40, $!b would be automatically 42...
dakkar (nitpick: you can detect which attributes a method *could* access (i.e. which are mentioned), not exactly which ones it really accesses (since the latter reduces to the halting problem)) 17:34
jnthn SmokeMachine: Those kinds of things wait for us to have a user-visible AST, which is part of the macros work. I'm doing some initial experimenting in that area. 17:35
17:39 chloekek joined
SmokeMachine jnthn: great! But that would be possible with a macro? Should the Attribute.build be a macro for that? Or will it have a way to get the ast from a given method from outside of a macro? (Sorry, just trying to understand...) 17:39
dakkar: I meant mentioned... :) 17:41
moritz SmokeMachine: btw Math::Model solves this problem by having the user write functions that take named args, and you can introspect those
17:42 [Coke] left
moritz perlgeek.de/blog-en/perl-6/physica...lling.html 17:42
y_acceleration => { $:force / $:mass },
lizmat
.oO( only one more Rakuer, and they're all not found: www.reddit.com/r/rakulang/ )
17:43
17:43 dakkar left 17:45 [Coke] joined 17:46 [Coke] left, [Coke] joined
jnthn SmokeMachine: Current thinking is that it'll be possible to obtain the AST up until CHECK time. So for example a trait on a routine could get the AST of the routine. 17:47
SmokeMachine moritz: looks good (I do something similar here (github.com/FCO/ProblemSolver/blob/...y.p6#L16)) but wouldn’t it be better to just do `has $.y-acceleration = $!force / $!mass`? 17:48
jnthn: cool! 17:49
17:49 aluaces left
SmokeMachine jnthn: something like this? #`(inside trait code) &attr.build.GET-AST # or whatever it’ll be called 17:54
jnthn: I mean, will it be like a method on Routines?
jnthn Probably along those lines, though I doubt you'll have to shout it :P 17:56
SmokeMachine :)
It will make Red’s life much easier! :) 17:57
18:02 reportable6 left 18:03 reportable6 joined 18:06 pecastro left 18:14 aborazmeh left 18:19 aluaces joined 18:24 wildtrees joined 18:43 woolfy joined 18:45 woolfy left, perigrin_ joined, perigrin_ left 18:46 woolfy joined 18:47 woolfy left 18:52 ufobat__ joined 18:55 perigrin joined 18:56 ufobat_ left, molaf joined 19:01 perigrin left 19:12 Altai-man_ joined 19:15 sena_kun left 19:26 melezhik joined
melezhik Hi! I launched a beta version of SparrowHub - repo.westus.cloudapp.azure.com/hub/ , I'd interested to hear about what kind of plugins could be useful for Raku community. Would appreciate for any feedback. Warning - some of the plugins could not work as a migration of Sparrow to Raku has not finished yet. 19:33
19:37 domidumont left 20:04 wamba left 20:08 mowcat left
jnthn melezhik: Ah, is that the cro app you've been writing recently? :) 20:10
melezhik yeah, I rewrote former SparrowHub to Raku/Cro making some system redesign on the way 20:11
basically it's just UI to search/read docs on "official" sparrow plugins (github.com/melezhik/sparrow-plugins) 20:12
as well as main repo
20:22 mowcat joined 20:38 rindolf left 20:39 SQuoll left 20:48 pecastro joined 20:57 SQuoll joined 21:04 foo222 joined 21:14 sena_kun joined 21:15 Altai-man_ left 21:19 Possum joined 21:20 AlexDaniel left, AlexDani` joined 21:28 SQuoll left 21:52 SQuoll joined 22:04 squashable6 left 22:06 squashable6 joined 22:07 chloekek left 22:13 veesh left 22:16 _jrjsmrtn left 22:20 __jrjsmrtn__ joined 22:24 ensamvarg joined 22:25 SQuoll left 22:27 veesh joined 22:31 pnu__ left, dylanwh left, Hotbees left 22:32 pnu__ joined 22:34 dylanwh joined, Hotbees joined 22:35 melezhik left 22:36 Black_Ribbon joined, isacl___ left, BuildTheRobots left, PotatoGim left, tbrowder left, mrsolo left 22:38 mrsolo joined 22:40 ribasushi left, BuildTheRobots joined, tbrowder joined, PotatoGim joined 22:42 ribasushi joined 22:43 isacl___ joined 22:45 stoned75 joined 22:46 ChoppedBacon left 22:47 SQuoll joined 22:49 ChoppedBacon joined 22:50 caasih left, timeless left 22:51 timeless joined, caasih joined 22:52 foo222 left 22:55 natrys left 22:56 mithaldu_ left, kawaii left, zostay left, Grinnz left, lucasb left, spycrab0 left, peteretep left, stoned75 left
tbrowder i need some advice for a much simpler problem: given a routine to return the fractional part of a number, for an integer input should it return undefined (Any) or zero? 22:56
22:57 stoned75 joined 22:58 mithaldu_ joined 22:59 peteretep joined 23:00 zostay joined, Grinnz joined, aborazmeh joined, aborazmeh left, aborazmeh joined
lizmat what is the type of the fractional part it returns if it is *not* an integer? Str or Int ? 23:01
23:03 spycrab0 joined, lucasb joined, kawaii joined
tbrowder as i have the routine coded now, i check for the input type and eventually the input, if not an integer, will be a Num. 23:09
and in that case the frac part becomes undefined for an allomorph input as "1.0" 23:11
23:12 aborazmeh left, Altai-man_ joined
tbrowder looking at all my test cases as input, i'm leaning toward zero in all cases including int input. 23:13
23:14 MasterDuke left 23:15 sena_kun left
tbrowder given my main use case as a string input of base other than dec, oct, hex, or oct, then zero makes more sense to me if the string either has no radix point or has nothing other than zeroes after the radix point. 23:16
*oct => binary 23:17
23:20 AlexDani` is now known as AlexDaniel, AlexDaniel left, AlexDaniel joined 23:24 camelia joined
AlexDaniel tbrowder: what does it return for 1.0001 ? 23:26
tbrowder 0001 (radix point implied) 23:27
AlexDaniel and what's the type of that?
tbrowder str
Str 23:28
AlexDaniel so why would you return a zero instead of an empty string if you always return a string?
tbrowder i'm looking at a caller testing for the fractional part so, with no number of value after an existing radix point, or a nonexistent radix point, the return value should be falsy imho: either zero or '' or undefined. 23:33
"does it matter" i guess is my question.
AlexDaniel "who needs that" is mine 23:34
tbrowder er, i do, for the moment.
just "testing the warer 23:35
*water"
23:40 Actualeyes left 23:46 MasterDuke joined 23:53 aborazmeh joined, aborazmeh left, aborazmeh joined