00:01 Sgeo joined 00:04 librasteve_ left 00:06 jjido left 00:29 m6locks joined 01:26 Manifest0 left 02:38 kylese left, hulk joined 02:42 m6locks left 03:15 hulk left, kylese joined 03:17 m6locks joined 03:18 todd2 joined, yewscion joined 03:26 yewscion left 04:02 zetaaaa left 04:32 yewscion joined 04:36 yewscion left
Geth advent/main: edad83e4e2 | (Haytham Elganiny)++ (committed using GitHub Web editor) | raku-advent-2024/authors.md
Update authors.md
04:49
04:56 Aedil joined 05:03 m6locks left 05:08 simcop2387 left, simcop2387 joined 05:46 Chanakan5591 joined 05:47 m6locks joined, Chanakan left 06:28 m6locks left
todd2 how do I ask zef to tell me what an installed package dependencies are? 06:36
.vushu @antononcube I have pushed your fix for raku.land/zef:vushu/FEN::Grammar, thx 🙂 06:42
06:46 yewscion joined 06:53 yewscion left 07:23 m6locks joined 07:34 Sgeo left 07:54 MoC joined, yewscion joined 07:58 yewscion left 09:08 todd2 left 09:16 dakkar joined 09:22 Manifest0 joined 09:33 yewscion joined 09:38 yewscion left 09:47 sena_kun joined 10:04 sena_kun left
timo todd2: zef has the command "zef depends" + the identity of the package 10:05
tellable6 timo, I'll pass your message to todd2
timo oh i'm too late 10:06
librasteve maybe todd2 is in the us of a
patrickb what's the quickest way to turn a Seq into a list? 10:22
librasteve formally - .list 10:30
I often use [] but that gets you and array
or via list assignment maybe (needs a slip) my @l = |$s 10:32
oops that's an Array too, I mean
my List $l = |$s
10:37 yewscion joined
fwiw this is the kind of raku weeds that makes me always prefer and propose beginners use @ and [] whenever they want to deal with many things ;-) ... Seq and List bring things like laziness and "immutability", but honestly I do not think most raku code needs to optimize for these 10:37
10:42 yewscion left
nahita3882 i benchmarked $s.list, $s.cache, $s.eager and @$s 10:52
eager scales badly and @$s and .cache seems to be the quickest ones and are about the same
paste.debian.net/1336285/
> my List $l = |$s interestingly, after this, $l.WHAT says (Slip) 10:57
librasteve I had forgotten about the @$s list contextualizer - thanks for the reminder - on speed, does it depend how the Seq is defined - I guess you are using PullOne on an Iterator behind the scenes?
nahita3882 i tried to define the Seq once in a "setup" code, but since Seqs are usable only 1 time, couldn't do, e.g., 100 runs 10:59
so instead, I slipped the Seq generation into the benchmarked code fragments themselves along with listifications
librasteve m: say Slip ~~ List 11:00
evalable6 True
Raku eval True
nahita3882 so the absolute timings posted do include the Seq generation, but it's the same Seq generation for all, so the relative differences shouldn2t be affected
oh, so a Slip is a List too 11:01
librasteve so the quickest answer is |$s ;-)
nahita3882 yeah i timed that and it's as fast as .list but .cache seems to be slightly faster on large Seqs 11:02
e.g., after 100,000 elements 11:03
but yeah it's the quickest to type and very fast, so :p
librasteve but slip doesn't reify the elems 11:06
nahita3882 it doesn't?
librasteve m: my $r = 1..Inf; say my $rr = |$r; say $rr[3];
evalable6 (...)
4
Raku eval (...) 4
librasteve maybe cache does reify the elements either 11:07
11:08 m6locks left
m: my $r = 1..Inf; say my $rc = $r.cache; say $rc[3]; 11:08
Raku eval (...) 4
evalable6 (...)
4
librasteve doesnt I mean
nahita3882 i think in these cases it knows it's an Infinite list and becomes a List that is lazy (.is-lazy holds) 11:10
because .list or .Array even also works the same
librasteve ok - must reread the docs 11:11
nahita3882 oh I think you are right... 11:12
only .eager reifies on the spot and timings i reported are fake
librasteve I assumed that .cache would just remember the elems of the Seq that had been already accessed, presumably 0..X (where X is the highest index accessed before)
nahita3882 sorry and thanks for the insight 11:13
librasteve and there must be "near infinite" Seqs and ones that get harder the larger they are
well there is raku and then there is deep raku 11:14
antononcube @vushu Thanks! I pushed a new version of “JavaScripdt::D3” that depends on the new version of “FEN::Grammar”. 11:37
tbrowder hi. do i rember there is a way to create a routine to keep its data during a program's lifetime? i would like it to contain a persistent hash. 11:40
which is also modifiable. 11:41
i searched the docs for persistent, save, but nada yet... 11:42
there is a method cache mentioned... 11:43
static... 11:47
conceptionally a globally available class object with variable internal state... 11:51
ok, class with a 'my' variable...trying that... 12:04
may be easier to use a global hash... 12:08
12:41 apac joined
timo tbrowder: you were probably looking for "state", but do remember that it's not thread-safe on its own, you will need to use something like locking if you need that 12:42
m: sub collect($in) { state @foo; @foo.push: $in; say "i have @foo.tail(3)"; }; collect(1); collect(2); collect(3); collect(4); collect(5) 12:43
camelia i have 1
i have 1 2
i have 1 2 3
i have 2 3 4
i have 3 4 5
tbrowder timo: thanks. yes 'state', normally i don't explicitly use threads, but good to kmow. lizmat showed me recently how to use hyper and such. but i have no need for most of my use cases. 13:26
timo ok, it's a good thing to keep in mind if you expect that code to be re-used, is all 13:27
tbrowder you bet! 13:28
is there a thread concern about a global hash?
lizmat any hash is not thread-safe unless access to it is protected by a lock 13:29
tbrowder ok, thank you both 13:30
lizmat of course, if you use a lexical hash in a subroutine or method and inside of that lexical scope you don't start any other threads, you don't have to worry about that 13:32
which is in like 99.8% of the cases
but hashes an sich are **not** thread safe, as are arrays
timo arrays are thread safe as long as you don't resize them concurrently to any other kind of access 13:33
tbrowder so a 13:34
timo and they cannot be lazy either
tbrowder is there any way to check if a program is thread safe? 13:36
timo you mean static analysis?
it's a huge field of research, and kind of rust's "killer feature" 13:37
there is also a difference between "just" thread safe as in "does not crash" and "still gives the correct results when parallelized" 13:38
tbrowder some company was giving "free" static analyses for open source projects at one time...
timo do you mean coverity check? 13:39
tbrowder yes, that's it
timo we've run that against moar a couple times
13:40 yewscion joined
tbrowder in my "linear" code is it fairly easy to lock-protect a global hash just to be safe? 13:42
timo yeah, if you make sure to decont on the way out of the lock's protect block, too. otherwise code can assign to the container you got out of the hash while it was protected and still change the hash outside of the protected time and explode stuff 13:43
tbrowder it's actually accessed by subroutines 13:44
13:44 yewscion left
tbrowder sounds like a good advent article: using global hashes and other containers... 13:48
my hash keys are integers, its values are read-only class objects 13:50
the insertions are by a subroutine, i'm not gonna not worry about it until i get multiple users on the same host... 13:52
*double negative!! you know what i'm trying to say :-D 13:55
lizmat multiple simultaneous requests is what you need to worry about :-) 13:56
14:01 orangebot joined
antononcube @lizmat and @trbrowder First complete version of my Raku Advent post "Don't use Forsyth-Edwards Notation to play chess with LLMs". (It needs more proofreading and example plots.) github.com/antononcube/RakuForPred...th-LLMs.md 14:01
I forgot what the next steps -- I think I have to make a draft blog post in Raku Advent blog, right? 14:02
lizmat yes, please 14:03
antononcube @lizmat Ok. 14:04
[Coke] needs to write something that lets me register things I install with zef and auto-install them if they're not present in my current zef. (cal, uni ...) 14:10
timo sounds like a thing for devcontainers :) 14:11
[Coke] wonders how many hours it would take to do that so he could then be a little lazy later.
antononcube A related sentiment -- if I knew how much effort that first Advent article of mine would take, I would have skipped it. (Well, I skipped a related chess-plotting one last year too, but I guess I forgot why...) 14:14
tbrowder lizmat: to my eyes, i don’t see any possibility of multiple simultaneous requests… 14:15
lizmat are you using Cro ? 14:16
tbrowder moi? no 14:17
lizmat then you don't have to worry :-)
tbrowder [Coke]: i have a module in work to do that… 14:18
name is Zef::DB
right now the exe need manual editing to insert the module names of interest. 14:30
14:44 zetaaaa joined
donaldh lizmat: I _may_ have an advent contribution. But I'd appreciate a review before I commit more time to it. It's a blog post I started writing a while back but parked and never got back to. 14:44
timo o/ donaldh
donaldh o/ timo 14:45
s/while/couple of years/ 14:46
timo ahem, "big mood" 14:47
had i started with the MoarVM Remote Debugger improvements half a year ago, maybe there would be enough for a blog post already 14:49
advent post, even
donaldh maybe a progress report? 14:52
14:52 Sgeo joined
librasteve @antononcube github.com/Raku/advent ... the instructions are here 14:52
14:54 apac left
[Coke] (progress) yes, that would be great. :) 14:57
timo progress report would be good for a blog post, but i'm not sure if it fits into advent 14:58
14:58 Guest89 joined, Guest89 left
Geth advent: librasteve++ created pull request #113:
add librasteve to authors
15:03
librasteve Im surprised that raku Array is thread safe (iirc there were previous discussions about this) - personally i would treat anything that is writeable and global as thread unsafe - you can use .map to self modify an Array depending on the previous value - so that could easily get stomped on 15:07
(which is also a bad pattern imo, but raku gives us the power to do bad stuff) 15:08
(and you can write bad stuff in rust if you want, too)
timo there are operations on array that are, and operations that are not thread safe 15:09
or rather, there are sets of operations that are thread safe only when they are combined amongst themselves, and operations that make even the otherwise thread safe operations unsafe to run at the same time 15:11
coleman Re: Advent, I love the Christmas season. But if I could accomplish anything 24 days in a row with consistency I'd probably be a lot richer and thinner 15:12
librasteve oh - I think I misinterpreted lizmats post but hashes an sich are not thread safe, as are arrays
timo fortunately we can spread the advent posts between multiple authors 15:13
coleman ah okay I can commit to 1 then!
timo 24 days of blogging in a row sounds like a recipe for burnout, unless it's like "microblogging" 15:14
antononcube Is the generation of Chernobyl snow-globes (via Raku) a relevant Christmas topic? Here are some examples: imgur.com/a/q2fyCuP 15:15
coleman I've put a stake in the ground to make sure I do it. github.com/Raku/infra/issues/58 And anyone is allowed to nudge me there (infra is private to GitHub members, though) 15:16
antononcube That link cannot be reached. 15:17
timo yeah that's a private repo
antononcube Agh, yeah, private members only...
timo not much to see in that issue, just that coleman wants to write an advent post
antononcube Good -- go coleman!
coleman Yea, we keep infra private in case we need to post PII to get in contact with people. 15:18
Anyone can pop into #raku-infra to talk, though
timo i'm not sure what to think about the concept of chernobyl snow globes 15:19
antononcube @timo It is too much dark humor. Those kind of globes can be bought though: www.etsy.com/listing/1554977885/ch...at-ukraine 15:21
librasteve think I prefer englishman, irishman, scotsman jokes 15:23
(which I have stopped telling btw) 15:25
timo i like puns and wordplay quite a bit (not very good at it though)
antononcube Agh. I was experimenting with "three vegan women went into a bar" jokes exactly one year ago. 15:26
I mean, LLM generation of those jokes.
timo "dad jokes" i find enjoyable usually
coleman anton those LLMs are going to get you in trouble someday 15:27
verify all joke output!
librasteve I think a bad sense of humour == more likely to prefer raku over python 15:28
antononcube 😮 , seems likely...
timo by bad sense of humour you mean good sense of humour right?
librasteve precisely
antononcube @timo How do you call an elephant that does not matter? (ʇuɐɥdǝꞁǝɹɹI) 15:30
librasteve always wondered how I was going to spend my last 4 minuts
antononcube @lizmat Posting answers to "bad dad jokes" is perfect use case for "Acme::Text::UpsideDown". 15:31
@librasteve I am considering withdrawing my ROFL emoji from your bad sense of humor comment. (Because of your subsequent clarifications.) 15:33
"Bad sense of humor" in what direction: more likely to make bad jokes, or more likely to not get a joke? 15:35
@timo What do you call a lazy kangaroo? (oʇɐʇod ɥɔnod ∀) 15:37
timo ah, not bad
15:40 librasteve_ joined
antononcube Elephant one is from the book "Really Bad Dad Jokes"; the kangaroo one is from a co-worker's father. 15:41
librasteve_ run this script.raku > index.html and open in a browser for HTMX driven jokes www.irccloud.com/pastebin/8DwTdjSy 15:42
timo interesting, using ; in an array instead of , because ; doesn't go into sub argument lists? 15:45
that's something i never thought of
antononcube @librasteve I run that script -- good HTMX example! 15:56
15:57 yewscion joined
El_Che it looks like a curl | sh kind of hack :P 16:01
16:11 MoC left 16:15 apac joined
librasteve timo: well spotted - yes, ; suppresses the tendency for sub argument list to slurp all - since i played wiht perl and raku a long time I do not think that this is an accident but another tool in the box Larry gave us 16:17
timo it was easy to spot given the comment explaining it :D 16:18
librasteve you know it may be possible to make a full slang for functional HTML, but imo we have such a lot of good stuff in the regular raku sub parse syntax that is easier to reuse in a case likt this
it's one thing to see and read the comment, but another to appreciate the subtle distinction 16:19
other things we take for granted are the inner -> outer parsing of nested subs
timo now you're making me wonder if there's a lot of value to be gained from a slang (or just sub/operator based DSL) to make nativecall-using code a little less nasty for the more esoteric use cases involving lots of casts 16:20
librasteve the thing is that Larry was very, very good at making syntax and his slangs are had to beat
hard 16:21
coleman There's huge value. Isn't that what rust's bindgen does?
timo i assume that's more like gptrixie?
coleman i dunno gptrixie but in bindgen you feed it a header file, basically 16:22
timo i'm thinking less about the part where you have to write your sub and class definitions
librasteve forgive me _ i do not mean to downplay the need for a bindgen in raku
timo yeah, gptrixie also gets fed a header file and it makes raku code with NativeCall from functions, structs, classes, enums, typedefs, and whatnot
librasteve but I am happy to take whatever works best in practice to make it work
coleman whoa never heard of gptrixie; haven't written native bindings, though
timo native bindings aren't so bad, but it can definitely get a bit annoying 16:23
coleman yea; a good FFI design is tough, though. Some libraries don't play nice. 16:24
timo the most annoying i've seen so far was to translate ioctl calls; there's a strange macro involved that nom-noms a struct
librasteve rust is terrible since it has no ABI
coleman haha okay 16:25
I wrote a ton of rust a few years ago. It's tooling is so impressive. But I felt like I wasn't learning anything. All the cool stuff was a proc macro or unsafe or...bindings 16:26
I was missing something, I felt. Like, Rust was written by people who were really good with C/C++ and I wanted to learn those lessons too. Even if it meant giving up a package manager and dealing with segfaults. 16:27
I am still not good at C but I go through the motions. timo thanks for putting up with me
timo ok now that i look at it more closely it's not inscrutable, but i was talking about the _IOWR macro down here codebrowser.dev/linux/linux/includ...ctl.h.html 16:28
the part that takes a struct literally just uses sizeof on it 16:29
i was afraid there would be some incredible deep magic and i just didn't look more closely and just had vscode / clangd give me the number that comes out at the end
tbrowder ref BEGIN block: i can do lots of stuff setting file content and such, but so far i'm unable to call a sub. any way to do that? 16:48
Geth advent/main: 7085b36bdc | librasteve++ (committed using GitHub Web editor) | 2 files
add librasteve to authors (#113)

  * README to 2024
  * add self
16:58
advent/main: 970a2f1117 | (Coleman McFarland)++ (committed using GitHub Web editor) | raku-advent-2024/authors.md
Add Coleman to authors

Refs github.com/Raku/infra/issues/58
17:14
timo coleman: i'm not sure what i'm "putting up" with exactly ;) 17:34
coleman :) 17:35
17:39 dakkar left
ugexe [Coke]: you can sort of do that using rakubrew + --with now that github.com/Raku/App-Rakubrew/issues/80 is resolved 18:03
$ rakubrew exec --with moar-2024.03 zef list --installed site vendor 2> /dev/null | rakubrew exec zef install -
19:16 yewscion_ joined 19:19 yewscion left 20:40 jjido joined 20:57 yewscion joined, yewscion_ left 21:00 sena_kun joined
tbrowder .ask antononcube mathematica is offering a good deal for a perpetual hobbyist license. thinks 21:15
tellable6 tbrowder, I'll pass your message to antononcube
tbrowder *think it's worth it for a mostly raku junky? 21:16
teatime how much? 21:33
21:36 apac left 21:40 zenmov joined 21:42 orangebot left 22:05 _________ left 22:19 zenmov left 22:21 sena_kun left
antononcube Yes is is worth it. It is the most complicated program in world. It is best "intellectual property" to have per dollar. 22:21
tellable6 2024-11-21T21:15:05Z #raku <tbrowder> antononcube mathematica is offering a good deal for a perpetual hobbyist license. thinks
antononcube Also, see the "RakuMode" paclet: resources.wolframcloud.com/PacletR.../RakuMode/ 22:22
@teatime Currently, the so called "Black Friday" discounts show ≈$250 for the hobbyists perpetual license, and ≈$50 for students. 22:24
teatime ty
antononcube cdn.discordapp.com/attachments/633...8a0d4& 22:25
22:47 zenmov_ joined 22:48 zenmov_ left, zenmov_ joined
roguerakudev lizmat - I have a draft of a Raku Advent article, and I was wondering whether I should add it to the authors.md list or if that's for the organizers to do later 22:59
23:04 Aedil left
tbrowder antononcube: any way to mention Mathematica's "RakuMode" on Raku.land, perhaps? 23:06
antononcube Hm… I don’t think so. But I have mentioned “RakuMode” in Reddit. 23:07
23:22 ilogger2_ left
tbrowder thnx 23:24
23:34 thebbo joined 23:35 ilogger2 joined
antononcube @tbrowder Are you an Advent posts editor? 23:37
I.e. of the corresponding GitHub repository.
23:41 yewscion left 23:44 jjido left