🦋 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
Set by lizmat on 22 May 2021.
00:04 reportable6 left 00:05 robinsmidsrod left 00:06 robinsmidsrod joined 00:07 unspammable6 sets mode: +v robinsmidsrod, reportable6 joined 00:50 berber44 joined, unspammable6 sets mode: +v berber44
Xliff Sometimes when I cast a CStruct to a CPointer, I get "This REPR cannot change type" (which makes no sense, this has to exist for NativeCall to even work!) -- is there a workaround? 00:56
^^ jnthn ugexe vrurg
00:57 Guest1724 joined 00:58 jraspass joined 01:01 berber44 left, Guest1724 left 01:07 LizBot joined
raydiak maybe I'm confused, but wouldn't you cast to Pointer, not CPointer? 01:18
m: use NativeCall; class C is repr<CStruct> { has uint8 $.a; }; say nativecast Pointer, C.new 01:20
camelia NativeCall::Types::Pointer<0x48dd8d0>
01:21 |Sno| joined, kvw_5 joined
raydiak if I am confused, maybe you could show us a short example? 01:21
01:22 unspammable6 sets mode: +v |Sno|, unspammable6 sets mode: +v kvw_5 01:23 [Sno] left 01:25 kvw_5_ left
Xliff raydiak: Yes. And for some reasons, if I do exactly what you did, I will get this message. 01:29
It might have to do with the fact that the Struct in question came from C, not Raku.
raydiak I don't think coming from C should cause it, but I could be wrong. without an example to analyze and play with, we can only blindly speculate 01:33
01:38 dcx is now known as lambdacx 01:39 lambdacx is now known as dcx
Xliff radiak: The only example I can give you is a script written off of one of my projects. 01:47
And I ahve yet to add that to Git 01:48
01:53 SmokeMachine left, SmokeMachine joined
raydiak the reasons I keep suggesting that you reduce your problem to a short example are: (A) you're much more likely to get help because it makes it easier to help you, (B) often in the process of cutting your big project down to a small example, you'll zero in on the problem yourself through bisection, and (C) if it's hard to reduce, it points to places where you ought to have cleaner separation between the 01:54
different parts of your project
02:03 Manifest0 left
raydiak either way, hopefully someone with more nativecall experience will chime in here eventually and have a guess as to what you're doing wrong :) 02:03
02:05 Manifest0 joined 02:06 unspammable6 sets mode: +v Manifest0
raydiak fwiw, I tried casting a CStruct returned from a native function to a Pointer and it worked as expected: gist.github.com/raydiak/1268d5e52e...17d23d37ff 02:44
02:53 coverable6 left, linkable6 left, sourceable6 left, nativecallable6 left, notable6 left, quotable6 left, committable6 left, releasable6 left, reportable6 left, bloatable6 left 02:55 bloatable6 joined, quotable6 joined, notable6 joined 02:56 linkable6 joined, sourceable6 joined, patterner joined, releasable6 joined, nativecallable6 joined, coverable6 joined 02:57 committable6 joined, reportable6 joined
tonyo Xliff: is your C returning a pointer or a struct? 03:01
03:32 BuildTheRobots left 03:36 BuildTheRobots joined, unspammable6 sets mode: +v BuildTheRobots
moon-child is there any way to dynamically load native symbols? Or do I need to go through dlsym&co? 03:53
03:57 linkable6 left, linkable6 joined
moon-child m: constant T = :(Int) 04:11
camelia ===SORRY!===
QAST::Block with cuid 1 has not appeared
moon-child ^^ what does that mean?
04:14 mightypork left, mightypork joined 04:15 unspammable6 sets mode: +v mightypork
summerisle moon-child: regarding the dynamic loading of symbols, i believe it is possible - you will probably need to examine the internals of NativeCall though 04:32
kybr does Raku have a built-in regex for Rat-like things? e.g., 1.2 04:39
04:42 jmcgnh joined 05:01 rindolf left
Xliff ftonyo: Pointer to a Struct 05:16
^^tonyo
05:42 coverable6 left, linkable6 left, releasable6 left, committable6 left, committable6 joined 05:44 linkable6 joined, releasable6 joined 05:45 coverable6 joined
MasterDuke kybr: i don't think so, but moritz would be a good person to ask 05:50
moon-child is it possible to export an anonymous enum? 05:51
05:58 frost-lab joined, frost joined, unspammable6 sets mode: +v frost-lab 06:04 reportable6 left 06:06 reportable6 joined 06:07 guifa joined
guifa moritz: I meant in the, e.g. EXPORTHOW. Or did it get absorbed into the main grammar? 06:08
06:14 Woodi joined 06:43 stux|RC-only left 06:44 sftp left 06:46 sftp joined, unspammable6 sets mode: +v sftp 06:57 stux|RC-only joined 06:58 unspammable6 sets mode: +v stux|RC-only 07:14 committable6 left, notable6 left, sourceable6 left, nativecallable6 left, releasable6 left, quotable6 left, coverable6 left, linkable6 left, bloatable6 left, reportable6 left, linkable6 joined, notable6 joined, quotable6 joined 07:15 sourceable6 joined, releasable6 joined 07:16 committable6 joined, nativecallable6 joined, coverable6 joined, bloatable6 joined 07:17 reportable6 joined 07:27 asymptotically joined, unspammable6 sets mode: +v asymptotically 07:34 simcop2387 left 07:40 stux|RC left
moritz I have no idea if/how one can use elements of the main grammar in your own grammars :( 07:49
07:58 stux|RC joined 07:59 unspammable6 sets mode: +v stux|RC
Geth doc: 6b5db81263 | (JJ Merelo)++ | doc/Language/101-basics.pod6
Clarifies example, closes #3887
08:15
08:17 linkable6 left, linkable6 joined 08:24 wamba joined 08:25 unspammable6 sets mode: +v wamba 08:56 bloatable6 left, nativecallable6 left, committable6 left, quotable6 left, guifa left, patterner left, sarna left, linkable6 left, SmokeMachine left, LizBot left, gordonfish left, camelia left, coverable6 left, releasable6 left, kybr left, ecocode_ left, DarthGandalf left, a3r0_ left, Juerd left, kawaii_ left, Woodi left, reportable6 left, sourceable6 left, notable6 left, juanfra left, El_Che left, jmcgnh left, ecocode- left, [Coke] left, dogbert2 left, frost left, MasterDuke left, PotatoGim left, moon-child left, Ekho left, tejr left, ggoebel_ left, Altreus_ left, b4283__ left, polettix left, vrurg left, broquaint left, dcx left, lucs left, elcaro left, sivoais left, corwin left, ugexe left, jraspass left, gugod left, samebchase left, sjn left, pounce left, BinGOs left, jjatria left, dpk left, tyil left, moritz left 09:03 eiro joined 09:04 unspammable6 sets mode: +v eiro 09:05 eiro left 09:13 ilogger2_ left 09:14 ilogger2 joined 09:19 linkable6 joined, reportable6 joined, bloatable6 joined, coverable6 joined, nativecallable6 joined, committable6 joined, releasable6 joined, sourceable6 joined, quotable6 joined, notable6 joined, Woodi joined, guifa joined, frost joined, jmcgnh joined, patterner joined, SmokeMachine joined, LizBot joined, jraspass joined, lucs joined, juanfra joined, MasterDuke joined, sarna joined, gordonfish joined, camelia joined, El_Che joined, kybr joined, ecocode_ joined, DarthGandalf joined, a3r0_ joined, Juerd joined, kawaii_ joined, corwin joined, ecocode- joined, [Coke] joined, dogbert2 joined, dcx joined, moon-child joined, Ekho joined, tejr joined, ggoebel_ joined, Altreus_ joined, b4283__ joined, polettix joined, broquaint joined, BinGOs joined, sivoais joined, vrurg joined, PotatoGim joined, elcaro joined, gugod joined, dpk joined, ugexe joined, samebchase joined, sjn joined, pounce joined, jjatria joined, tyil joined, moritz joined 09:48 pecastro joined 09:49 unspammable6 sets mode: +v pecastro 10:19 coverable6 left, linkable6 left, committable6 left, releasable6 left, bloatable6 left, quotable6 left, nativecallable6 left 10:20 nativecallable6 joined, quotable6 joined, bloatable6 joined 10:22 linkable6 joined, releasable6 joined, coverable6 joined, committable6 joined 10:37 ChanServ sets mode: +o lizmat
lizmat 🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku) 10:38
ChanServ sets mode: -o lizmat 10:45 dogbert11 joined
Geth doc: 92b52bb418 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/101-basics.pod6
Update 101-basics.pod6

