🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:23 jjido left 00:30 Aedil left 01:03 guifa joined 01:25 hulk joined 01:27 kylese left 01:37 guifa left 01:58 librasteve joined 02:02 librasteve left 02:15 hulk left, kylese joined
SmokeMachine If anyone is interested (maybe librasteve), I'm planing on merging this PR (github.com/FCO/Cromponent/pull/13) to Cromponents main tomorrow... if someone would be interested in critiquing... I plan add more tests (and also tests for websocket (idk how yet)) before merging... 02:58
03:06 Xliff joined
Xliff \o 03:06
.seen timo 03:07
tellable6 Xliff, I saw timo 2025-06-26T20:22:35Z in #raku: <timo> i think it allowed us to call a registered dispatcher when a lookup of a variable didn't find anything
Xliff timo: You around?
03:11 guifa joined 03:16 guifa left 03:17 holyghost joined
holyghost I've made a a PSP gcc compiler, it's at sf.net/p/psp1and2sdk/ 03:24
I will turn it into a PSVita and PSP2 system
I need a drink
03:29 Aedil joined 03:45 kylese left 03:48 kylese joined 04:35 guifa joined 04:53 guifa left, librasteve joined 04:58 librasteve left 05:26 librasteve joined 05:31 librasteve left 05:38 librasteve joined 05:41 holyghos_ joined 05:42 holyghos_ is now known as holyghost_ 05:43 librasteve left 05:55 librasteve joined 05:57 bdju left 06:03 librasteve left 06:04 librasteve joined 06:16 librasteve left 06:26 human-blip left 06:27 human-blip joined 06:29 librasteve joined 06:34 librasteve left 06:39 librasteve joined 07:47 librasteve left 07:48 librasteve joined 07:53 librasteve left 07:54 jjido joined 08:14 librasteve joined 09:06 Sgeo left 09:40 abraxxa-home joined 09:47 abraxxa-home left 09:50 abraxxa-home joined 09:59 librasteve left 10:05 librasteve joined 10:10 librasteve left
disbot3 <apogee> Multiple returns question: How do you destructure something like return @lista, @listb; (or similar) When I do my (@a, @b) = function It puts [[...] [...]] in @a. 10:16
<apogee> Or maybe there's a better way to do it. I have a list, I want to partition the list into 'elements that have some attribute' vs 'elements that don't have some attribute' 10:19
<apogee> Like maybe I have cities and I want a list of cities with population > 500k and cities with population <= 500k
lizmat thing to remember is that you always only return 1 value from a block (such as a sub)
that one thing can be a list or an array or a hash 10:20
or any object for that matter
disbot3 <apogee> Yeah so as I understand it, I'm returning a list of lists, I'm just wondering if there's a nicer way to destructure it than my @res = function; my @a = @res[0]; my @b = @res[1]; 10:21
lizmat in situations like that, I usually use the fact that arrays are objects too, so: 10:23
m: sub foo(@a,@b) { @a = <a b c>; @b = <d e f> }; foo my @a, my @b; dd @a, @b
camelia ["a", "b", "c"]
["d", "e", "f"]
disbot3 <apogee> That works, thanks. 10:24
<apogee> so something like: partition cities my @small, my @large, @cities and just assign @small & @large in the function?
lizmat yeah, that'd be the idea... also much more efficient performance-wise 10:25
I'd pass @cities as the first arg, but yeah
just in case you'd want to add a "medium" array in the future :) 10:26
disbot3 <apogee> Yeah that makes sense 10:27
<apogee> or a different split size or something
<apogee> Thanks for the help! 10:31
10:32 librasteve joined
lizmat yw 10:36
disbot3 <apogee> Oh, is there a go-to logging library or interface? 10:37
10:37 librasteve left
lizmat apogee something like raku.land/zef:jnthn/Log::Timeline ? 10:44
ah, actually raku.land/zef:raku-community-modul...::Timeline nowadays
10:50 librasteve joined
disbot3 <apogee> Thanks1 10:55
<apogee> Is DBIish the go-to for SQLite?
10:56 abraxxa-home left
lizmat there's also raku.land/cpan:CTILMES/DB::SQLite 10:56
but raku.land/zef:demayl/Cro::HTTP::Session::SQLite uses DBIish, so there's some precedent there 10:57
fwiw, I would love to see SQLite support in core
but that's another discussion :-)
disbot3 <apogee> I need to give one of these libs a PR to support SQLCipher's extensions 😄 11:01
<apogee> Not Raku but it is a very simple extension API-wise: c key :: proc "c" (db: ^Connection, key: rawptr, nKey: c.int) -> c.int --- key_v2 :: proc "c" (db: ^Connection, zDbName: cstring, key: rawptr, nKey: c.int) -> c.int --- rekey :: proc "c" (db: ^Connection, key: rawptr, nKey: c.int) -> c.int --- rekey_v2 :: proc "c" (db: ^Connection, zDbName: cstring, key: rawptr, nKey: c.int) -> c.int --- 11:03
<apogee> (That's Odin but should be pretty readable for people who know C/FFI) 11:06
SmokeMachine m: say (1, 10, 3, 7, 9, 2, 4, 8, 6).classify: { $_ < 5 ?? “small” !! “big” } # apogee 11:15
camelia {big => [10 7 9 8 6], small => [1 3 2 4]}
SmokeMachine apogee: 👆
About SQLite, you could also take a look at Red: github.com/FCO/Red 11:16
disbot3 <apogee> Thanks 11:47
12:25 jjido left
disbot3 <nahita3882> you can also do := instead of = 12:35
<nahita3882> stackoverflow.com/a/67766483
12:48 guifa joined 13:00 jjido joined
[Coke] talk at the con today by Util - tprc.us/tprc-2025-gsp/schedule-2/#hypersonic 13:10
13:10 librasteve left
SmokeMachine is it on youtube or being recorded? 13:20
[Coke] it's live right now 13:21
and yes, all the talks should end up on YT
sadly, the other raku talk today was canceled due to covid. 13:22
13:24 librasteve joined 13:29 librasteve left 13:32 librasteve joined 13:38 librasteve left 13:58 librasteve joined 14:03 jjido left
SmokeMachine I've been searching for those videos... I couldn't find them... :( could you share the link? 14:07
14:08 guifa left
[Coke] i dont think they are putting them up immediately 14:08
ok - yesterdays are all rendered and uploaded but not made visible. Just need signoff from con runners. Please expect them soon but not immediately. 14:10
SmokeMachine [Coke]: :) thanks! 14:14
14:16 guifa joined
jdv SmokeMachine: you mean this?: www.youtube.com/playlist?list=PLA9...xitFRyEGza 14:37
[Coke] Yes, that's the channel, thank you (looks like they've started making some visible) 14:39
SmokeMachine jdv: I had seen tha channel, but the videos for this year was not there, thanks! Thank, [Coke] 14:41
[Coke] .seen 0rir 14:45
tellable6 [Coke], I haven't seen 0rir around, did you mean rir?
[Coke] .seen rir
tellable6 [Coke], I saw rir 2025-03-05T20:38:06Z in #raku: <rir> [tbrowder] I believe the only special aspect of CORE classes is that they automatically exist.
[Coke] any way to get rakubrew to tell me what precomp versions are available? 14:49
wow, I'd love to use presenting.vim to do a simple presentation in vim but the installation instructions are... not. 15:00
15:10 DarthGandalf left 15:14 guifa left 15:23 merp left
Xliff \o 15:24
How can I get a list of the charsets Str.encode supports?
15:26 simcop2387 left
[Coke] I don't think that's introspectable. 15:28
Xliff Where is the list in the code, then?
Str.rakumod?
[Coke] docs.raku.org/type/IO/Handle#method_encoding
Xliff Why no utf32? 15:29
[Coke] src/core.c/Encoding/Registry.rakumod ?
per the second file, looks like utf32 is available on non-moar
I'm assuming it's a SMOP 15:30
Xliff Yep. Just saw that./
[Coke] github.com/rakudo/rakudo/issues/3293
Xliff Thanks, [Coke]
[Coke] me doc bot. me help 15:31
15:31 merp joined
Xliff m: "a".encode.Uni.gist.say' 15:33
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> "a".encode.Uni.gist.say<HERE>'
expecting any of:
infix
infix stopper
statement end
statement modifier
statemen…
Xliff m: "a".encode.Uni.gist.say
camelia No such method 'Uni' for invocant of type 'utf8'
in block <unit> at <tmp> line 1
Xliff m: "A".Uni.say
camelia No such method 'Uni' for string 'A'
in block <unit> at <tmp> line 1
Xliff Hmm... a comment made by lizmat in '24 mentions a .Uni method. 15:34
So, I'm having an existential issue relating to wchar_t. Is it 32 bytes or 64? sizeof on my system says 8. Google says otherwise.
You see my dilema? 15:35
15:42 simcop2387 joined 16:03 jjido joined
[Coke] m: use 6.e.PREVIEW; 16:15
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
use used at line 1 (in Raku please use "v" prefix for pragma (e.g., "use v6;", "use v6.c;") instead)
[Coke] m: use v6.e.PREVIEW
camelia ( no output )
disbot3 <librasteve> SmokeMachine: thanks for the YT link! 16:26
<librasteve> If anyone is wondering I have moved Air::Play to Air::Examples ... the original idea seemed like a good idea at the time, but no point in asking for trouble - HARC stack site will soon be updated 16:27
16:52 librasteve left 17:01 librasteve joined, guifa joined 17:06 librasteve left 17:22 bdju joined 17:23 librasteve joined
[Coke] doing a bunch of rakubrew right now - I did not have to do build-zef when doing a download of prebuilt versions, but now that I'm building specific commits, I have to build-zef each time. 17:28
is this a bug? a feature?
jdv is rakubrew useful for you? 17:30
i used perlbrew for a bit and found it not really helpful. 17:31
[Coke] rakubrew is great for when I need it, ESPECIALLY because a lot of times I don't have to do a build.
and then (right now), when I need to do a bisect on versions and can't really use whateverable, it's handy 17:32
jdv nice
[Coke] (trying to figure out which commit broke 0rir's module 3 years ago)
jdv you dont have to build each own?
be neat if it could use the builds from the mothership 17:33
[Coke] Yah, if I have to do this again, I'll figure that out. :) 17:34
jdv ha 17:35
[Coke] Was hoping to just blin it, but it's against HEAD not published version
jdv hmm? you can spec both endpoints, right?
the rakubrew using rando mothership builds would be cool to brew $sha and zef look and fool around 17:37
or checkout a rando dist commit and muck about 17:38
17:39 guifa left
disbot3 <librasteve> i’ve found rakubrew very useful … on mac and linux … i even quite like the reinstall zef favourites when downloading a new version 17:40
[Coke] the *module* I'm testing is only in github, not in the ecosystem 17:43
jdv ah...
maybe blin could be pointed at a git repo for a dist but that might not be worth it 17:44
[Coke] (it's in the ecosystem but has a bug on the last released version)
17:45 Sgeo joined
Xliff Is the best way to get the first char of a string still $str.comb.head? 17:54
17:55 guifa joined
disbot3 <librasteve> .[0], .first 17:59
<librasteve> with .comb
18:26 jjido left 18:27 librasteve left 18:30 jjido joined, apac joined 18:34 librasteve joined
disbot3 <nahita3882> they give Nil if the string is empty, .substr(0, 1) gives empty string 18:36
<nahita3882> speedwise they seem equal
<nahita3882> paste.debian.net/1383227/ 18:38
18:38 librasteve left 18:50 apac left 18:53 librasteve joined 19:05 wayland76 joined, wayland left 19:08 librasteve left 19:30 guifa left
tbrowder librasteve: have you had a chance to look at my branch next-ver for Mi6::Helper for changes in the README per your suggestions? comments or PR welcome 19:44
19:45 librasteve joined 19:52 DarthGandalf joined
disbot3 <librasteve> comments made yesterday (or did I forget to save?) 19:57
20:18 jjido left
tbrowder ah, let me look... 20:21
20:22 holyghost left
tbrowder can't find any... 20:25
20:30 librasteve left 20:37 librasteve joined
disbot3 <apogee> Lots of SQLite bindings, none seem currently maintained 🤔 Any community preferences? I'm looking to add some native calls to support sqlcipher. 20:44
<librasteve> tbrowder: I took the liberty of closing the issue github.com/tbrowder/Mi6-Helper/issues/19
<librasteve> maybe thats why you cant see it 20:45
<apogee> DBIish high level interface seems... limited?
<librasteve> @apogee I would like (i) all the wood behind one SQLite arrow and (ii) that the Red one wins (since that has the most raku added value) 20:46
<apogee> Red looks nice but uses DBIish under the hood?
<librasteve> lemme see
<apogee> I saw your reported issue on DBIish about it failing SQLite tests on Mac which makes me nervous because I'm on Mac 😄 20:47
<librasteve> DBIish
<librasteve> that's under control 20:48
<apogee> OK, does anyone merge PRs to DBIish? I'll clone the SQLite connector and make a SQLCipher one with the extra calls then add tests.
<librasteve> looks like I made a PR (there was a badly behaved test I moved from /t to /xt) and merged it myself 20:50
<apogee> So if I make one can I link it to you?
<apogee> I'll look at the badly behaved test too, I know the C lib well so if it's an issue there I can probably fix it.
<librasteve> I'm a bit rusty (!) on DBI so would prefer if someone else helps review ...
<apogee> Yeah no worries, as long as I wont be pushing a PR into the void I don't mind. 20:51
<librasteve> or you can just walk me through any stuff I can't fathom
<apogee> Sure
<apogee> Basically sqlcipher is sqlite with 4 added functions: - key (set a global AES key) - key_v2 (set an AES key for a certain schema) - rekey (change the global AES key) - rekey_v2 (change the AES key for a certain schema) It's otherwise an identical API, but it encrypts all your data at rest. 20:53
<apogee> The additional C calls (from an Odin PR I pushed) are: go key :: proc "c" (db: ^Connection, key: rawptr, nKey: c.int) -> c.int --- key_v2 :: proc "c" (db: ^Connection, zDbName: cstring, key: rawptr, nKey: c.int) -> c.int --- rekey :: proc "c" (db: ^Connection, key: rawptr, nKey: c.int) -> c.int --- rekey_v2 :: proc "c" (db: ^Connection, zDbName: cstring, key: rawptr, nKey: c.int) -> c.int --- You call key when creating a new db 20:55
and then every time you open it. rekey to change the key for future sessions.
<librasteve> okay - is this in a PR? 20:56
<apogee> No not yet for DBIish, it will be tonight or tomorrow. Just explaining. 20:57
<librasteve> oh - ha!
<librasteve> thanks - btw a community member (damil) has expressed an interest in helping maintain DBIish ... so I have pinged them 20:58
<apogee> Sweet! I'd be happy to help but I only really know SQLite at a high level, not the other backends.
tbrowder librasteve: my bad, thanks! 20:59
disbot3 <librasteve> also there is an open goal to do data migrations like django does
<librasteve> tbrowder: no problem - thanks for the improvements!! 21:00
<librasteve> guess that would be at Red level
tbrowder ref red, and speaking only for myself, an rdbm novice, i wish there was a good cookbook example for converting just one, simple CSV table, with header, to a RED-managed SQLite table. 21:03
and maybe there is one out there, but i haven't found it yet. 21:04
disbot3 <apogee> In Red? 21:08
21:08 Aedil left
disbot3 <librasteve> yes 21:08
<apogee> Like up/down migrations? I'm not familiar with Django 21:09
<librasteve> yes
<apogee> Hm shouldn't be too hard.
<librasteve> SmokeMachine (often here, aka FCO) is the author ... also a major raku expert btw 21:10
<librasteve> (of Red) ... sure he would be happy to collab 21:11
21:11 jjido joined
disbot3 <apogee> I'd need to get familiar with Red first, right now I need sqlcipher, libpng & notcurses to unblock myself 😄 21:11
<apogee> Then prob build a high level toolkit for TUI building with notcurses because the low level bindings are a little arcane. 21:12
<librasteve> 👍 21:13
<apogee> Something like p5 Curses::UI 21:14
<apogee> or Brick for Haskell if anyone knows it 21:15
<librasteve> sounds good to me
<apogee> So yeah I will probably be deep in NativeCall for at least the next week 😄 21:16
SmokeMachine Please, let me know if I can help some how about Red... 21:27
Red "has" a cookbook: fco.github.io/Red/tutorials/cookbook.html
fco.github.io/Red/ 21:28
the README also has some examples: github.com/FCO/Red?tab=readme-ov-file
and the repo has a examples dir: github.com/FCO/Red/tree/master/examples 21:29
disbot3 <librasteve> tbrowder: chatgpt.com/share/6861b1a0-38a4-80...e23dcaf73f 21:35
<librasteve> ^^ hopefully this will give you a start 21:36
SmokeMachine the model fields are missing `is column` on the fields that are not serial... the DB connection is using the old way... 22:02
22:06 librasteve left
tbrowder librasteve: thanks, i forgot about my new friend, ChatGPT! 22:13
coleman rebooting docs website 22:22
SmokeMachine usercontent.irccloud-cdn.com/file/.../image.png 22:30
www.irccloud.com/pastebin/h3IhqGef/ 22:31
22:35 librasteve joined 22:40 librasteve left 22:41 simcop2387 left 22:44 Guest86 joined 22:45 Guest86 left 22:56 simcop2387 joined 23:03 jjido left 23:10 librasteve joined 23:13 wayland76 left 23:18 librasteve left 23:30 librasteve joined 23:35 librasteve left 23:57 librasteve joined