🦋 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.
SmokeMachine twitter.com/smokemachine/status/13...68035?s=21 03:08
guifa2 SmokeMachine++ 03:09
guifa2 is still waiting to make a crazy killer app combing Red, Cro and all the internationalization modules. Soon 03:10
SmokeMachine guifa2: if I can help on that, please, let me know! 03:12
guifa2 SmokeMachine: as soon as I figure out what it is, I'll let you know ;-)
But having all the tools is the first step
SmokeMachine I’ve spent many time thinking how should I express N-M relationship, and today I thought if it was a array of objs? How would o do it? Simple: $post.post-tags>>.tag; and that just worked as it should… I don’t think we should have any other syntax for that… 03:19
guifa2 SmokeMachine: I believe they call that the fruits of a well thought out design 03:23
SmokeMachine :) 03:24
guifa2 This feels … off 03:42
tio.run/##K0gtyjH7/z@3UkElUcFWwcCa...kAcbv3/PwA
Binding feels like it should be faster, but it's not. But my \foo = (value) is effectively binding anyways, right? 03:45
(I added an extra test just now for my $x := (value) and it's just as slow. The := operator seems to incur a huge performance penalty) 03:46
El_Che twitter.com/gugod/status/136264219...32260?s=19 09:06
"perl" devroo
m
MasterDuke guifa2: i think the optimizer is getting confused by the multiple loops in your example. if i run a single loop and then just change what it's doing,  `$x :=`, `\x =`, and `\x :=` are all the same, `$x =` is roughly half as fast 09:49
tellable6 MasterDuke, I'll pass your message to guifa2
DinoAllo Hello everyone! I am just getting start with Raku, and would like to set up Emacs as my main editor. Do any of the folks here use Emacs? 13:22
I checked raku-mode and it was great. Are there any of Emacs packages that provide auto-complete feature for Raku? 13:23
For example, like a backend for company-mode 13:25
DinoAllo I tried to search related projects but it was fruitless 13:26
However, it's a great pleasure to join Raku community :) 13:27
Altai-man_ DinoAllo, there is raku-mode for emacs. 14:03
DinoAllo, sadly, there is no abundance of emacs users around and raku is not so popular either, so it gives you less support. It's another deal if you write elisp and can contribute. :) 14:04
DinoAllo Altai-man, I was asking to avoid reinventing a wheel, and, yes, I would love to contribute :) 14:13
Altai-man_ DinoAllo, no, I don't think you would! In fact, someone with time and able to give some love to emacs support is just awesome. I believe you can contribute to raku-mode if needed (the folks there are usually kind and easy to work with) or package something yourself if you need to, nothing much else is done in this area. 14:23
MasterDuke DinoAllo: colabti.org/irclogger/irclogger_lo...xt=checked will give you some names of other likely emacs users 14:45
DinoAllo Altai-man, as an emacs hacker, it's both sad and joyful to see that raku is not well-supported on emacs. 15:11
I know I will not have the best experience out of the box. On the other hand, it means more thing I can hack and contribute! :)
MasterDuke, thanks! 15:12
SmokeMachine Someone with more expertise with blogs... could help me on this? github.com/FCO/BlogSchema 15:15
what I've done wrong? what am I missing? what would be useful to add?
hythm m: multi trait_mod:<is>( Variable:D \v, :$test-trait ) { say v.var }; my @a is test-trait; my @b[1] is test-trait; 15:39
camelia []
(Array)
hythm is it expected that the shaped array one is a type object? 15:40
lizmat m: multi trait_mod:<is>( Variable:D \v, :$test-trait ) { say v.VAR }; my @a is test-trait; my @b[1] is test-trait; 15:42
camelia Variable.new(name => "\@a", scope => "my", var => [], block => -> gnatur { #`(Block|75421824) ... }, slash => Perl6::Grammar.new() #`[140692827339688], implicit-lexical-usage => Bool::True)
Variable.new(name => "\@b", scope => "my", var => Array, bl…
lizmat did you intend to call the lowercase .var ? 15:42
hythm I did 15:44
lizmat: in fact I was trying to understand an issue I'm seeing when passing a shaped array to Array::Circular 15:46
the issue is it complains that the shaped array is a type object.
hythm m: use Array::Circular; my @a[1] is circular(2); # Cannot use 'does' operator on a type object Array. 15:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find Array::Circular in:
inst#/home/camelia/.raku
inst#/home/camelia/rakudo-m-inst-1/share/perl6/site
inst#/home/camelia/rakudo-m-inst-1/share/perl6/vendor
inst#/home/c…
lizmat interesting :-) 15:48
hythm: I assume the size would be the size of the shaped array, and it should only allow 1-dimensional shaped arrays, right > 15:49
?
hythm correct. the 2 is a typo, i meant 1
lizmat I guess on a shaped array, we should be able to drop the size in the trait 15:50
aka: my @a[42] is circular 15:51
hythm That would be better, since the size will be determined by the array shape anyway 16:07
lizmat yeah 16:26
but that means an entirely different logic
will need to think about that 16:27
as shifting / splicing a shaped array is impossible at the nqp level 16:33
so push would mean iterating over the array and moving up all of the values by index 16:34
which would be.... slopw
*slow
so maybe it would be better to disallow "is circular" on shaped arrays altogether 16:35
because it wouldn't bring you anything semantically, and only cost you in performance
hythm understood. but is there any explanation to the error above? or whey is it assuming the the shaped array is a type obejct inside the trait-sub? 16:40
hythm s/trait-sub/trait_mod sub/ 16:44
lizmat hythm: no idea yet 17:03
hythm Thanks lizmat, If you think this is a bug let me know and I can create an issue 17:05
lizmat creating an issue would help preventing this falling through the cracks :-)
hythm and this would go to Rakudo or Array::Circular? 17:06
lizmat actually, both 17:07
Array::Circular because it doesn''t support shaped arrays
and Rakudo because it passes a type object to the trait_mod
hythm got it, thanks
lizmat thank you!
El_Che rakudo-pkg for 2020.02 released: github.com/nxadm/rakudo-pkg/#os-repositories 17:09
sam84 commit: releases  my Real @test = 0.1, 0.2; 17:44
committable6 sam84, ¦releases (51 commits): «» 17:45
sam84 commit: HEAD  gist.githubusercontent.com/sthirie...tfile1.txt 17:59
committable6 sam84, Successfully fetched the code from the provided URL
sam84, ¦HEAD(8507178): «[0.005 0.01 0.025 0.05 0.075 0.1 0.25 0.5 0.75 1 2.5 5 7.5 10 Inf]␤»
sam84 commit:  2020.01  gist.githubusercontent.com/sthirie...tfile1.txt 18:00
committable6 sam84, Successfully fetched the code from the provided URL
sam84, ¦2020.01: «Type check failed in assignment to @!bucket-bounds; expected Real but got List ($(0.005, 0.01, 0.025,...)␤ in block <unit> at /tmp/Vibl6Ck0_Z line 6␤␤ «exit code = 1»»
sam84 commit:  releases  gist.githubusercontent.com/sthirie...tfile1.txt 18:01
committable6 sam84, Successfully fetched the code from the provided URL
committable6 sam84, gist.github.com/ad4099e4014d98d80a...c7216087db 18:01
sam84 commit:  releases  gist.githubusercontent.com/sthirie...tfile1.txt 18:11
committable6 sam84, Successfully fetched the code from the provided URL
sam84, gist.github.com/fa0a2f916022885082...9bfcd8b9b0
sam84 commit:  2020.01  gist.githubusercontent.com/sthirie...tfile1.txt 18:13
committable6 sam84, Successfully fetched the code from the provided URL
sam84, ¦2020.01: «Type check failed in assignment to @!bucket-bounds; expected Real but got List ($(0.005, 0.01, 0.025,...)␤ in block <unit> at /tmp/avchvWE5my line 6␤␤ «exit code = 1»»
sam84 commit: 2020.01 gist.githubusercontent.com/sthirie...tfile1.txt 18:18
committable6 sam84, Successfully fetched the code from the provided URL
sam84, ¦2020.01: «[0.1 0.2]␤[0.005 0.01 0.025 0.05 0.075 0.1 0.25 0.5 0.75 1 2.5 5 7.5 10 Inf]␤»
guifa2 El_Che: 2020.02 or 2021.02 ? 18:46
tellable6 hey guifa2, you have a message: gist.github.com/796981bd2e5731d407...24b277bce2
SmokeMachine lizmat: I think I should have written a better read me before twitting about that… 18:52
lizmat yeah, better readme's help :-) 18:53
El_Che guifa2: good catch :) 18:54
guifa2 El_Che: the first updates from the Perl steering committee kept referring to 2020. Like the first three or four them. I was like, great start guys, still in 2020 ;-) 18:55
lizmat
.oO( that's all easy, in 2020 hindsight :-)
SmokeMachine lizmat: but the idea there was to be an example of how to use Red… 18:56
lizmat I understand the idea, but I didn't see it in the link given: as a noob, all I saw was a repo of someone with a README that has a usage: in it 18:57
no goal of the repo, no clear examples at first sight
El_Che guifa2: upated the tag :)
guifa2 Is there a way to get the version of a package? Or does that need to be provided manually by it (via a .version or similar method) 19:00
SmokeMachine lizmat: yes, makes sense.. I thought the usage would be enough to show someone where to look on the code…
JJAtria[m] guifa: I think .^ver should work 21:29
docs.raku.org/type/Metamodel::Vers...method_ver
guifa2 ^
raiph cf stackoverflow.com/questions/662860...rom-c-code 22:05
tellable6 hey raiph, you have a message: gist.github.com/2df2b610d31468f149...0f7bc06b87
raiph Hi all 22:07
raiph HåkonHægland's answer stackoverflow.com/a/66289340/1077672 shows Raku code being called from C. 22:08
It seems to work.
Yet after pointing that out to xentrunix, the poster of the Q, they have written "I made a simple question, "Is it possible to call Raku from C?" ... it seems it's not possible" 22:10
raiph I have a couple questions related to this and am hoping folk here can comment. 22:12
raiph (Perhaps a link to the questions I'm posing here could be added to the next Rakudo News?) 22:14
(And if there's substantive discussion related to them then a link to those could be added to the News after that?) 22:15
Q1. Are there any circumstances in which one can reliably call Raku code from C code?
In other words, does HåkonHægland's answer, which *appears* to work, actually work? 22:16
Q2. The accepted answer (by JJ) says "it's not possible". Doesn't that contradict HåkonHægland's answer? 22:20
Preamble to Q3: 22:21
zentrunix's question isn't complicated, but neither is their "simple question" as simple as they make it out to be. 22:22
raiph Their question is about asynchronous calling of Raku code from multi-threaded C code. 22:25
Q3. Is their a reliable way to asynchronously call Raku code from multi-threaded C code? 22:26
Q4. Would jnthn's oo::monitors or oo::actors modules be relevant to this?
MasterDuke i think you should ping nine (the author of inline::perl6) with these questions 22:28
raiph MasterDuke: thx :) 23:05
.ask nine MasterDuke suggested I ask you colabti.org/irclogger/irclogger_lo...02-21#l329 23:08
tellable6 raiph, I'll pass your message to nine
leont It sounds like the kind of thing that requires deep moarvm knowledge 23:09
raiph nine: tia for any comments
raiph leont: Perhaps not for my Q1? 23:12
raiph And perhaps not for Q4? 23:14
SmokeMachine lizmat: I know it's still far from good, but is it any better? github.com/FCO/BlogSchema 23:19
lizmat a bit better, but it doesn't tell what BlogSchema actually *is* 23:20
"It uses a few models to describe a DB schema for a blog." is that what it is?
SmokeMachine lizmat: good idea! 23:21
SmokeMachine lizmat: better now? 23:32
lizmat: github.com/FCO/BlogSchema 23:33
lizmat looks 23:40
s/It do not serves/It does not serve/
s/It's only/It only creates the database schema and provides introspection into the database/ ? 23:42
raiph SmokeMachine: s/throw/through/g 23:46
SmokeMachine: But now I know what it is. :) 23:47
SmokeMachine fixed! thanks! 23:48
raiph: that's too hard to me: throw/θrəʊ/; through/θruː/ 23:50
SmokeMachine I'll still, someday, learn how to speak english! :) 23:51
raiph We pronounce it thru
While I was in the US I often spelled it that way too 23:52
ooh, through rhymes with too too
SmokeMachine lizmat, raiph: do you guys think there are more stuff I should add? 23:53
raiph throw rhymes with toe or so
SmokeMachine: I think it's good to go
i'm in a poetic mood, ya know? 23:54
SmokeMachine raiph: yes, u: and əʊ... for me u: and ʊ sounds very near...
raiph and the strongest influence on learning words is sounding them out 23:55
SmokeMachine (I really like IPA (the phonetic alphabet and the beer)... it really helps me)
raiph ha! great combo!
SmokeMachine raiph: tophonetics.com 23:57
^^ helps me a lot