🦋 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.
cpan-raku New module released to CPAN! eigenstates (0.0.1) by 03ELIZABETH 13:27
lizmat wonders how Red would handle features described in blogs.perl.org/users/zhtwn/2020/10/...bbits.html 14:11
SmokeMachine ^^ :-)
SmokeMachine lizmat: that’s a good question. I think Red has that same problem and it could be fixed the same way they handled it with DBIC. But for doing that right, we should have a weak ref hash... that we don’t, right? 16:10
lizmat I'm not sure I understand how that would be needed ? 16:13
SmokeMachine Otherwise the obj would never be garbage collected, right? Or am I missing something? 16:14
Other solution would be only get values instead of objects... 16:15
lizmat but, there is no difference between values and objects ? 16:16
or do you mean native int / str / num ?
SmokeMachine I mean not row objects 16:17
But I think the weak ref cache would be a better solution 16:18
Why don’t we have weakref?
colomon__ Is there an accepted best practices for including C/C++ code with a Raku module? Looking to experiment with custom C inner loops with Raku mandelbrot code… 16:19
SmokeMachine If we did, I could store the obis on a hash and if we do not use that it would gced but otherwise we would use the same obj if that was requested again 16:20
lizmat colomon__: apart from NatveCall test files, I'm not aware of any 16:21
lizmat perhaps some module with NativeCall as a dependency could serve as inspiration ? 16:21
SmokeMachine lizmat: why weak ref hash doesn’t make sense? (I’ve asked that before but I don’t remember the answer) 16:29
lizmat in raku, an object is either reachable, or it is not: in the latter case, it is ok for the GC to kill it 16:30
whenever it feels like it
weak refs imply some sort of reference counting (even if it is only 1 or 0)
and that's unlikely to happen 16:31
moritz there are still *some* use cases for weak references, even with a GC
SmokeMachine Do you know how Java does that?
lizmat no, I don't, so please enlighten me :)
moritz for example, a class could keep references to its child classes, to be able to propagate down augments to them 16:32
moritz but if it did that with regular references, it would keep all (even anonymous / lexical) subclasses alive 16:32
SmokeMachine (I’ve asked because I don’t know either)
lizmat SmokeMachine: I know a little bit how Perl does that, and as I remember, it is a messy hack 16:33
Grinnz will correct me I'm sure if I'm wrong about that :-)
SmokeMachine I think the way Java does is different from the Perl way... but I don’t really know anything about it 16:34
moritz: weakref map is another example
www.baeldung.com/java-weakhashmap 16:35
SmokeMachine In Java it seems to have strong, soft and weak references 16:37
And the gc knows rache one of them
SmokeMachine Than if there is a path to the obj passing by a strong ref it’s not gced, otherwise if paths passing by a soft ref, it will be gced only when the system needs memory and if passing by a weakref only, it can be gced without thinking twice 16:40
Grinnz perl doesn't have a GC, just refcounting and weak refs don't increment the refcount, that's all 16:47
SmokeMachine Grinnz: yes, I know, but that’s not the case with Java, for example... 16:48
another example of garbage collected language with weakref is kotlin 16:50
moritz Grinnz: but not incrementing the refcount cannot be all -- how would perl know to set the (weak) reference to undef once the referent is GCed? 17:54
Grinnz i don't know the implementation 17:57
lizmat yeah, my memory was that it was quite a bit more involved than just reducing refcount
Grinnz there is a virtual table of backrefs, so i assume it uses that to set all weak referents to undef 17:59
references even
SmokeMachine I’ve needed weakref a more than once... 18:12
lizmat and yet another Rakudo Weekly hits the Net: rakudoweekly.blog/2020/10/12/2020-...irst-year/ 19:13
codesections lizmat++ Thanks as always :D What do you/others think the story behind the «Raku [laughs]» line? It was before my time, but Audrey used to be pretty heavily involved with Raku, right? 19:43
lizmat yes, without her there would not have been a Raku
jdv79 the pugs era was pretty crazy 19:44
lizmat twitter.com/liztormato/status/1278...80/photo/1 19:45
jdv79 arguably Perl wouldnt be the same without it 19:46
codesections lizmat: Very cool piece of history! I take it the front/bottom row is Daemon Conway, Larry Wall, and Audrey Tang. Can you help me out with the top/back row? 19:51
lizmat the one just above Damian is Mark Overmeer... 19:55
sadly the names of the other two escape me atm 19:56
melezhik Hi! I am looking for a module to colorize terminal output, the only I've found - Terminal::ANSIColor - is quite old, and not sure if maintained ... 20:15
tellable6 2020-10-05T08:14:46Z #raku-dev <jmerelo> melezhik how?
melezhik .tell @jmerelo - see github.com/melezhik/RakuDist/blob/...modules.sh 20:16
tellable6 melezhik, I cannot recognize this command. See wiki for some examples: github.com/Raku/whateverable/wiki/Tellable
melezhik .tell jmerelo: - see github.com/melezhik/RakuDist/blob/...modules.sh
tellable6 melezhik, I'll pass your message to JJMerelo
melezhik .tell JJMerelo: here is full CICD example with pulling RakuDist build status and waiting it finishes - github.com/melezhik/RakuDist/blob/...on-example 20:18
tellable6 melezhik, I'll pass your message to JJMerelo
melezhik .tell JJMerelo: you basically give it a list of modules and run them all, RakuDist will place request in queue and start executing them one by one ... 20:19
tellable6 melezhik, I'll pass your message to JJMerelo
melezhik oh, I've found that one - modules.raku.org/dist/Colorizable:cpan:UZLUISF 20:22
melezhik How do I check check if a module installed in runtime? 20:23
MasterDuke try `need` or `require`, don't remember the difference 20:24
codesections melezhik: As far as I know, Terminal::ANSIColor is maintained/still the go-to module for colorizing terminal output. It was updated just a couple of years ago, and the code is very simple (< 100 lines). What sort of updates would it need? 20:36
tellable6 codesections, I'll pass your message to melezhik
codesections m: say "Hello, \eWorld!\e" 20:37
camelia Hello, World!
codesections formatting terminal output isn't hard :D 20:38
melezhik codesections yeah I see. I am choosing b/w Colorizable and Terminal::ANSIColor. The first one has a documentation, let's see maybe I'll stick to it ... 20:40
tellable6 hey melezhik, you have a message: gist.github.com/e81b585018842d4c34...32d0c5d9ed
codesections and, in any event, Terminal::ANSIColor is one of the most-frequently depended on packages finanalyst.github.io/ModuleCitation/
melezhik Colorizable also has a zero dependencies ... 20:41
modules.raku.org/dist/Colorizable:...A6.json#L7 20:42
codesections that's also true for Terminal::ANSIColor -- and, really, printing output to the terminal with ANSI escape codes shouldn't require dependencies. 20:44
`
jdv79 have you heard of npm?;) 20:45
dep concerns be damned. full speed ahead! 20:47
codesections (I sound like I'm advocating for Terminal::ANSIColor, but I'm really not. Use whichever seems better -- or roll your own, like I said, it's not hard. All I'm pushing back on is that this is an area that's complex/fast moving enough that a package is "unmaintained" when it hasn't been updated in ~2 years) 20:47
jdv79 yup. its a common misconception that "not updated" means bad. perhaps its Done. 20:49
(a bunch of cpan is like that) 20:51
[Coke] I think a package with no commits for 2 years can correctly be called unmaintained. 21:00
unmaintained != broken
melezhik @code 21:01
codesections , yeah, but I said "I am not _sure_ if maintained" )))) 21:02
anyway, overall I agree, the only thing I'd improve on the mentioned module is a documentation ...
[Coke] (issue/wiki activity might be a good secondary check after "last commit) 21:04
melezhik [Coke] that's right ))) 21:13
[Coke] has done enough lisp that melezhik's sends hurt. 22:01
codesections [Coke]: Agreed :D (incidentally, I tend to use :D as my default smile-emoji instead of :) for largely the same reason and/or to avoid pareedit or smartparens issues") 22:07
winters01 there any way to see if a process is already running in raku? 22:56
moon-child run 'ps' ? 23:06
cpan-raku New module released to CPAN! Date::Names (2.1.0) by 03TBROWDER 23:30