🦋 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:03 kvw_5 joined 00:10 Garbanzo joined 00:12 Garbanzo left 00:16 stoned75 left 00:18 lancew joined 00:22 bigdata left 00:24 bigdata joined, lucasb left
guifa2 notagoodidea: probably TensorFlow but that project is still a ways off 00:25
bigdata Why is tensorflow the new hotness? 00:26
00:33 notagoodidea left 00:35 pecastro left
guifa2 As with many things, massive support from a massive company probably lol 00:55
01:02 Garbanzo joined 01:17 thundergnat left 01:32 tejr joined 01:44 jmchael left 01:50 parabolize left 01:51 parabolize joined
Xliff Does tensorflow have a C API? 01:53
Answer: yes... it does
guifa2 Yeah, and they recommend linking to that for any new bindings from what I cna see 02:02
I probably won't mess with it until after next summer — COVID put a stop to my archive visits, so gigantic pause on my ground truth data collection
Xliff guifa: Wanna collab on a Raku binding? 02:03
guifa2: Also... did you get a chance to look up that slang?
guifa2 Xliff not yet, sorry, I got massively distracted haha. About to eat dinner, and then I'll look at it 02:04
But always up for collaboration. 02:05
Xliff guifa2: LOL!
guifa2: OK. Well, let me know. I've done quite a few of these.
(language bindings)
Unfortunately, none I've released since I don't think default zef gives enough user feedback 02:06
Even with the new parallel precompiling, it will take a LONG time compared to most modules in the ecosystem.
BTW - Does anyone know of a good geo visualization tool for jupyter notebooks? 02:07
I'd like to be able to port one of the Python ones to Raku
guifa2 FWIW, when I run CLDR's preprocessor, it takes about 4 hours
And that's with me running it in four pieces, so really it's about a 16 hour process
Xliff Things like making decent heat maps and scatter plots on a map. 02:08
guifa2 (it's almost 100% because of the glacially slow XML, as opposed to Lib::XML module, that I used, though)
I'd love to get some good visualization libraries. Especially with a very extensive PDF module 02:09
(dwarren has been extremely productive on the latter)
melezhik .tel JRaspass I wonder how long does it take for raku.land to index a new version of a module, Sparky new version 0.30.0 is already seen on modules.raku.org ... 02:35
.tell JRaspass I wonder how long does it take for raku.land to index a new version of a module, Sparky new version 0.30.0 is already seen on modules.raku.org ...
tellable6 melezhik, I'll pass your message to JRaspass
JRaspass it takes me to run make ingest, i'm working on gitlab ci to run it periodically so the logs would be public 02:36
hah nice graphic, i shall have to have a think about the css - raku.land/cpan:MELEZHIK/Sparky 02:38
02:43 kvw_5_ joined 02:46 kvw_5 left
melezhik JRaspass, thanks. you can take a look at bulma css framework, it's used in sparky ... 02:48
JRaspass its okay, i think i have a fix now, pushing
melezhik JRaspass mardown parser on raku.land is really nice ! 02:49
JRaspass that's all ruby :-P
commonmarker and rouge 02:50
melezhik oh, oh , I did not hear that :') and won't tell any one ...
JRaspass need to work out a csp policy since this is UG content, I wonder if anyone would be mad enough to embed a video in their markdown... 02:51
02:51 dataangel left
melezhik ha-ha ))) 02:52
so, you're even ready for that ? ...
JRaspass atm its the wild west, anything in the markdown is allowed, i think its sane to restrict imgs to https and disallow everything else probably 02:53
melezhik yeah ...
JRaspass anyways it should look a little better now, its still a smidge too wide on mobile though, ta for the test case 02:54
guifa2 Xliff: so first thing that gets me a bit farther is switching to term from statement_control 02:55
that was one of the biggies that was throwing me off with binex 02:56
02:59 melezhik left 03:00 melezhik joined
guifa2 Xliff: second thing, make sure that the sub that you're calling is exported into the same scope 03:01
For some weird reason, it doesn't a namespaced sub (at least, I dunno how to export those correctly), so at the end of the EXPORT sub include a Map.new: '&new-name' => &new-name; 03:03
lastly, the xpath token needs to be $<xpathS>=.+?, else you'll gobble right past the closing | :-)
03:28 melezhik left 03:37 bigdata left
Xliff Hummm... 03:38
guifa2 Once I did those changes, btw, it compiled and ran fine (with False True False as the three values) 03:42
Xliff So... term:sym?
guifa2 token term:sym<xpath> { <sym> '|' $<xpathS>=.+? '|' } 03:43
^^ what I used
Xliff Cool, thanks!
guifa2 obviously, if 'I' is a valid character in the path, you'll eventually want to figure out your quoting construct 03:44
Xliff Yeah. I know.
Huh...
"Cannot find method 'has_compile_time_value' on object of type MQPMu" 03:45
guifa2 I think that was from the exported sub issue
Xliff Oh wow.
guifa2 so I changed your sub to
sub xpslang-xp (Str $a) { $a does RevAccept }
sub EXPORT() { …………… Map.new: '&xpslang-xp' => &xpslang-xp; } 03:46
and in the QAST::Op, used ':name<&xpslang-xp>,'
brilliant debugging thing I found for slangs — normal 'say' tends to bomb pretty gloriously BUT say $*ERR, "foo", does output, so you can, at the very least, figure out when an error is, even if you get a cryptic one 03:47
Xliff guifa2++
Did you do this in a repl?
guifa2 No... I inserted the stuff into my own binex file, but I can toss it in a gist for you 03:48
Xliff Still getting that error after changes.
guifa2: Please do.
guifa2 gist.github.com/alabamenhu/1b502c4...8e32e44938 03:50
Oh, I think also then $/.'make' had to change to $/.make 03:51
Xliff Still same. Weird.
guifa2 slang stuff is suuuuper finicky 03:52
Xliff Yeah. Was hoping it had gotten a little more user friendly.
guifa2 I just updated the gist 03:53
cut out all of the binex stuff
Try copying and pasting and see if it works?
Xliff ok. 03:55
Yeah. Works now. 03:56
Thanks!!
guifa2 np. It's crazy because I literally just got it to work like two days ago
but mine is complex enough I think I'll still probably wait until I RakuAST 03:57
Xliff Yeah. Same here.
I'm trying to see if I can create something for LibXML
xpath literals so that you can do $node ~~ <xpath expr>
Instead of the other way around. 03:58
guifa2 ah nice
That should be fairly simple then
binex is already working just fine for me — but allowing someone to switch into a Raku block and interpolating variables is less than perfect because I can't actually compile the blocks except via EVAL at runtime, which doesn't run in the right context then. 04:00
Xliff Yeah. RakuAST for sure, then. 04:02
Wonder how much jnthn++ has left to do?
guifa2 Not sure. I know before he took a break he was estimating finishing it around now, so maybe summer? 04:03
I wish I knew more of what's left to be done and I'd dive in to help
ugh I dunno how much detail to go into for my FOSDEM talk. What are the things folks consider important in a high quality module with respect to how an end user uses them? 04:14
04:17 BenGoldberg left, Ben_Goldberg joined, Ben_Goldberg is now known as BenGoldberg 04:20 __jrjsmrtn__ joined 04:21 _jrjsmrtn left 04:30 Black_Ribbon joined
Xliff guifa2: Hmmm,.... 04:35
guifa2: Intuitiveness (Ease of use). Good documentation. Code Hygiene?
guifa2 Intuitiveness is what I'm really looking at 04:45
basically, how do you bend Raku (from a module developer side of things) to do amazing things that feel virtually built in 04:46
04:47 sno joined
guifa2 a few of the initial things (before the how-to part) is optional parentheses so that subs, methods, and control statements can masquarade as each other fairly easily 04:47
and the fact that simple blocks are objects, you can quickly make, e.g. your own loop statement 04:48
04:49 cpage_ joined
Xliff All good things. 04:49
Another: Try to keep to the OO methodology as much as possible. This applies more to interoperability with other languages like C than anything else. 04:50
If you keep everything to objects, it will fit easily into Raku.
04:52 cpage left, cpage_ is now known as cpage
guifa2 Xliff take a look at this: 04:53
tio.run/##ZZBNasMwEIX3OsUQQrGb2CSb...KiRTOrxvEL
errr 04:54
I only half renamed to English
Xliff :)
Got an error in it.
Variable $loop-sub not declared
guifa2 tio.run/##ZZBBasMwEEX3PsUnhGI3sUk2...RcPNrBzHHw
Custom loop that exits with the number of times it was run. In vanilla Raku. 04:55
and of course, the fact that it's done with a sub and not a control statement means nothing to the end user
Xliff Yep. I like that.
elcaro guifa2: any reason for the dynamic var and custom exception? this seems to work fine 05:07
tio.run/##XY5LCoMwEIb3OcUgpSSIQTdu...IvSriGxfgB
Xliff elcaro: The point was to not need "last" but something he could define on his own. 05:10
BBL! 05:13
05:14 Xliff left 05:42 BenGoldberg left
guifa2 elcaro ^^ what Xliff said. Although also because I didn't know that end worked outside in callee scopes too ^_^ 05:48
(dynamic value was needed because of scoping with the CATCH blocks) 05:49
05:55 brtastic joined
guifa2 hmm 05:59
so apparently back in the day inline/multiline comments were going to be #[ … ] or #( … )
I wonder why they were changed to include the backtick
06:09 jmerelo joined
jmerelo releasable6: status 06:10
releasable6 jmerelo, Next release in ≈12 days and ≈12 hours. 1 blocker. Changelog for this release was not started yet
tellable6 2021-01-08T16:19:56Z #raku <[Coke]> jmerelo - good catch on your comment about the metamodel tests, it's probably a recent rakudo bug.
2021-01-08T16:36:48Z #raku <tony-o> jmerelo should be able to reset your password now
2021-01-08T22:21:39Z #raku <tony-o> jmerelo github.com/Raku/doc/pull/3771/comm...c8454bf76a
releasable6 jmerelo, Details: gist.github.com/6e310569d866068914...34f6590864
jmerelo .tell [Coke] thanks! 06:12
tellable6 jmerelo, I'll pass your message to [Coke]
jmerelo .tell tony-o thanks!
tellable6 jmerelo, I'll pass your message to tony-o
Geth doc: 70ac293f76 | (JJ Merelo)++ | 3 files
Eliminates travis, stoned++, closes #3777
06:23
linkable6 DOC#3777 [closed]: github.com/Raku/doc/issues/3777 [docs] We need to speed up tests or otherwise reduce dependence on Travis
Geth doc: 9f714bc01d | (JJ Merelo)++ | .github/workflows/test.yml
Qualify with paths
06:25
06:37 parabolize left 06:40 Sgeo left
guifa2 waves at jmerelo 06:42
06:45 Sgeo joined
jmerelo Hey, guifa2 06:47
guifa2: I need to set up github actions for the ecosystem along this week so that your module can be published.
guifa2 Was going to ask if there was anything I can do to help with getting Travis back online
Happy to donate some cash if it's something that money can fix lol 06:48
jmerelo guifa2: there's a paid plan for Travis, but it's 69$ a month and it would only cement our dependency on it 06:49
guifa2 oh yikes, they don't have anything.... I dunno....between a free and XXX price?
jmerelo guifa2: plus we kind of feel a bit ripped off. So this is kind of a blackmail.
guifa2: they had 10k free credits for OSS, and we got 20k additional. But I naïvely though that was something that would be replenished in time. It was not. 06:50
guifa2 aah
jmerelo Anyway, I think it's a good thing to overhaul CI. We were burning minutes like there's no tomorrow. Not so long ago (until I started to deploy containers, and El_che started to create packages) people were compiling Raku every single CI run 06:51
guifa2 yikes 06:52
jmerelo That made no sense.
That's still done in Travis in nqp, btw. And possibly in the other CIs.
guifa2 I'm about to add another module to the ecosystem haha but I'll hold off until you get something set up 06:58
jmerelo guifa2: thanks :-)
guifa2: Remember you need to have your video for FOSDEM ready soonish 06:59
guifa2 Yeah been working on it
guifa2 points to irclog where he was talking to Xliff about it :-)
jmerelo guifa2: :-) great.
07:25 ufobat_ joined 07:35 sno left 07:37 elcaro joined, rindolf joined 07:39 sno joined
guifa2 New module! 07:44
github.com/alabamenhu/IntlTokenNumber
jmerelo guifa2: cool :-) 07:45
guifa2 (well, only semi new, it was hiding away in Intl::CLDR for a while, but now it's independent and retooled to work with the newest Intl::CLDR)
07:48 abraxxa1 joined
jmerelo guifa2: cool anyway 07:48
07:52 abraxxa1 left 07:53 abraxxa1 joined 07:58 domidumont joined 07:59 stoned75 joined 08:01 guifa2 left 08:02 guifa2 joined 08:09 aborazmeh joined, aborazmeh left, aborazmeh joined 08:12 Manifest0 left 08:14 mark[m]2 left 08:16 guifa2 left 08:21 cpan-raku left, Manifest0 joined, cpan-raku joined, cpan-raku left, cpan-raku joined 08:23 Sgeo left 08:33 BenGoldberg joined 08:51 pecastro joined, aborazmeh left 08:56 dakkar joined 09:06 Altai-man joined 09:10 sjm_uk joined 09:21 notagoodidea joined 09:22 dogbert11 joined 09:37 cgfbee left 09:43 thdrmz left 09:44 cgfbee joined
notagoodidea I have been looking at MAIN.pm6 in the rakudo source (core.c) and I am not sure to understand the why of this part of the regex matching for named arguments `([<-[0..9\.]> .*)` (github.com/rakudo/rakudo/blob/65a5...n.pm6#L96) 09:49
hum misquoted the part : `(<-[0..9\.]> .*) I understand the catch all part but what about the <-[0..9\.]> ? 09:50
09:50 jmchael joined 09:53 guifa2 joined 09:54 guifa2 left
notandinus notagoodidea: i think '-' in <-[]> negates things in '[]' 09:54
tellable6 2021-01-08T22:44:02Z #raku <notagoodidea> notandinus another way to call USAGE with the empty parameters is to use proto in this fashion `proto MAIN (|) {unless so @*ARGS {say $*USAGE; exit;}; {*}}`
notandinus not sure, letme check
09:55 cgfbee left 09:57 cgfbee joined
MasterDuke yeah 09:57
notandinus docs.raku.org/language/regexes#ind...and_ranges
notagoodidea: i see, thanks 09:58
10:04 wamba joined
notagoodidea notandinus: oh I see. 10:13
So it matches on everything but the first character must not be a number or a dot? 10:14
notandinus notagoodidea: yeah, that's what i understand 10:17
note that i don't know much about raku or regex things, might be wrong
m: say "hi" ~~ /<-[0..9]\.> .*/ 10:18
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in metachar:sym<assert>; couldn't find final '>' (corresponding starter was at line 1)
at <tmp>:1
------> 3say "hi" ~~ /<-[0..9]7⏏5\.> .*/
expecting any of:
notagoodidea m: say "hi" ~~ / <-[0..9\.]> .*/
camelia 「hi」
notagoodidea m: say "3" ~~ / <-[0..9\.]> .*/
camelia Nil
notagoodidea m: say "3=foo" ~~ / <-[0..9\.]> .*/ 10:19
camelia 「=foo」
notandinus m: say "4hi" ~~ / <-[0..9\.]> .*/
camelia 「hi」
10:20 sena_kun joined
notagoodidea m: say "--3=foo" ~~ /("-"|"--"|":") ("/"?) (<-[0..9\.]> .*)/ 10:20
camelia 「--3=foo」
0 => 「-」
1 => 「」
2 => 「-3=foo」
notagoodidea m: say "-3=foo" ~~ /("-"|"--"|":") ("/"?) (<-[0..9\.]> .*)/ 10:21
camelia Nil
notagoodidea m: say "--.=foo" ~~ /("-"|"--"|":") ("/"?) (<-[0..9\.]> .*)/
camelia 「--.=foo」
0 => 「-」
1 => 「」
2 => 「-.=foo」
10:22 Altai-man left 10:30 sno left
notandinus how do i install rakudoc? 'zef install rakudoc' says no matching candidate found 10:38
moritz there's a p6doc 10:43
dunno if that's the current one, or a very old, out-of-date copy :-)
notandinus i see , it points to github.com/Raku/doc, must be the current one 10:48
docs.raku.org/programs/02-reading-docs says to 'zef install rakudoc'
CIAvash It's on github, but doesn't appear on modules.raku.org: github.com/Raku/rakudoc 10:56
jmerelo notandinus: p6doc is simply the documentation repo, which can't be installed anyway. rakudoc is not in the ecosystem, pending (for a year and a half) revision. For the time being, if you want the documentation you'd better use it online 10:58
notandinus: and we should probably eliminate that.
10:59 jmerelo left 11:01 sftp joined 11:28 sno joined 11:41 guifa2 joined 11:42 guifa2 left 11:46 PimDanie1 joined
PimDanie1 hi everybody, 11:47
I'm searching an example to pass ioctl call with Raku.
11:55 rindolf left
dakkar ioctl is a pain… you can't (easily) get, from Raku, at the macros that make it barely-manageable in C 11:56
also memory management is weird and specific to each call
PimDanie1 Hi dakkar.
Thank you! 11:57
dakkar sorry I can't actually be helpful, though
PimDanie1 I'm French, beware that i can make sense confusion.
dakkar ok, simpler-english-version
calling ioctl is complicated 11:58
it's complicated in C as well
but C preprocessor macros mask some of that complication
in Raku, you can't easily access those macros
PimDanie1 Do you mean that i must call C routine compile in a C library?
dakkar well, ioctl is a system call 11:59
PimDanie1 Do you mean it would be easier that way.
dakkar you run system calls usually via C functions in libc
PimDanie1 Yes i agree.
hum:
What i attempt to do: 12:00
dakkar if you can write C functions that call the ioctl in the way you need, compile them into a dynamic library, and then NativeCall your functions, you may have simpler problems
PimDanie1 ok i saw example and i can do that.
I learned C language before. 12:01
I'm just trying to pass ioctl for console control.
For now i just make tests.
I thing the best would be to reduce primitive action on C side. For just my needs. 12:02
primitive actions
dakkar yes 12:03
PimDanie1 The problem beeing some data will be retured packed.
and i saw that unpack is experimental in Raku! Yes/No?
dakkar I suggest you copy the data from the ugly structures that ioctl uses, into sensible structures you define, in your C code 12:04
then you can use NativeCall to map those structs to raku classes
PimDanie1 Ok. I need to put example but my consoles are in desordered. 12:05
#!/usr/local/bin/perl6 12:07
my $struct;
constant TIOCGWINSZ = 0x5413;
ioctl stdout,TIOCGWINSZ, $struct;
this call should return the lines and cols. 12:08
ho ok i understand.
I think c function in this case should return one or 2 integers. 12:09
Not sure i can return 2 integers in C.
I think i'll find a solution. 12:10
Thank you very much dakkar.
dakkar C can only return 1 simple value, you need to either receive a pointer to a struct and fill it, or allocate the struct and return a pointer to it
(and then the caller has to `free` the struct, NativeCall may have some helpers for that) 12:11
PimDanie1 Ok so in this case use termio struct probably. 12:12
why should'n i declare constant struct on C side? instead of alloc/free? 12:13
dakkar because that's global shared mutable state
and you don't want that
raku is multi-threaded: what happens if two thread call your function at the same time? 12:14
PimDanie1 You can see that i think!
...
12:15 notagoodidea left
PimDanie1 ok : i think i understand. 12:15
dakkar ooh, fun, Gentoo Linux has /usr/lib64/libc.so as a text file 12:17
anyway, lunchtime 12:18
PimDanie1 It depends where you leave! Bon appétit!
12:19 PimDanie1 left 12:22 thdrmz joined 12:28 rindolf joined 13:06 Black_Ribbon left 13:15 xelxebar_ joined 13:16 xelxebar left 13:21 notagoodidea joined 13:56 PimDanie1 joined 14:00 JRaspass left 14:01 PimDanie1 left 14:02 tech_hutch joined 14:19 Altai-man joined 14:21 sena_kun left 14:22 lucasb joined 14:44 parabolize joined 14:50 guifa2 joined
xinming_ when we do url encoding, I saw that & will become %26 Is there a perl6 module for this purpose? 14:56
guifa2 github.com/raku-community-modules/URI-Encode 14:59
15:00 Xliff joined
Xliff \o 15:00
15:00 Sgeo joined
Xliff How can I protect routes in Cro by requiring a specific header? 15:01
sena_kun jnthn:
15:06 Xliff left
notagoodidea is it a way to define a part of a signature of a func outside of the func definition? 15:07
Geth doc: uzluisf++ created pull request #3778:
Add clarification about private methods
15:13
guifa2 notagoodidea: not at the moment. Signature literals is fairly recent, but there's no way to link it to a codeblock 15:14
notagoodidea guifa2: yeah, I am slowly realizing that by getting error throws at me by the REPL :) 15:15
I was hoping to create a partialy signature with a set of flags and add to some of multi MAIN when needed instead of rewriting everything everytime. 15:17
I could put it in the proto and every multi will get access to them but you have not the granularity to say which flag apply for each multi as far as I know. 15:18
15:19 asymptotically left, asymptotically joined
guifa2 Dynamic variables can be your friend 15:23
Actually 15:24
15:24 Xliff joined
guifa2 tio.run/##K0gtyjH7/7@gKL8kX6G4NEkh...zjZIj0//8A 15:28
how is that?
notagoodidea Interessing! 15:31
15:31 JRaspass joined
notagoodidea I hope it will possible in the future to `my $sub-sig = :(Bool :$foo); sub f($lala, >$sub-sig)` but maybe ... I can do something similar with enum, slurpy flag and where clause.. 15:37
15:43 PimDaniel joined
notagoodidea With 2020.12 and the REPL acts a bit weird. 15:43
PimDaniel Haa bon!
Hello. 15:44
notagoodidea Hello
PimDaniel Is there an irc channel where i can ask newbie questions on Raku?
15:45 aborazmeh joined, aborazmeh left, aborazmeh joined
perry Here! 15:45
notagoodidea, yeah I've heard that too regarding the REPL.
PimDaniel Ok thank's.
my name is Jean-Yves.
I've learned Perl5 and earn my live with it. 15:46
I love Raku, especially for classes.
but i discover it. 15:47
I need to use NativeCall (s).
notagoodidea in order `> enum Flag (foo => "bar"); > sub f($a){}; > f(a => 1);" and after getting the error about the wrong function call. The next entry will be always get a error "===SORRY!=== Error While Compiling: Redeclaration fo symbol 'Flag'."
PimDaniel docs.raku.org/language/nativecall 15:48
notagoodidea Because it try to rerun all the line kept in the context, it makes the REPL unusable for the session. `exit` can not be used and only Ctrl+c let you get out of the REPL.
PimDaniel At chapter : Specifying the native representation 15:50
guifa2 notagoodidea: weird. Although I don't use REPL too much, really just for interactive browsing of CLDR these days 15:51
PimDaniel There is an example of a native call of clock_gettime C function.
notagoodidea guifa2: I think it is an extreme case of this issue github.com/rakudo/rakudo/issues/4160 15:52
PimDaniel What i do not understand is this line:
sub clock_gettime(uint32 $clock-id, timespec $tspec --> uint32) is native { * };
jdv79 PimDaniel: what exactly is the problem? 15:53
PimDaniel The second parameter seams to be a pointer but :
what means this notation: 15:54
timespec $tspec --> uint32
????
and what is $tspec variable : i don't see it in any other place in the given code.
jdv79 its right above, no? 15:55
its a cstruct thingee
PimDaniel why --> unin32 and not --> int8 15:56
What does it rely to? 15:57
guifa2 It depends on what the C function returns
'--> uint32' means "this function returns a uint32"
PimDaniel Does --> in a function is general raku for what it returns? 15:59
guifa2 Correct
jdv79 got me. maybe the example is a bit inexact there:)
perry PimDaniel, do you mean why uint32 instead of an int8 as well?
PimDaniel Yes. 16:00
MasterDuke yes. you can also do `sub foo($a) returns uint32 { ... }`, but there are some limitations to that syntax, so the `-->` version is recommended
perry PimDaniel: uint32 basically just means an unsigned (always positive) integer with 32 bits of precision
PimDaniel Right! 16:01
perry So an integer from zero to 4,294,967,296
MasterDuke at least on my system clock_gettime seems to return a C int, so `--> int32` would be more correct. not sure why it's uint
jdv79 its in the docs - docs.raku.org/type/Signature#index-entry---%3E
PimDaniel but this can in somme circonstances represent a pointer!!
MasterDuke might just be a typo in the docs
PimDaniel I think the doc is ok. 16:02
perry PimDaniel, ah I see, I hadn't read the whole conversation :) 16:03
PimDaniel int clock_settime(clockid_t clk_id, const struct timespec *tp)
ok i see : but You replied to my question.
what i just wrote is the C prototype and it returns an int 16:04
Here's the goot prototype: int clock_gettime(clockid_t clk_id, struct timespec *tp);
i suppose this c is an int32 in raku. 16:05
16:05 JRaspass left
PimDaniel Ok thank you very mutch : i need to look a documentation for subs again. 16:07
*look for
guifa2 Isn't a C-int just guaranteed to be at least 16-bit (but potentially more, based on compiler/architecture, etc)?
PimDaniel Good question but what can more can less, no? 16:08
The C-int depend of your machine.
or no : your compiler.
thanks very much. I leave for now. Going to make some test and see. 16:11
16:11 PimDaniel left
xinming_ guifa2: THanks 16:20
SmokeMachine: How do we do distinct(col) for model? 16:21
16:22 wamba left
SmokeMachine xinming_: we don’t... yet... 16:24
notagoodidea lizmat: sorry for adding stuff on the issue, didn't know/see the rewind.
lizmat notagoodidea: no worries, it was just the straw that broke the camel's back :-) 16:25
SmokeMachine xinming_: I think you can Red::AST::Function for that 16:26
usercontent.irccloud-cdn.com/file/...382492.JPG 16:28
xinming_: or classify: ^^ 16:29
guifa2 lizmat: might want to mention in the weekly that ecosystem updates are temporarily paused because of Travis (jmerelo is working on an alternative now, but my most recent two modules can't get the automated testing done ATM)
xinming_ SmokeMachine: Ok, Thanks. will try 16:30
guifa2 or rather new modules, I suppose extant ones can still get updates no problem
SmokeMachine .say for Model.classify(*.col).keys
16:45 aborazmeh left 16:55 b2gills left 17:00 xelxebar_ left, xelxebar joined 17:03 melezhik joined
lizmat guifa2: if it its about ecosystem modules (ones that live in META.list in the ecosystem repo) 17:08
we could always add them manually there
guifa2: just let me know which ones :-)
17:13 b2gills joined
guifa2 lizmat: yeah, I could have manually added (heck, I have direct-commit privileges now), but I wanted to respect the testing/QA process :-) 17:14
lizmat: github.com/alabamenhu/IntlTokenNumber and github.com/alabamenhu/IntlFormatNumber 17:15
lizmat as long as the testing process is borked, we should allow for some other way
ok, will add them now
Geth ecosystem: e7437bccac | (Elizabeth Mattijsen)++ | META.list
Manually add Intl::(Format|Token)::Number