Added missing noun, removed unnecssary spaces around the em dash.
10:46
10:46 dogbert17 joined
10:48 dogbert2 left 10:49 dogbert2 joined 10:50 dogbert11 left 10:51 dogbert11 joined 10:53 dogbert17 left 10:54 dogbert2 left 11:04 dogbert11 left
El_Che once the channel has moved, a bot like the one in perl is handy: it tells people that joined that the channel moved 11:13
11:16 gfldex joined 11:17 gfldex left 11:24 gfldex joined 11:25 gfldex left 11:26 gfldex joined
gfldex Is this where the cool kids hang out now? 11:26
tyil correct 11:27
11:30 andinus joined 11:31 unspammable6 sets mode: +v andinus 11:32 DarthGandalf left 11:35 andinus left, DarthGandalf joined 11:36 ggoebel_ left 11:42 Some-body_ joined, DarthGandalf left 11:43 Some-body_ is now known as DarthGandalf 11:50 DarthGandalf joined, Some-body_ joined, unspammable6 sets mode: +v DarthGandalf, DarthGandalf left 11:51 Some-body_ is now known as DarthGandalf
tbrowder thnx to all who made this move to new chat place painless! 11:56
11:58 nine joined, markmarkmark joined 11:59 nine joined, nine left, frost left, tbrowder joined 12:00 unspammable6 sets mode: +v nine
tbrowder whoa, time travel 12:00
12:00 nine left, tom___ joined 12:04 reportable6 left 12:05 reportable6 joined 12:06 nine joined 12:07 unspammable6 sets mode: +v nine 12:08 leah2 joined 12:11 mowcat joined, andinus joined 12:12 unspammable6 sets mode: +v mowcat 12:14 andinus left 12:20 andinus joined
andinus m: say 0; 12:22
camelia 0
nine Apparently camelia is better at staying connected to the channel than I am :D 12:33
12:38 asymptotically joined, unspammable6 sets mode: +v asymptotically 13:11 DarthGandalf left, DarthGandalf joined, unspammable6 sets mode: +v DarthGandalf 13:20 linkable6 left 13:23 linkable6 joined 13:25 gordonfish left 13:30 SmokeMachine left 13:31 SmokeMachine joined 13:43 dogbert17 joined 14:04 cooper joined 15:02 domidumont joined 15:03 unspammable6 sets mode: +v domidumont 15:04 quotable6 left, bloatable6 left, committable6 left, coverable6 left, linkable6 left, sourceable6 left, reportable6 left, releasable6 left, notable6 left, nativecallable6 left 15:05 sourceable6 joined, committable6 joined, bloatable6 joined, releasable6 joined, nativecallable6 joined, quotable6 joined, linkable6 joined, reportable6 joined 15:06 notable6 joined 15:07 coverable6 joined 15:12 jess left 15:13 jess joined 15:21 ensamvarg3 joined, ensamvarg3 left, solitario3 joined 15:22 unspammable6 sets mode: +v solitario3 15:40 Kaiepi joined
tonyo Xliff: if you want to turn a pointer to a struct you need to deref it (using a cast, not another pointer) 15:47
15:54 skaji joined 15:56 SqrtNegInf joined 16:06 solitario3 left, xinming joined 16:07 unspammable6 sets mode: +v xinming 16:11 solitario3 joined 16:12 unspammable6 sets mode: +v solitario3 16:14 wamba joined 16:15 unspammable6 sets mode: +v wamba 16:17 swaggboi joined, unspammable6 sets mode: +v swaggboi 16:20 gordonfish joined, unspammable6 sets mode: +v gordonfish 16:21 gordonfish joined 16:31 sena_kun joined, unspammable6 sets mode: +v sena_kun 16:39 Xliff joined
Xliff tonyo: NativeCall handles that automatically when dealing with C-calls. I don't think that's the issue. Working on a smaller (hah!) example. Thanks the thought. 16:41
16:50 mowcat left
tonyo nativecall does not autocast pointers to structs 16:50
or vice versa 16:51
seems you already know what the issue is, though. 16:53
Grinnz just fyi, depending on how much trust you have for the new freenode staff, you may want to re-evaluate *!*@freenode/staff/* having access flags on this channel 16:54
and you can talk to daemon if you want the bot from #perl to actively inform people as they join 16:56
cheers and good luck
17:10 pecastro left 17:14 pecastro joined 17:15 unspammable6 sets mode: +v pecastro 17:36 samcv joined 18:05 reportable6 left, reportable6 joined 18:23 aborazmeh joined 18:24 unspammable6 sets mode: +v aborazmeh, SqrtNegInf left 18:26 ggoebel_ joined 18:27 SqrtNegInf joined 18:29 domidumont left, SqrtNegInf left 18:30 SqrtNegInf joined 18:44 Sgeo joined 18:45 unspammable6 sets mode: +v Sgeo 18:47 aborazmeh left 19:10 asymptotically left, Black_Ribbon joined 19:11 dg left, unspammable6 sets mode: +v Black_Ribbon 19:17 idiosyncrat2 joined 19:18 idiosyncrat2 left
raydiak now that we're advertising the move in our topics on freenode...when is Geth getting moved over? and should we merge github.com/Raku/raku.org/pull/164 yet? 19:18
19:18 idiosyncrat joined 19:32 stoned75 joined, unspammable6 sets mode: +v stoned75 19:34 mowcat joined 19:35 unspammable6 sets mode: +v mowcat 19:39 shadowpaste left 19:48 Henry151 joined 19:49 unspammable6 sets mode: +v Henry151 19:50 mowcat left 19:59 shadowpaste joined 20:00 unspammable6 sets mode: +v shadowpaste 20:06 rjbs joined
Xliff Here is a cut-down example which can be used showing some of my problems with CStructs and CUnions. First up is the "Cannot look up attributes in a EPhotoData type object, which is strange, since it is HAS scoped, which should mean it's an instance, not a type object! 20:07
tio.run/##dZPdauMwEIWvraeYgi/akjVt...eLTocM@9oP
WT3@la7VwhqNYI0IikR85XEo8U2mOnQne2k5FosW6lLdrqBNAyrdLjqJ0HwGbO6K5UnYfZ9doofHHG5sF8Z990zUpw/61gcJoEI/jyBrZbuO3fwPU13F35ULG5Rk86GlTvuXlV02vU1UHqqNqBNtkcmEE8kpJM1tA7lcqTuNQrfQdW/cpLLNVlxHU9Inp6nCv/cPgP
Here is a cut-down example which can be used showing some of my problems with CStructs and CUnions. First up is the "Cannot look up attributes in a EPhotoData type object, which is strange, since it is HAS scoped, which should mean it's an instance, not a type object! 20:08
Prepare for a URL of obnoxious length.
tio.run/##dZPdauMwEIWvraeYgi/akjVt...eLTocM@9oP
WT3@la7VwhqNYI0IikR85XEo8U2mOnQne2k5FosW6lLdrqBNAyrdLjqJ0HwGbO6K5UnYfZ9doofHHG5sF8Z990zUpw/61gcJoEI/jyBrZbuO3fwPU13F35ULG5Rk86GlTvuXlV02vU1UHqqNqBNtkcmEE8kpJM1tA7lcqTuNQrfQdW/cpLLNVlxHU9Inp6nCv/cPgP
20:13 SqrtNegInf left 20:15 Altai-man_ joined, Altai-man_ left, Altai-man joined 20:22 gabiruh joined 20:23 gabiruh left, gabiruh joined 20:24 gabiruh left 20:25 gabiruh joined 20:29 gabiruh is now known as gabiruh_, gabiruh_ is now known as gabiruh 20:33 jmcgnh left, SqrtNegInf joined 20:34 gabiruh left, gabiruh joined 20:35 comatekeke joined, SqrtNegInf left, jmcgnh joined 20:36 unspammable6 sets mode: +v comatekeke 20:37 comatekeke left, SqrtNegInf joined 20:38 jmcgnh joined, unspammable6 sets mode: +v jmcgnh 20:39 SqrtNegInf left, SqrtNegInf joined 20:43 tbrowder left
raydiak I'm mildly surprised that even parses with "HAS". That's not a thing, you need "has". that service is running rakudo 2018.12 20:45
20:46 stoned75 left, tom___ left
raydiak nevermind, apparently it's...something. just something I haven't seen before and can't find in the docs 20:47
20:47 tom___ joined, tom___ left
raydiak ah, found it. my mistake. docs.rakulang.site/language/native...s_with_HAS 20:48
20:56 wamba left
raydiak Xliff: you need another proxy over data like you did with mime_type and inlined, and to run it under a modern raku instead of a 2 1/2 year old one. with the proxy it works for me on 2021.04 21:03
Xliff raydiak: Oh. You mean tio.run is using an older version? LOL! Thanks. 21:04
raydiak yes quite old. you're welcome :) 21:05
Xliff raydiak: Can you link your code? 21:07
raydiak: When you making the move to libranet?
raydiak gist.github.com/raydiak/cded4a7621...8390023ffb 21:09
I'm already there
I just copied one of your proxies, changed the names in it, and made data private. no other changes besides the indents :) 21:11
tonyo if only there was a way to shorten urls
Xliff Heee!
raydiak++
raydiak if you really want to keep using these browser things for running raku, you might try glot.io. I haven't used it much personally, but it's well-known, supposed to be stable, and has sane URLs. and looks like their raku is only 3 months old
Xliff ROFL. OK. 21:13
tonyo for one thing, that CUnion may or may not have an `inlined` variable
Xliff repl.it used to be the same, but they grew profitable and so ... 21:14
Thanks for your glot.io suggestion. I will look inti it.
raydiak sure thing, happy to help 21:15
I probably should have engaged that over here. saw it on freenode first, answered there. seems fixed by putting another Proxy over EPhotoDataInlined!data gist.github.com/raydiak/cded4a7621...8390023ffb 21:19
and running under a modern raku...tio.run is way back on 2018.12
21:19 hankache joined 22:08 hankache left 22:23 stigo joined 22:31 jcallen joined 22:44 jcallen left, jcallen joined, unspammable6 sets mode: +v jcallen 22:49 codesections joined 22:58 aborazmeh joined, unspammable6 sets mode: +v aborazmeh
Xliff nqp::mul_I($aa, $bb) -> "Arg count 2 doesn't equal required operand count 4 for op 'mul_I'" 23:03
Hunh?!
Geth doc: Util++ created pull request #3889:
Fixed ctest and aspell
23:08
23:21 pecastro left 23:26 aborazmeh left
moon-child m: my %x = %(a => <1 2 3>); .say for %x<a> 23:37
camelia (1 2 3)
moon-child ^^ why isn't the output 1␤2␤3␤ ? 23:38
m: my %x = %(a => <1 2 3>); .say for |%x<a> #this works. But why? 23:39
camelia 1
2
3
23:49 linkable6 left 23:50 linkable6 joined