🦋 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:45 pecastro left 00:58 gnufr33dom joined 01:27 marcusr left 01:28 marcusr joined 01:34 marcusr left 01:36 marcusr joined 02:19 gnufr33dom left 02:24 tejr left, tejr joined 02:27 monkey__ joined 02:42 MasterDuke left 02:57 kvw_5_ joined 03:01 kvw_5 left 03:08 monkey__ left 03:10 eseyman left 03:12 eseyman joined 04:12 coverable6 left, bisectable6 left, quotable6 left, benchable6 left, releasable6 left, nativecallable6 left, tellable6 left, evalable6 left, unicodable6 left, committable6 left, bloatable6 left, sourceable6 left, greppable6 left, linkable6 left, statisfiable6 left, shareable6 left, notable6 left, squashable6 left, releasable6 joined, committable6 joined 04:13 bloatable6 joined, squashable6 joined, tellable6 joined, unicodable6 joined, evalable6 joined, nativecallable6 joined, sourceable6 joined, benchable6 joined, quotable6 joined 04:14 bisectable6 joined, notable6 joined, greppable6 joined, linkable6 joined 04:15 statisfiable6 joined, coverable6 joined, shareable6 joined 04:32 rindolf joined 04:44 sampersand joined
sampersand Hi. When specifying return types, if it's returning the same class as its declared in, should i return `::?CLASS`? 04:45
for example, should I do this, or replace `::?CLASS` with `MyString` : `method add(Value $r, --> ::?CLASS) { ::?CLASS.new: ... }`
sortiz Using ::?CLASS is safer if you ever change the class name. 04:46
sampersand Yeah, same wieth Rust and `Self`. It just looks a bit ugly here, especially with `::?CLASS.new`
What's the cleanest way to have strings behave like perl strings? eg `"1a" + 3` should give me 4 04:47
I've done `$thing ~~ /^ <[\d]>* /; $<>.Int` , but im wondering if there's something cleaner 04:48
sortiz For your method you can use $.new(... or self.new(..., that works too because self is the invocant. 04:56
04:58 skaji_ joined, jhill left 04:59 jhill joined, sftp left, sftp joined
sampersand oh right 05:03
taht makes sense @soritz
05:06 aindilis left 05:11 mowcat left 05:16 Doc_Holliwood joined 05:22 sampersand left
sortiz m: sub toint(Str $a) { my $res = 0; for $a.ords { given $_.unival { when $_ === NaN { last }; default { $res = $res * 10 + $_ } }}; $res }; say toint('321foo') + 20; 05:29
camelia 341
05:35 xinming_ joined 05:38 xinming left 05:40 Froogal joined
guifa2 m: say IntStr.new('1a') + 3 05:44
camelia Too few positionals passed; expected 3 arguments but got 2
in block <unit> at <tmp> line 1
guifa2 say "1a".comb(/d/).join.Int 05:45
evalable6 0
guifa2 err
m: say "1a".comb(/\d/).join.Int 05:46
camelia 1
guifa2 sampersand: ^^
tellable6 guifa2, I'll pass your message to sampersand
05:49 sampersand joined
sampersand is there a way i can set the program name so my `$*USAGE` doesn't give the full path? 05:50
tellable6 2021-02-15T05:46:27Z #raku <guifa2> sampersand: ^^
sampersand whoops i have no idea what that was in reference to
guifa2 sampersand: getting a string value perl style-ish 05:52
m: say "1a".comb(/d/).join.Int
camelia 0
guifa2 err
m: say "1a".comb(/\d/).join.Int
camelia 1
sampersand but something like `"1a2"` will give me 12, not 1 05:53
sortiz m: sub toint(Str $a) { my $res = 0; for $a.ords { given $_.unival { when $_ === NaN { last }; default { $res = $res * 10 + $_ } }}; $res }; say toint('321foo') + 20;
camelia 341
guifa2 ah I didn't realize perl stops at the first alpa. it's been a while since i've tried doing stuff like that
sortiz Try mine sampersand.
sampersand that seems like a lot more trouble than my regex solution soritz 05:54
`$!value ~~ /^ \d* /; $<>.Int`
is there a way to get `MAIN` to accept arguments in the form `-e foo` not `-e=foo` ? 05:57
sortiz Your regex fails to give zero for "foo" ;-) 05:59
sampersand how so I have `\d*` ? 06:00
sortiz For your other question, see github.com/nxadm/SuperMAIN
sampersand oh cool, also disappointing its not builtin 06:02
Froogal Hello! I'm having a problem with the raku site.  I keep getting an error "SSL_ERROR_RX_RECORD_TOO_LONG" does anyone else get this while trying to access the site?  It's really annoying while trying to read docs. loll 06:03
sampersand I GOT THAT TOO 06:04
i have no idea the cause, and one day it just started working again. i used the wayback machine as a stopgap though 06:05
sortiz I don't have problems accessing raku.org nor docs.raku.org. (tested with chrome and firefox in linux) 06:08
sampersand when i had the problem, i tried curling the website and still got the ssl error
06:10 benkolera joined
sampersand so to resolve my circrular imports, ive resorted to this. is there a better solution: `our &run = sub { require Knight::Parser '&parse-and-run'; ::('&parse-and-run').($^a) };` 06:12
`Knight::Parser` depends on `Knight::Function` , which has a function called `eval` , which then needs to run that `&run` function, and thus circular import 06:13
guifa2 is currently also able to get to raku.org sites, testing on Chrome on macOS 06:14
summerisle same heer
guifa2 sampersand: that is your best bet if you want to keep them in different files
sampersand really? requiring it _every time_ the function is run? 06:15
guifa2 it's not like it's calling the export code again multiple times
it'll call it once during compilation
sampersand oh 06:16
well, if i move it outside the sub, it no longer works
guifa2 in fact, it's often seen as good practice in Raku to limit your use/require statements to the specific block you need them. I only hoist things to the top of a module file if I'm going to use it all over the place
sampersand hm ok
how can i import methods with this? 06:17
06:18 Froogal left
guifa2 you should just use "use" instead of "require". REquire just gives you access to the package's namespace (via its our-scoped stuff) 06:22
I'd probably write it as 06:23
sub run ($code) { use ::('Knight::Parser'); parse-and-run $code }
sub foo { … } is functionally identical to our &foo = sub { … }
06:24 gnufr33dom joined 06:32 Froogal joined
Froogal Does Raku have something equal to system() in perl? 06:32
sortiz Froogal, see docs.raku.org/type/Proc::Async 06:36
Froogal sweet, thanks!  Wow so I'm feeling a lot of javascript vibes from raku lol 06:37
Not a bad thing tho
sortiz In raku almost everything is an object, even more than in JS. 06:38
sampersand raku has `qqx<...>` 06:39
i tried the `sub foo` thing guifa2 but i was getting errors for some reason
yeah, when i replace the `our &foo` with a `sub foo` , i get `Could not find symbol '&run' in 'Knight'` 06:40
and doing that `use` gives me circular imports guifa2 06:41
guifa2 Froogal: note a small difference between Proc::Async and Perl's system 06:42
> raku -e 'Proc::Async.new("sleep 5"); print "foo"'
will immediately print foo, while the sleep is still going on in the background 06:43
> perl -e 'system "sleep 5"; print "foo"'
Will wait five seconds, and then print foo
Froogal Because of Async?
sortiz Yes, there is also the simple Proc (see docs.raku.org/type/Proc ) and 'run' sub. 06:45
docs.raku.org/routine/run 06:46
Froogal nice!  so many options 06:47
guifa2 sets up a new CLDR compile and heads to bed. At least there will be an update in time for the weekly 06:50
guifa2 coughs in the direction of lizmat, but from a pandemic safe distance
06:57 Froogal left
sampersand is there a way to tell raku to tell me where it waas when i hit ctrl+c. i presume i have an infinite loop somewhere but idk where 07:00
07:00 parabolize left
guifa2 perhaps you could do signal(SIGINT).tap( { say Backtrace.new.XXXXX; exit 0 } ); 07:05
or something of that sort
where XXXXX is the degree oft race you want
e.g. summary, concise, full, nice, gist 07:06
errr
whoa, that never exits!
even after control Cing
sampersand: Actually, what I have there works just fine. Just don't test it with loop { }; my guess is something gets really mucked up with the stack there. WheN I retried with loop { sleep 2 } it worked perfectly 07:11
sampersand ok cool
yup, just as i suspected. things arent workign as they should ;p 07:12
07:16 aluaces joined
summerisle is there any good literature on rakudo design philosophy, nqp, architecture, etc...? 07:20
07:20 ufobat__ joined
guifa2 look up stuff by jnthn, he's probably written the more recent stuff 07:23
07:23 holyghost joined
guifa2 Rakudo doesn't have the same degree of design docs as Raku does though 07:23
07:30 Discipulus joined 07:36 elcaro joined 07:44 wamba joined 07:47 abraxxa joined
sortiz summerisle, see github.com/edumentab/rakudo-and-nq...ls-course, IMHO the best entry point available. 07:48
07:52 abraxxa left, abraxxa joined, Sgeo left 07:58 cgfbee left
sortiz Discipulus: I finally got to the end of the rabbit hole. 07:59
Discipulus sortiz: me too! did you have seen my perlmonks post? 08:00
sortiz No yet. Let me see...
Discipulus www.perlmonks.org/index.pl?node_id=11128365 08:01
it's about perl but very related
sortiz Okay, but do you know where that _CRT_glob goes? 08:07
Discipulus for raku? no idea :)
I know nothing about raku
08:08 gnufr33dom left
Discipulus I suppose there are some .c files to modify for raku too 08:08
sortiz In all cases it is handled by an internal MS CRT function! 08:09
08:12 Doc_Holliwood left
Discipulus this sounds opposite to the observed beahviour of MinGW built rakus, no? 08:13
08:16 finsternis left
sortiz No, MinGW32 ang MinGW64 uses different mechanisms but deep inside both depends of msvcrt, in it the handling is done by __getmainargs 08:17
In mingw64 you can control it linking CRT_glob.a or CRT_noglob.a that simply set its 'extern int _dowildcard' (the mingw _CRT_glob analogous) 08:20
08:29 sampersand left
sortiz And results that raku don't touch _CRT_glob (nor _dowildcard) so, if linked with mingw64 uses the default and expands. 08:32
08:33 dakkar joined 08:39 cgfbee joined 08:47 Garbanzo left
Discipulus sortiz: nice found.Did you plan to open an issue? 08:49
08:53 Scimon joined
sortiz Can be. I think that for moarvm is only a matter of call Configure.pl with the proper arguments. You do not need to modify the code. 09:00
09:17 MasterDuke joined 09:18 dogbert11 left, dogbert11 joined 09:19 rba left, rba joined 09:20 dustinm` left, dustinm` joined 09:34 ab5tract joined 09:53 domidumont joined 10:05 domidumont left
sortiz Discipulus: Confirmed, I can build raku with mingw64's gcc and the proper LDFLAGS to avoid the expansion. 10:10
Discipulus sortiz: ++ so you are elegible to produce a patch too :) 10:11
10:20 wamba left
sortiz I made a post in the original perlmonks thread. 10:24
10:28 aluaces left
sortiz o/ Time for bed. 10:30
10:34 sortiz left 10:38 sortiz joined
sortiz Discipulus: Btw, for MS tools see docs.microsoft.com/en-us/cpp/cpp/m...-expansion 10:40
g'night 10:41
10:41 sortiz left 10:54 wamba joined 11:13 ab5tract left 11:24 aluaces joined 11:52 patrickb joined 12:13 ab5tract joined 12:30 pecastro joined 12:31 sftp left 12:32 sftp joined 12:48 Discipulus left 13:12 ab5tract left 13:26 Discipulus joined 13:52 imcsk8 left 14:01 guifa2 left 14:04 Sgeo joined 14:20 telex joined 14:21 xelxebar left, xelxebar_ joined 14:37 renormalist joined 14:39 ab5tract joined 14:46 ab5tract left 14:47 lucasb joined 15:05 Doc_Holliwood joined 15:08 domidumont joined 15:14 gnufr33dom joined 15:43 wamba left 15:48 Sgeo left 15:57 wamba joined 16:00 RaycatWhoDat joined
RaycatWhoDat Ah, it's that time again. 16:00
That time where I feel just enough pain from speed and general libraries to be tempted to the Racket side. 16:01
But I have a love-hate relationship with parens so, I weep 16:02
16:04 RaycatWhoDat left 16:05 RaycatWhoDat joined
RaycatWhoDat I forgot that `quit` kills all of your channels 16:05
16:08 parabolize joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/02/15/2021-07-easy-hard/ 16:17
tyil lizmat++
16:21 domidumont left
tonyo hat general libs are you looking for RaycatWhoDat 16:35
RaycatWhoDat tonyo: GUI, mostly. Not for this use case but in comparison to Racket. 16:36
Or perhaps, this is all a perception issue and I should be treating Raku more like Haxe where the language consumes APIs/libraries from other places? 16:37
tonyo raku is more of the consume libs style than having everything built into it 16:42
if you need examples of it Nativecall docs are pretty decent to get started 16:43
and then you have DB::Pg, libcurl, etc all use it 16:44
16:50 Sgeo joined 16:52 gnufr33dom left 16:56 patrickb left
sjn lizmat: about CCR; is there room for old videos in the project? (I know of two which still may have some value) 17:02
lizmat hmmm... you mean, copy into the repo ? 17:17
sjn: not sure how Github (dis)likes that 17:18
17:31 Garbanzo joined
codesections sjn: one option for videos (which we might want to look into anyway if we do a RakuConf) is setting up a Raku peertube instance. Then the CCR could link to that. 17:34
but it seems like a bigger discussion than just uploading a blog post. Maybe you could open an issue in CCR? 17:35
17:35 dakkar left 17:39 Scimon left 17:54 mowcat joined, RaycatWhoDat left
db48x avoid putting large binary files in a git repository 17:57
instead, make sure the videos are archived on archive.org 17:58
and put an index in the repository
18:00 RaycatWhoDat joined, wamba left 18:01 jhill left, skaji_ left 18:02 skaji_ joined 18:03 RaycatWhoDat left
codesections huh, I didn't realize that archive.org handled arbitrary video. I guess they do, but it sounds like they don't try to be particularly comprehensive and still sometimes have playback issues? ~www.reddit.com/r/DataHoarder/comme...s_used_to/ 18:03
18:04 jhill joined
codesections In general, I don't _love_ the idea of relying too much on them, both because I'd rather we keep control of our own content and because I'd hate to burden them more than we need to 18:05
but I agree it's better than nothing, obviously
18:28 domidumont joined
tonyo how much data in video is it? 18:32
18:33 mowcat left 18:38 _jrjsmrtn joined, __jrjsmrtn__ left
db48x codesections: all the Raku videos ever recorded probably won't add up to much compared to the 50PB of data they already save 18:38
lizmat ok, so it seems that uploading to archive.org and having a link in the CCR seems a viable solution 18:39
db48x codesections: but it does make sense to have multiple backups. you can always ensure that everything is archived, plus also start your own peertube :)
lizmat indeed... I will probably have a local copy of each
db48x in fact, they don't even care if you hotlink the video files
lizmat so: please create a PR for links to videos 18:40
or ask for a commit bit :-)(
db48x your peertube could just be an interface that lets users find videos, while actually serving them from the archive
lizmat afk for a few hours&
18:44 domidumont left
tonyo .tell jmerelo ty 18:45
tellable6 tonyo, I'll pass your message to jmerelo
18:45 aborazmeh joined
codesections yeah, all that makes sense (though I'm not sure about the peertube-as-an-InternetArchive frontend idea!) 18:57
19:16 Garbanzo left
tonyo is it intentional that setting %*SUB-MAIN-OPTS outside of the entry point for raku has no effect? eg module X { my %*SUB-MAIN-OPTS = :; sub MAIN("l", :a($all)) is export {..} }; will only work if you call x -a l and not x l -a (if x is `using X`) 19:20
db48x codesections: why aren't you sure about it? 19:24
codesections tonyo: s/:;/:named-anywhere;/ ? 19:27
19:27 mowcat joined 19:29 guifa2 joined
codesections tonyo: I don't know the intent for sure, but the implementation at github.com/rakudo/rakudo/blob/mast...in.pm6#L17 makes that look pretty intentional to me 19:31
db48x: well, just that the IA gets a lot of traffic and has pretty tight funds. There wouldn't be a *need* to develop a distributed, privacy respecting alternative to youtube if the answer to getting content of youtube was as simple as "create a frontend for the internet archive" 19:34
19:41 aluaces left
guifa2 oooh, FOSDEM is prepping the videos for release 19:46
db48x codesections: bandwidth is pretty cheap compare to the drives the data is stored on, and the motto at the archive is "access drives preservation" 19:51
that is, making the data available to people is what makes preserving it worthwhile 19:52
19:55 ufobat_ joined 19:58 ufobat__ left 20:00 wamba joined
tonyo yes to your sub ^ 20:01
guifa2 lizmat++ for the weekly! 20:35
20:54 asymptotically left, asymptotically joined 20:55 ufobat_ left 21:09 aborazmeh left
guifa2 Thinking out loud here, but is there a way to extend enums in some way? 21:27
In CLDR, gender values are any of 7 different values. That's in an enum, awesome. But in one subsection of the CLDR, it can be any of those, or one or two special values. SO right now I'm having to store them as strings, which feels not as neat and tidy compared to enums 21:30
21:34 leah2 left
codesections guifa2: (probably an unhelpful answer, but...) you could always just make your own enums out of Roles wimvanderbauwhede.github.io/articl...s-in-raku/ 21:35
21:43 leah2 joined
guifa2 codesections: hmm something like that might work 21:51
codesections yeah, it'd work – I was guessing it would be more refactoring than you were interested in, but maybe I'm wrong about that 21:52
I guess it depends on how much you use the enum
guifa2 eh, not often but when I do it get used a decent bit and the integral values are important 21:53
this is kind of where I wish I could just do a C union or something
tbrowder can i pls get a commit bit for planet.raku.org?
22:04 Black_Ribbon joined 22:06 wamba left 22:15 Discipulus left 22:38 aindilis joined 23:52 linkable6 left, evalable6 left 23:53 evalable6 joined 23:55 linkable6 joined