As our testing workflow is currently borked thanks to Travis bailing on open source.
17:19
guifa2 ^^^ Umm.... is that syntax (or similar) valid for importing modules? If not, I feel like it should be :-) 17:21
lizmat no, it's not :-) 17:22
17:22 tech_hutch left
guifa2 adds that to his list of 1239 things to do 17:22
Xliff Getting SEGV at... 17:24
MVM_spesh_log_invoke_target (tc=0x55555555a160, invoke_target=0x0, was_multi=0) at src/spesh/log.c:194
194 if (REPR(invoke_target)->ID == MVM_REPR_ID_MVMCode && IS_CONCRETE(invoke_target)) {
And for the life of me, I can't get it to golf... (as usual)
lizmat perhaps #moarvm folks could tell you more about that ? 17:25
also: is this on HEAD ?
Xliff HEAD as of yesterday. 17:26
lizmat today saw the merge of some memory leaks / corruption fixes in MoarVM
definitely worth a try :)
17:28 notagoodidea left 17:32 asymptotically left
Xliff lizmat++ 17:32
Thanks.
This error vexes me: "Hash keys must be concrete strings (got )" 17:33
When all keys in the hash ar strings!
17:33 asymptotically joined
lizmat well, at NQP level there can be non-concrete strings 17:34
m: my str @a; use nqp; dd nqp::isnull_s(nqp::atpos_s(@a,0))
camelia 1
lizmat this is something nwc10 on #moarvm could be interested in :-) 17:35
17:35 dakkar left
Xliff OK. This is beyond frustrating. I think I'm going to need some expert help. 17:37
I will have to write up everything in a gist.
lizmat Xliff: am afraid so :-(
17:38 melezhik left
tony-o . 17:39
tellable6 2021-01-09T00:50:56Z #raku <melezhik> tony-o I create a sparrow plugin to automate fez login, could be useful in fez automation / testing - sparrowhub.io/plugin/fez-login/0.000001
2021-01-09T01:41:14Z #raku <melezhik> tony-o this is how `fez login` automation looks like using `fez-login` sparrow plugin - 161.35.142.50/report/fez-test/203
2021-01-11T06:12:53Z #raku <jmerelo> tony-o thanks!
2021-01-11T12:35:08Z #raku-dev <lizmat> tony-o is there some writeup about fez that I can refer to in the RWN ?
tony-o lizmat: i'll get something written up about fez, currently the only thing is the proposal 17:40
lizmat tony-o: news.perlfoundation.org/post/grant..._ecosystem I presume ? 17:41
tony-o that'd be it, yea
lizmat ok, I'll refer to that, and to the README of fez itself 17:42
tony-o i was going to write up how the whole thing works tomorrow, when is the rwn out?
lizmat in about an hour :-)
tony-o that's way before tomorrow 17:43
for me, at least
lizmat no problem repeating mentioning fez, so it could be in this week *and* next week :-)
17:44 tib joined
tib . 17:44
17:50 rindolf left 17:51 rindolf joined
tony-o eggsellent 18:00
Geth ecosystem: 8eb04ce526 | (David Warring)++ | META.list
move several PDF modules to CPAN
18:08
18:18 domidumont left 18:20 sena_kun joined 18:21 Altai-man left 18:29 PimDaniel joined
PimDaniel Hi everybody. 18:29
Hi nobody. 18:30
:(
guifa2 hello
PimDaniel #!/usr/local/bin/perl6 18:31
use NativeCall;
class timespec is repr('CStruct') {
has uint32 $.tv_sec;
has long $.tv_nanosecs;
}
sub clock_gettime(uint32 $clock-id, timespec $tspec --> uint32) is native { * };
my timespec $this_time .= new;
my $result = clock_gettime( 0, $this_time);
The question is:
guifa2 PimDaniel: when pasting long bits of code, please use pastebin or github's gist or something similar
PimDaniel I know but it's borring. :(
I'm tired today, sorry! 18:32
The question is:
In this example, why can we call clock_gettime? 18:33
I linked none C library????? 18:34
are some default C function allreading accessible?
*functions 18:35
cog m: say &say.perl # how do I do the same to get the .say method ?
camelia proto sub say (|) {*}
PimDaniel Thank's in advance! 18:36
guifa2 PimDaniel: I believe that when you just say "is native" all by itself, it assumes it's a system library 18:37
tobs PimDaniel: see docs.raku.org/language/nativecall#...rd_library
guifa2 cog: peak through Rakudo source code :-) 18:38
tobs although that explanation leaves open what "the standard library" is. When you run on moarvm, I guess you can rely on the C library being loaded already and the symbol to resolve(?) 18:39
guifa2 (I'm assuming you mean you want to say the source code of say)
Subs/methods don't get source code dumps with .perl/.raku 18:40
cog guifa2, ( $test ?? $onemethod !! $anothermethod)($arg) # I want to pick the method in advance and call them like that 18:42
PimDaniel guifa2, thank you!
tobs: thank's for the link! 18:43
Does the standard lib include termios and ioctl calls? 18:44
tony-o m: sub x() { "x".say; }; sub y() { "y".say; }; (True ?? &x !! &y)(); (False ?? &x !! &y)(); # cog
camelia x
y
guifa2 sub a($x) { say 'called A with $x' }; sub b ($x) { say 'called B with $x' }; ( (True,False).pick ?? $on………
tony-o beat me to it
18:44 mowcat joined
cog I read the section Fancy method calls of S12 18:44
$obj."$methodname"(1,2,3) # use contents of $methodname as method name
I knew that already but that cheating 18:45
18:46 pecastro left
tony-o did you? 18:47
cog For situations where you already have a method located, you 18:48
can use a simple scalar variable in place of method name:
$methodobj = $foo ?? &bar !! &baz;
$obj.$methodobj(1,2,3)
Excepted I just want to locate the method ,or the dispatcher
PimDaniel Here's what i'm trying to achieve: pastebin.com/81e2Pmy4 18:49
>But is is included in standard lib?
The problem beeing that i do not wanna publish C ioctl sub : 18:51
18:52 pecastro joined
PimDaniel I'd prefer publish winsize * C function. 18:52
guifa2 you shouldn't need to declare ioctl as a sub unless you're calling it from within Raku
CIAvash cog: you want `^lookup`? 18:53
guifa2 if winsize calls ioctl, you don't need to worry about it, just declare ioctl
PimDaniel Did not see any working example.
raku complains ioctl does not exist. 18:55
Sorry i did not read you well. 18:56
guifa2: sorry i did not read you well.
In fact the problem is not this.
guifa2 if you just have "is native" then it's likely that ioctl is not in the standard library. You may need to use "is native('ioctl')". I don't have a lot of experience with NativeCall, though 18:57
cog CIAvash, I did not know it. But eventually I guess, I will need a signature as well. That's why I frowned upon using a string like $foo."bar".
I lack practice. A thorough rereading of S12 will not hurt me. 18:58
PimDaniel @guifa2 : I want to leave ioctl on C side.
And declare winsize in doku. 19:00
guifa2 cog: I don't think the string is any more or less useful than .^lookup. If anything, the string method feels more idiomatic to me because .^lookup is resorting to the HOW
tony-o cog, if you're looking at sigs use signature 19:01
m: sub x($a, :$b) { }; say &x.signature;
camelia ($a, :$b)
tony-o there's likely an introspection method for whatever you're looking for rather than reparsing 19:02
guifa2 PimDaniel. If you're not calling ioctl, then there is no reason for you to include it in your Raku code. If you get an error from running winsize about ioctl, then the problem is in the C code, not in the Raku code
PimDaniel NO NO
My C code works : i tested it!
Well i take a break : i must try. 19:03
I'll paste the code and you'll understand.
19:06 sjm_uk left
PimDaniel @guifa3 : The goal is to copy C struct winsize (termios) to class winsize is repr('CStruct') on raku side. 19:06
But i do not think i must return a pointer : i think i must have a pointer parameter to the c struct. 19:07
cog Tony-o: indeed 19:08
19:17 JRaspass joined 19:19 sena_kun left 19:25 ufobat_ left
PimDaniel @guifa2 thank's for your help, i'll come back later. 19:26
19:26 PimDaniel left 19:28 guifa2 left 19:29 sena_kun joined 19:46 jess joined 19:47 jess left, ufobat_ joined 19:48 jess joined
tyil lizmat: poke 20:07
lizmat and the first Rakudo Weekly News of 2021 hits the Net: rakudoweekly.blog/2021/01/11/2021-...new-stuff/ 20:08
20:09 wamba joined
stoned75 commit: releases my @a; @a .push: "foo"; say @a; 20:16
committable6 stoned75, ¦releases (50 commits): «[foo]␤»
20:23 melezhik joined
melezhik Sparky CI will awards your project a badge if you decide to build with it )) - github.com/melezhik/sparky#build-status cc tib 20:23
tellable6 2021-01-11T07:24:17Z #raku-dev <nine> melezhik: for now, Azure pipelines
20:27 MasterDuke left 20:32 ufobat__ joined 20:36 ufobat_ left
tony-o melezhik: digging the sparky stuff. 20:36
melezhik yeah, tony-o, do you want a badge? 161.35.142.50/badge/fez-test :] 20:37
20:44 melezhik left 20:56 rindolf left 21:03 brtastic left 21:04 notagoodidea joined
El_Che just migrated rakudo-pkg from travis.org to .com. Luckily it works for me. I was afraid I would have had to migrate to something else 21:08
(I have now some small projects on github actions, but rakudo-pkg is certainly more complicated) 21:09
21:21 stoned75 left 21:25 brtastic joined 21:52 benjif joined 21:53 Black_Ribbon joined 21:57 ufobat__ left, JRaspass left
phogg I just discovered the ==> operator today. Putting what is essentially the Unix pipe into a proper language is really nice. 22:06
22:08 stoned75 joined
Geth doc: 71d4062604 | (Stoned Elipot)++ | doc/Language/variables.pod6
Remove harmless typo
22:10
doc: f0a648d3b8 | (Stoned Elipot)++ | doc/Language/variables.pod6
Add missing comma
linkable6 Link: docs.raku.org/language/variables
notagoodidea phogg: <== works too if you to do it backward. 22:12
phogg notagoodidea: I noticed. I assume this is mostly just for symmetry, or for people who think in reverse.
notagoodidea it depends, you can the style "foo for @bar" : "foo <== @bar" 22:13
+mimick 22:14
phogg I would call that thinking in reverse!
notagoodidea I found it a nice to mimick the natural language : do that if something. 22:15
22:16 sena_kun left
notagoodidea I have to feeling that NativeCall can permit to create something similar than Clang.jl in Raku : github.com/JuliaInterop/Clang.jl 22:18
(After seeing that App::GPTrixie do not have been updated for a few years and reading floooh.github.io/2020/08/23/sokol-bindgen.html)
22:26 wamba left
Geth doc: 75162e9a15 | (Stoned Elipot)++ | .github/workflows/test.yml
Run GitHub workflow 'test' for any path under doc/
22:44
Xliff Hmmm... 22:52
m: sub a ($a) { $a.say }; my @a = <1 2 3>; a <== @a
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in quote words; couldn't find final '>' (corresponding starter was at line 1)
at <tmp>:1
------> 3a) { $a.say }; my @a = <1 2 3>; a <== @a7⏏5<EOL>
expecting an…
Xliff m: sub a ($a) { $a.say }; my @a = <1 2 3>; &a <== @a
camelia 5===SORRY!5=== Error while compiling <tmp>
A feed may not sink values into a code object. Did you mean a call like 'a()' instead?
at <tmp>:1
------> 3sub a ($a) { $a.say }; my @a = <1 2 3>; 7⏏5&a <== @a
Xliff notagoodidea: Are you sure about that?
m: sub a ($a) { $a.say }; my @a = <1 2 3>; .&a for @a 22:53
camelia 1
2
3
Xliff m: sub a ($a) { $a.say }; my @a = <1 2 3>; &a() <== @a
camelia [1 2 3]
22:53 cpan-raku left 22:54 brtastic left
Xliff m: sub a ($a) { $a.say }; my @a = <1 2 3>; a() <== @a 22:54
camelia [1 2 3]
22:54 JRaspass joined 22:56 cpan-raku joined, cpan-raku left, cpan-raku joined 23:08 Garbanzo left
notagoodidea Xliff: Not at all. 23:12
23:12 melezhik joined
notagoodidea I am currently reading about it/source code/source of Clang.jl/libclang. 23:13
23:13 aluaces left 23:15 JRaspass left
notagoodidea I will probably try my hand first to a few NativeCall interface before hoping to try that. 23:15
23:15 JRaspass joined
notagoodidea it could be a path to facilitate binding/wrapper from C besides writing them by hand (or not) 23:15
23:20 JRaspass left, JRaspass joined 23:22 oddp joined 23:30 JRaspass left, JRaspass joined 23:40 stoned75 left 23:41 JRaspass left