🦋 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 getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
[Coke] . 00:20
SmokeMachine m: ^10 .pick(*).pairs.min(*.value).key 01:25
camelia ( no output )
SmokeMachine m: say ^10 .pick(*).pairs.min(*.value).key
camelia 4
jdv anyone know if blin, or i guess whateverable, can run against rando rakudo,nqp, or moarvm refs? 01:31
SmokeMachine tbrowder: on the todays adventpost the Task class format seems odd and it seems the journal class is missing 01:39
tbrowder yes, it isn’t finished yet, it wasn’t supposed to be published… 01:43
it’s an emergency place holder…i’m in an internet-free zone for a couple of days 01:45
tonyo tbrowder: you cruising around on the f18c's and making my friends in crash crew work the holidays? 02:30
tbrowder no, just in the country at a place away from internet. just weak cell signal good enough for low data irc 02:41
thowe why isn't Atom coloring my Raku syntax? I gotta make it somehow? 04:28
does it not know to highlight when the file is named *.raku?
*gasp* yes. Naming it *.p6 seems to get me syntax highlighting! This must be fixable 04:29
so... What's the right way to make my .raku files get Atom syntax highlighting? 04:36
think I got it 04:40
holyghost I compile ircii, segfaults on linux x64 07:16
:-(
(--without-openssl) 07:17
holyghost curses/ncurses problem AFAIK 07:26
El_Che that takes me back 11:38
I think most moved to irssi and/or weechat
lizmat or Textual if you're on a Mac 11:41
holyghost Right, thx 11:50
Too bad BitchX isn't available anymore, was a good d00d client 11:53
It was the beginning of colored irc clients 11:54
d00d == dude 11:55
El_Che bitchx is around 11:58
holyghost Oh
BSD ?
El_Che no longer an ircii script, but standalone
msudx i got here from perl6.org 12:00
SmokeMachine I use www.irccloud.com/ I like it very much... and also use it it on my phone and that makes both sync... 12:01
holyghost SmokeMachine, I'm mostly in a terminal, but thanks 12:01
Summer irccloud also works as a general bouncer for irc clients too, blog.irccloud.com/bouncer/ paid feature but pretty neat 12:03
tbrowder SmokeMachine: i also use irccloud, it makes it easier to use irc imho
holyghost I was in on xchat in 1.6/1.8/2.0 for linux, now I use it on my mac 12:04
Xchat azure it's called
Summer I'd use irccloud if it was flosser, instead im probs gonna have to use a Lounge instance 😭 12:06
SmokeMachine Summer: thanks! I didn't know that!!! I think I'll give it a try, just for testing!
Summer xchat has mostly been replaced by hexchat
holyghost which is windows based AFAIK
Summer all platforms, gtk 12:07
Summer hexchat.github.io/news/2.16.0.html tingping has seemingly wanting to retire from maintaining hexchat for a while 12:08
holyghost Needs stupid dlls on windows
Summer yeah the plugin system is p scuffed there 12:09
holyghost Everything should be MFC based, but no-one understood that of course
holyghost Ok, I'm back online, shameen.ddns.net, you may have routing problems 12:12
SmokeMachine test 12:14
cool! I'm using Textual on IRCCloud!
thanks Summer! 12:15
holyghost lol 12:16
Now trying to decide to write the cgi scripts in perl, python or ruby :-) 12:17
Summer raku 😳 12:18
holyghost Aaaaah! There's no perl6 anymore ! :-)
tbrowder don’t laugh, but has anyone any interest in a mod_raku for apache http server?
holyghost yes
Need a separate binary AFAIK 12:19
Summer raku for lwan 😳
tbrowder ah, that’s right.
? 12:20
holyghost Also, we can update the raked site then, with more binaries (e.g. mod_raku) 12:21
s/raked/rakudo/
Summer lwan.ws/ its a dis at the closed source "quantum proof horizontally parallisable" gwan 12:22
holyghost I guess Debian would be interested
tbrowder i hope so :-) 12:23
holyghost I had the horse book back in the day (mod_perl), but I guess there's a place for raku web programming in raku.so AFAIK 12:27
tbrowder holyghost: i have some cgi working using raku 12:28
holyghost sure
Which uses the interpreter
tbrowder yes
i get nothing at raku.so 12:29
holyghost tbrowder, as in php.so, I don't know the mod_perl things 12:30
For apache I mean
PHP is somewhat nicer and uses perl syntax 12:31
tbrowder i don’t need super speed so raku interp has worked fine where used so far
holyghost sure
But you can extend it
source code is nice :-) 12:33
tbrowder i’ve tried to keep my sites super secure and have stayed away from php for many years. 12:34
holyghost Oh, ok
tbrowder, you don't like php ? 12:35
tbrowder but maybe it’s better now
holyghost PHP was stupid yes 12:36
lizmat wonders in how many communities the holyghost is active
holyghost Now with M$ on it it's better
El_Che mod_* is not where the sh*t is at, nowadays
holyghost lizmat, 2 :-)
tbrowder best thing for apache lately is ease of use with letsencrypt
El_Che webservers are pretty much reverse proxies, hence the language does not matter
holyghost I guess to prefer what you program in 12:37
tbrowder yes, but i still don’t have a reverse proxy working yet :-( 12:38
no excuse, though, always putting the hard work off
lizmat tbrowder: the latest Cro has reverse proxy support, no ? 12:39
tbrowder yes, but i’ve talked to jnthn about it a bit. and getting tls support on the inside is a bit sticky. 12:40
on my main site i use tls certs for private user access 12:41
lizmat ah, I see: most reverse proxies I had to work with, didn't need that because they ran on trusted networks
Summer random aside, does anyone know any non-traditional ssh servers? la something that would be good for app development instead of as remote access? 12:42
libraries also fine
holyghost Summer, openssh ? 12:42
Not libssh2
Ssh.com vs. openbsd 12:43
ssh is yndicated
s/yndicated/syndicated 12:44
Summer thats v traditional, I guess as examples, github.com/gliderlabs/ssh and /x/crypto/ssh, www.paramiko.org/, etc, full control over the auth process is the main thing (just so I can accept all keys) 12:47
holyghost Maybe Hellman for solaris 12:48
Sorry, I only know openssh
openssh is on Debian as a separate package 12:51
or was 12:54
holyghost It's blowfish based, which is unterrijndael 12:59
tbrowder btw, i noticed when putting comm modules in zef the master branch will be changed to name. has that been codified by the steering commitee 15:37
*main
*committee 15:38
lizmat well, no, but it *is* the general trend, and I thought I'd do that in one go 15:56
El_Che it's the default at github for new repos
lizmat as it is for new repos with App::Mi6 afaik 15:57
mcmillhj When capturing an array returned from a `sub` I noticed that an extra level of nesting was added. Can someone explain what is happening here? topaz.github.io/paste/#XQAAAQAyAgA...OIWgt49lw3 16:08
rDPpm+b9DqERsls8YHLxcrWuTq0T9tWb2DULAJJfQD+Z2mHOi/UvcWRiXsNE5GyswbA/7K7Bd2/djvLjHO0WI68Aa3SFVmTWpZ8C03RhT1TNaPctBUtk2qlmHoyzN/uHW2j1AKQE0sH24G3Bg4mz41pAleFkgnKu7y61pcR8HM+qVO2qPIirRo/jfzZV2YFsDma3OSGNmeMTZ/5/z2A/QA=
holyghost hi Xliff 16:36
Xliff \o 16:52
tbrowder got it 17:11
[Coke] mcmillhj - that link was broken over two sends. might want to put it into a link shortener first. 17:41
.tell mcmillhj - it's the parens around ($should-continue, @buffer) - remove the parens and it works as you expect. 17:43
tellable6 [Coke], I'll pass your message to mcmillhj
thowe is DBIish the /correct/ thing to use to talk to my Pg databases? 17:54
lizmat there's also DB::Pg I have no experience in either. jnthn said he liked the more rakuish interface of DB::Pg in their advent post last year 17:56
thowe Oh. I think I misunderstood that. I think I assumed DB::Pg was somehow used by DBIish. 17:58
Given my current mindset I think I would err on the side of "more rakuish interface". 18:00
lizmat yeah, that would be my hunch as well 18:02
thowe I have a chunk of business logic I wrote 15 years ago in Ruby that I want to take another run at with Raku. Feels a bit like a boss fight, but I would feel good about having done it. Making my second attempt at learning Raku atm.
ugexe If you're rewriting Ruby are you not using a ORM? 18:04
thowe I did not for the original code. In fact, my displeasure at what Ruby had to offer in that area at the time led to me learning Perl so I could use DBIC. The logic itself doesn't /need/ to talk to the database, but I have another project that does. I would actually like to try to make this first thing a web service with Cro maybe. 18:06
The project was written in a caffeine fueled rush, but it has always worked so I never replaced it. 18:08
SmokeMachine thowe: If you need/want an ORM some day, maybe you would like to take a look at Red... 18:10
thowe So it sits there, for years, taunting me with its ugliness and stubborn insistence on continuing to work despite the fact I hate it. 18:10
SmokeMachine, yeah, I noticed Red is a thing. I think it might be the right tool for my other project but I need to get through my "Learning Perl 6" book first. 18:11
SmokeMachine .tell mcmillhj it seems if you replace the List `()` with a signature `:()` and the `=` with a `:=` you get what you want: glot.io/snippets/g5eg08jvxz 18:14
tellable6 SmokeMachine, I'll pass your message to mcmillhj
thowe I get really confused by the Advent Calendar code, so I am afraid of creating another abomination that taunts me for years if I don't learn the language better this time before stepping in the ring.
habere-et-disper m: say $*RACU 18:30
camelia Dynamic variable $*RACU not found
in block <unit> at <tmp> line 1
habere-et-disper Can we improve on the suggestions for dynamic variables?
tonyo not really worth the effort 18:35
thowe: DB::Pg is the best thing to use for postgres connectivity
thowe Thank you; that seems to be the consensus, and that's where I will be looking. 18:41
lizmat habere-et-disper: could you make an issue for that please ? 18:55
El_Che thowe: the fun thing of rewriting is not transposing A to B (Ruby to Raku), but refactoring and make use of feature of the new language (in my view) 19:02
thowe That's my goal. After 15 years of thinking about the problem, I haven't really come up with better logic. However, I think I can make it look nicer, be more clear, and arrange it in a way that better exposes the problem it is solving. Also, I think I can keep it very discoverable to my colleagues who use Ruby, etc... 19:11
And, maybe, I'll actually come up with a few better ideas along the way. I intend to do it without referencing the old code. 19:12
El_Che if it's the first Raku program at your org is kind of a business card (if you accept my out od fate reference)
thowe: I come up with great ideas all the time when refactoring, genius level
thowe: however, I don't agree when refactoring the next time :) 19:13
I tend to go for clarity instead of cleverness
everyone is too lazy to profile anyways (except when needed of when there is a problem) so cleverness-of-this-is-faster does not pay off for me 19:14
thowe I find I get really good at understanding the problem. I rarely feel I solved it in the best way. This particular problem is pretty easy to add some optimization to because you can get the most common cases out of the way up front. The meat is in handling the combinations of edge cases. 19:19
But I learn in a bubble... Code in a bubble. Have a lot of other things to do. If it weren't for IRC I would be worse off; a lot of Perl folks have been very patient with me. 19:21
lizmat if you can improve the algorithm, that's ok! what El_Che means is that generally finding the fastest way to do something in Raku given a certain algorithm, is generally not worth it 19:23
.oO( unless you're working on the core :-)
thowe Oh no, I totally get that clarity is more important than brevity or optimization. 19:26
thowe I think it was Knuth who said something like "Programs should be written to be read by people and only incidentally by computers." I'm probably butchering the quote. 19:27
Definitely my goal. I just think Raku lends itself to readability, if done right, in much the same way Ruby is, if done right. You have options for writing it so that it makes sense when read "out loud" even. 19:28
thowe anyway, i feel like I'm spamming the channel 19:30
japhb lizmat: ... or the mantle. The data format codecs need to be as fast as possible, for instance, because inevitably someone's going to do something that requires reading or writing a LOT of data. 19:33
jdv its a dual edged sword. i sometimes see raku code and it takes a while to parse it mentally cause its so tight. 19:37
tonyo who is `ohmycloud` on github? 19:40
lizmat good question 19:41
thowe Whoa, live TPF in Houston. =) 20:02
lizmat there are many reasons /me will not attend, one of them Texas and its ridiculous laws that seek to dis-empower women 20:09
thowe damn... good point. There's goes the wind from my sails. 20:15
lizmat sorry... please don't let me stop you... this is a personal choice 20:42
*my* personal choice
jgaz When using Raku's dir() routine is it possible to filter by file type? Examples: I only want subdirectories or maybe I only want certain file extensions? 21:00
lizmat :test( *.ends-with(".raku")) 21:01
jgaz ^^
guifa curses leapseconds 21:02
jgaz what about the dir case? directories don't have file extensions.
lizmat m: dir(., :test(*.say) ) 21:05
camelia ===SORRY!=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:1
------> dir(.⏏, :test(*.say) )
lizmat m: dir(".", :test(*.say) ) 21:06
camelia .
..
.cpanm
.local
.npm
.perlbrew
.rcc
Perlito
evalbot
log
nqp-js
p1
p2
perl5
std
.bashrc
mbox
.cpan
dalek-queue
rakudo-j-inst-1
rakudo-j-1
rakudo-j-inst-2
rakudo-j-2
.cdmem
lib
testdir-112
testdir-2…
lizmat m: dir($*CWD.absolute, :test(*.say) )
camelia .
..
.cpanm
.local
.npm
.perlbrew
.rcc
Perlito
evalbot
log
nqp-js
p1
p2
perl5
std
.bashrc
mbox
.cpan
dalek-queue
rakudo-j-inst-1
rakudo-j-1
rakudo-j-inst-2
rakudo-j-2
.cdmem
lib
testdir-112
testdir-2…
lizmat other than inspecting the string, I don't see an easy way 21:07
jgaz ok
It was worth asking about.
Thanks
lizmat jgaz: I guess that's why I made raku.land/zef:lizmat/paths :-) 21:08
MasterDuke m: say dir(".", :test(*.IO.d)) 21:15
camelia (".".IO "..".IO ".cpanm".IO ".local".IO ".npm".IO ".perlbrew".IO ".rcc".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".cpan".IO "rakudo-j-inst-1".IO "rakudo-j-1".IO "rakudo-j-inst-2".IO "rakudo-j-2".IO "lib".IO…
jgaz Yeah, I jsut found this: andrewshitov.com/2018/10/31/workin...in-perl-6/ 21:17
This is helpful. 21:18
guifa lizmat: I know you've been doing some edits to CORE::DateTime. I'm not sure the best way to expose it (commence bikeshedding), but one potentially useful addition would be to give a leapsecond adjusted posix time (some utilities prefer that). I think I could code something up such that .posix could optionally take :leapseconds, adjusting accordingly. 21:39
lizmat I think a separate method would be better? 21:40
guifa lizmat: hence commence bikeshedding ha. I swore that there used to be a method that returned a True/False value (or accepted one) to account for LSs, although that was only because some POSIX time stamps are ambiguous due to the LS. 21:45
lizmat there's a named arg to account for it I seem to recall 21:46
guifa that's what I thought, but it's not on the docs page. I'll go take a look at the edit history for it 21:48
guifa huh, maybe I just dreamed it up. 21:52
kybr is there something like this `'('.unicode-property<mirror> eq ')'` ? 21:53
ugexe yeah, but i dont remember what it is 21:55
guifa kybr: at best you can get Bidi_Paired_Bracket, but that's designed for bidirection text. It should be mostly correct whenever something is defined, but values might not always be defined 21:56
m: say '[({<“‘«\\′⸂'.comb>>.uniprop('Bidi_Mirroring_Glyph').join 22:07
camelia ])}>»⸃
elcaro is there a more efficient way to punt a method call to a function than just doing `method m($arg) { some::func($!attr, $arg) }` 22:23
tonyo callsame or callwith if you're calling the parent from an inherited class 22:26
lizmat m: class A { BEGIN A.^add_method("foo",&say) }; A.foo # elcaro something like that ?
camelia (A)
tonyo m: role A { method a { say "A.a"; }; }; class B is A { method a { say "B.a"; callsame; say "/B.a"; }; }; B.a; 22:27
camelia B.a
A.a
/B.a
elcaro lizmat: thanks... I figured I would need to compose it in at compile time to get the least overhead 22:38
lizmat calls it a day& 22:43
elcaro Haha, I'm not sure it works yet... but take the day off, you've earned it. 22:44
I'm trying to punt the `push` method of class that does `Array::Agnostic`... I may be trying to be too clever for my own good.
But I'll poke around the MOP a little more before I give up. 22:45
Xliff Waht's the best way to determine logarithmic scale given a set of numbers? 22:52
thowe is "use v6" still a thing? 23:21
elcaro kind of... if you are using features/semantics introduced in 6.d, you might want to do `use v6.d` to ensure people running v6.c are aware. 23:24
though hopefully the amount of people running v6c is very low
same goes for using newer features... you might want to use v6.e.PREVIEW (or just use v6.e when it comes out) 23:25
but outside of that... i think a plain `use v6` is not necessary.
thowe Ah. Understood. That way there is a record of the environment/timeframe in which some code was written. 23:27
guifa It's also a nice way to say "I have not tested this against higher versions". It's unlikely that 6.e will break anything for 6.d or 6.c, but it's always possible 23:33