[00:00] *** HaraldJoerg left [00:00] *** PimDaniel joined [00:00] *** PimDaniel left [00:11] *** MasterDuke left [00:16] *** abraxxa left [00:28] *** pecastro left [00:29] *** abraxxa joined [00:59] *** bigdata joined [01:06] *** daxim left [01:08] *** sampersand joined [01:08] hi all! [01:09] should i be using `is pure` for functions that call other things that may not be pure? eg something like this:  `method add(Value $rhs --> Number) { Number.new: $!data + $rhs }` — the `$rhs.Int` method may not be pure, but if it is, my function is pure [01:10] *** kline left [01:11] also, how should i be creating objects? with positional parameters or keyword  parameters? [01:15] *** daxim joined [01:15] As far as I'm aware, the only thing `is pure` does is allow calls to that function to be constant folded if the value is known (eg. with Literals) [01:16] so i may as well use it in this case? [01:16] eg. sub square($n) is pure { $n ** 2 }; my $x = square(2); # <- since 2 is known at compile time, it may be constant folded [01:17] so you "can" use it on impure subs, but I don't know why you would. [01:17] ah ok [01:17] re: objects, by default, you create them with named args, tho you can create a `multi new` that accepts positional args [01:18] what's more idiomatic? [01:19] wellll... given Raku is related to Perl, the general sentiment is TIMTOWTDI (there is more than one way to do it) [01:19] sure, but TIMTOWTDIBSCINABTE [01:20] so do what you like! but... named args are the default for a reason... they are typically more readable, particularly with multiple args [01:20] äp5 [01:20] if your class instatiation only takes one arg... I'd call that a good candidate to make it also accept a positional arg [01:20] *** mowcat left [01:20] cool ok [01:21] i dont really understand how `new` and `BUILD` relate, and why `has $!foo; sub new($f) { self.bless :$foo }` doesn't work [01:21] if you don't want to write a multi new... I experimented with a Role that does it for you, thought it's not available on the ecosystem [01:21] https://0racle.info/articles/everyone_loves_porgs [01:22] If Porgs was a module, you would just `use Porgs; class Foo does Porgs { ... }` [01:23] yeah. the fact that `...` is an actual thing (for stubbing out classes) tripped me up before lol [01:23] I never published Porgs... but feel free to steal it, rename it, publish, and claim it as your own... i'm not fussed [01:23] does idiomatic raku leave off the trailing `;` at the last statement? what about for multiline statements [01:24] again, I'm not sure the community has really settled on idiomatic ways of doing everything. some people really like to write using as few parens as possible [01:25] yeah makes sense [01:25] i use them a lot because to me it makes things more readable. Do what suits you (tho my recommendation is to learn towards more readable way) [01:25] i just want my code to be as normal as possible lol [01:25] as far as semi's are concerned. i often exclude them on a line if it's the only line in a block [01:26] yeah ok cool [01:26] if I put 2 lines in a block... both will have semi's. that's just how I do [01:26] yeah makes sense [01:27] *** mowcat joined [01:27] is there a way to make infix methods? something like `class Frac { method infix:<+>($rhs) { ... } }` [01:27] as in... infix:<+> that works on your own class. yes, absolutely, but you declare the sub outside your class [01:28] sampersand: you should use `is pure` for things that don't have side effects [01:28] eg 5 + 5 is always the same. "x".IO.slurp is not, even if called close together [01:28] tony: the problem is my thing won't have side effects if the values passed to me dont have side effects [01:29] then you have side effects [01:29] ok cool, so i need to be certain i wont [01:29] m: class M { has $.x }; multi infix:<+>(M $a, M $b) { $a.x ~ $b.x }; say M.new(x => 'A') + M.new(x => 'B') [01:29] elcaro, rakudo-moar 446caae36: OUTPUT: «AB␤» [01:29] you can do a purity check on the arguments [01:29] purity check? [01:29] re inflx: so i always have to declare it outside the class? [01:33] it's a function, so if you declare it inside a class, it's only available inside that class [01:33] presumably you are writing a module that provides a class... you module could also declare (and export) an infix function that handles your class [01:34] ah [01:34]  ok [01:36] yeah, just remember that in Raku, most "operators" (eg. infix) are _just_ functions. Classes do not do operator overloading [01:37] not in the traditional sense, at least [01:37] so, to learn new languages i write a dumb little programming language [01:38] i usually use operator overloading, but here it doesn't make as much sense. in the dumb little language, `+` is both concatenation and addition, but in raku (and perl) they're separate functions. should i just scrap the operator overloading idea entirely? [01:38] *** asymptotically left [01:38] *** asymptotically joined [01:40] that's really a design decision you need to make. Perl needed to make this distiction because it had no types, & even tho Raku has types, i think this distinction is still valuable (readability!) [01:40] but using plus for concat and addition is not inherently "wrong" and plenty of popular languages do it [01:41] yeah, totally agree. I originally overloaded them, but then i realized it wasn't really following raku style—`String.new("12") + Number.new(1)` would be expected to return 13 [01:42] *** JRaspass left [01:42] so now im doing `String.new("12").add(Number.new(1))` [01:51] *** marcusr left [01:52] *** bigdata left [01:53] *** marcusr joined [02:02] *** sampersand left [02:14] *** kvw_5 joined [02:17] *** kvw_5_ left [02:19] *** rypervenche joined [02:23] m: sub x is pure { }; sub y { }; say "x {'is pure' if &x.^can('is-pure')}\ny {'is pure' if &y.^can('is-pure')};"; # sampersand [02:23] tonyo, rakudo-moar 446caae36: OUTPUT: «x is pure␤y ;␤» [02:29] *** mowcat left [02:33] *** orinthe joined [02:34] elcaro: I think even with types it’s not a bad idea to have the two. Strings and numbers are (especially in Raku) fundamentally distinct scalar values, and many classes can reasonably behave in both contexts [02:36] re sampersand’s desire for custom infixes, the only problem with them is you have to ensure that the infix sub is in the scope. Otherwise, if you pass the two objects to a sub where it’s not declared, it’ll try to do standard math. Almost makes you wish there was a MATH method similar to ACCEPTS that was called, but understandably that would probably destroy performance [03:18] *** asymptotically left [03:18] *** asymptotically joined [03:24] *** sampersand joined [03:26] i dont really understand how private fields (ie `$!field` ), `bless` and `new` work. This only works when i have `$.field`  : `role Foo { has $!field; method new($field) { self.bless :$field } }` [03:45] *** gnufr33dom joined [03:45] *** kaiwulf left [03:47] beuler? D: [04:08] *** cooper left [04:10] only public fields are set automatically [04:10] at least for the default BUILD [04:10] *** sampersand left [04:21] *** sampersand joined [04:22] i dont really understand how private fields (ie `$!field` ), `bless` and `new` work. This only works when i have `$.field` : `role Foo { has $!field; method new($field) { self.bless :$field } }` [04:42] *** sampersand left [04:52] *** neshpion left [04:55] *** brtastic joined [05:13] *** vike left [05:24] *** aluaces joined [05:24] *** jmcgnh left [05:24] *** rindolf joined [05:29] *** jmcgnh joined [06:07] *** parabolize left [06:32] *** orinthe left [06:32] *** orinthe joined [06:46] .tell sampersan maybe this helps (re: $!private attrs, `bless` and `new`) https://gist.github.com/0racle/959a94fdb38b76436850c2a150150dfc [06:46] elcaro, I haven't seen sampersan around, did you mean sampersand? [06:46] .tell sampersand maybe this helps (re: $!private attrs, `bless` and `new`) https://gist.github.com/0racle/959a94fdb38b76436850c2a150150dfc [06:46] elcaro, I'll pass your message to sampersand [06:51] *** jmerelo joined [07:01] *** vike joined [07:03] *** ufobat joined [07:05] *** andrzejku joined [07:14] *** sno left [07:19] *** sjm_uk joined [07:19] *** sno joined [07:22] *** rindolf left [07:30] *** jmerelo left [07:33] *** elcaro joined [07:43] *** Sgeo left [07:44] *** hlafarge joined [07:48] *** patrickb joined [07:59] *** rindolf joined [08:09] *** abraxxa left [08:10] *** hlafarge left [08:12] *** aborazmeh joined [08:12] *** abraxxa joined [08:13] *** domidumont joined [08:15] *** squashable6 left [08:17] *** aborazmeh left [08:17] *** abraxxa left [08:17] *** aborazmeh joined [08:17] *** squashable6 joined [08:18] *** abraxxa joined [08:26] *** aborazmeh left [08:32] *** gnufr33dom left [08:47] *** dakkar joined [08:52] *** pecastro joined [08:59] *** hlafarge joined [09:08] *** jmerelo joined [09:10] *** domidumont left [09:20] *** JRaspass joined [09:29] *** wamba joined [09:38] *** orinthe left [09:43] *** orinthe joined [09:48] *** Scimon joined [09:56] *** PimDaniel joined [09:56] \o [09:56] o/ [09:57] \o/ [09:57] I'v found a simple way to EXPORT_OK some tags : without writing "is export" on each of them : https://pastebin.com/HBSnq6s5 [09:57] *** Nyx left [10:07] *** PimDaniel left [10:24] *** PimDaniel joined [10:24] I wanted to go further just for fun and bring some variable from TestImport module into MYTAG package, but i still strugle to interpolate and... [10:25] Here is the code , the question is at the line HERE IS THE QUESTION. Thanks in advance. [10:25] https://pastebin.com/W0H1bfJW [10:34] *** PimDaniel left [10:39] *** PimDaniel joined [10:46] *** andrzejku left [10:48] *** PimDaniel left [10:59] *** thundergnat left [11:04] *** MasterDuke joined [11:22] *** synthmeat joined [11:27] *** MasterDuke left [11:27] *** hlafarge left [11:29] *** PimDaniel joined [11:29] *** PimDaniel left [11:38] *** sno left [11:59] jmerelo: Good morning. You around? [12:00] .tell jmerelo Considering https://github.com/perl-foundation-outreach/gsoc-2021-ideas/blob/main/raku/gtk-4-bindings.md, I wouldn't mind serving as an additional mentor to the project, assuming finalyst doesn't mind. Especially given: https://github.com/Xliff/p6-GtkPlus [12:00] Xliff, I'll pass your message to jmerelo [12:02] .tell jmerelo Wasn't planning on updating that module to :ver<4> until it was available on distributions. So maybe sometime next year I can bring a more complete version to Raku. However Raku has some serious issues with its installers to handle large scale projects. Things zef does not handle well at all. [12:02] Xliff, I'll pass your message to jmerelo [12:06] *** Black_Ribbon left [12:09] *** MasterDuke joined [12:31] *** sno joined [12:34] *** ugexe joined [12:35] As always, zef just passes a dist to Rakudo to install. There is literally nothing that can be done to improve what xliff is talking about outside of rakudo itself [12:36] ugexe: Use of parallel rakudo process for precomp. [12:36] Zef has no hand in any of that [12:36] Why would you think it did? [12:36] I don't. That's the problem. [12:37] For large scale projects, the installer must be able to apply tricks to speed up the installation process. [12:37] If you think that is not zef's domain, it isn't. [12:37] Another installer must then fit that niche. [12:37] Raku has no way of doing this [12:38] precomp happens inside Raku own install method [12:38] Yes, it does. I spent a good few months writing code that inspired nine to add the proper code to do it. [12:38] I think you’re confused the [12:39] ugexe: Will 'raku -e 'use Module' precompile said module? [12:39] For a CURFS report sure [12:39] that isn’t CURI [12:39] Then I am not speaking CURI [12:40] And CURI is insufficient for large scale deployment. [12:40] Then why would an installer matter [12:40] installers use CURI for installation... that’s the point [12:40] ugexe: See https://github.com/Xliff/p6-GtkPlus [12:40] I’m aware [12:40] Installing that module will take zef over an hour. [12:41] install it with core Raku will take an hour then [12:41] Would you find that time acceptable? [12:41] So another solution needs to be developed. [12:41] That's what I would like to discuss. [12:41] Great , so quit blaming zef everything you have this issue [12:42] ugexe: I am not blaming zef. I am saying that zef is insufficient and too limited to solve the problem by your own admission. [12:42] YOU are saying I am blaming zef. [12:43] See: https://github.com/Xliff/p6-GtkPlus/blob/master/scripts/dependency-build.pl6 for an attempt at a solution. [12:43] You have said what you have said. If you wish to continue saying it I will continue to correct it [12:43] But you aren't correcting. You are starting an argument where there isn't one. [12:44] And you continue to ignore the attempt at furthering raku. [12:44] How would you define it? [12:46] Well one thing that lessens my involvement is accusations [12:46] *** ugexe left [12:46] Xliff: the https://www.gtk.org/screenshots/ from your readme looks like a dead link :) [12:46] tadzik: Thanks! I'll fix. [12:47] ugexe: Well, by doing so, you are saying you are unwilling to be involved in the solution. [12:47] Xliff, I'll pass your message to ugexe [12:47] And that behavior is the reason why Raku will not grow beyond small scripts. [12:50] For the record, I would take zef at least 6000 seconds to install p6-GtkPlus from scratch. [12:51] By attempting to parallel precompile and somehow moving the compunits to their final destination, this can be shortend to something akin to 1600 seconds. [12:51] What would be the best way to attain this with current Raku? [12:58] *** matiaslina left [13:04] Xliff, ugexe: I think a rather large misunderstanding is at work. I suspect Xliff does not intend to give zef any blame in the long install times, but wants to say that installation (obviously using zef) is currently slow and we should do something about it (not implying zef needs to change), that's why he insisted on already having spent some time [13:04] on rakudos internals, where the real bottleneck is. [13:04] 2021-02-01T09:32:41Z #raku-dev patrickb not sure i'd seen that problem-solving PR. yeah, i'll add a comment there [13:04] 2021-02-01T09:34:03Z #raku-dev patrickb and yep, no problems here not doing *BSDs right away, i'd just suggest making it clear in the proposal that what you're proposing would be able to be easily extended for them [13:05] patrickb: Thank you for calmly stating what I indended. [13:09] On the other hand ugexe took Xliffs repeated use of the word 'zef' as his primary target of concern. I do admit that with a different angle the statements can be read as such. [13:10] *** domidumont joined [13:14] If in doubt try really hard to presume honest motives on the other side. If things get out of hand it's usually safe to assume there is some kino of missunderstanding or (and that's often the worst case) ortogonal focuses of interest on the same subject without realizing. [13:22] *** aluaces left [13:25] *** JRaspass left [13:25] *** PimDaniel joined [13:25] \o [13:26] Is there something that can emulate libio-string-perl? [13:26] I need to write into a fixed buffer. [13:26] *fixed sized. [13:27] *** Some-body_ joined [13:27] PimDaniel: Why not use Buf? [13:28] * PimDaniel Xliff: I do no know , i look at this ... [13:28] https://stackoverflow.com/questions/62160299/raku-equivalent-of-java-stringbuffer-stringbuilder [13:28] ^^ Not fixed length, though., [13:29] *** DarthGandalf left [13:29] *** Some-body_ is now known as DarthGandalf [13:31] *** aluaces joined [13:32] Xliff: Thank's! [13:32] PimDaniel: Working on another one for you, one sec. [13:37] Is there a difference between Str and str type? [13:38] PimDaniel: yes, see https://docs.raku.org/language/nativetypes [13:38] ok [13:38] *** Sgeo joined [13:40] PimDaniel: How's this? Feel free to fork. [13:44] Interesting! [13:46] I will have to make a virtual screen buffer. Despite that the fact fixed size is not, it can be controlled. [13:47] but this is not my priority for now. [13:47] I asked another question this morning and nobody replied, i suppose people are just busy. [13:48] https://pastebin.com/W0H1bfJW [13:49] The question is into the post if you may look at it. Thank's in advance, I cannot interpolate. Nothing is urgent. [13:50] The question does not treat about what i'm trying to do but why it does not work. for now i just learn Raku. [13:55] back later... [13:55] *** PimDaniel left [13:56] *** sjm_uk left [14:23] *** mowcat joined [14:27] *** linkable6 left [14:29] *** linkable6 joined [14:32] *** wamba left [14:45] *** HaraldJoerg joined [14:45] *** MasterDuke left [14:48] *** MasterDuke joined [14:48] *** JRaspass joined [14:56] *** sno left [14:57] *** wamba joined [15:08] *** wamba left [15:09] *** wamba joined [15:26] *** patrickb left [15:35] if you have a way to make precomp faster, it should be in core. [15:36] *** parabolize joined [15:45] <[Coke]> .tell pimdaniel - your paste doesn't compile, guessing one of those notes should be a comment. [15:45] [Coke], I'll pass your message to PimDaniel [15:46] *** neshpion joined [15:47] *** patrickb joined [16:07] *** ufobat left [16:07] *** ufobat joined [16:22] *** JRaspass left [16:25] *** PimDaniel joined [16:26] .tell Coke i know it does not. [16:26] PimDaniel, I'll pass your message to [Coke] [16:26] .tel Coke i'll modify it for it compiles... [16:26] 2021-02-03T15:45:35Z #raku <[Coke]> pimdaniel - your paste doesn't compile, guessing one of those notes should be a comment. [16:26] .tell Coke i'll modify it for it compiles... [16:26] PimDaniel, I'll pass your message to [Coke] [16:30] *** PimDaniel left [16:30] <[Coke]> . [16:49] *** PimDaniel joined [16:49] .tell Coke this code works but there's a question about interpolation into it, thanks Coke! [16:49] PimDaniel, I'll pass your message to [Coke] [16:50] .tell Coke https://pastebin.com/CYNEFSpx [16:50] PimDaniel, I'll pass your message to [Coke] [16:53] *** PimDaniel left [17:10] *** ufobat left [17:26] *** vike left [17:28] *** jmerelo left [17:30] *** JRaspass joined [17:33] *** dakkar left [17:35] *** Scimon left [17:43] *** aindilis left [17:49] *** domidumont left [17:51] *** MasterDuke left [17:53] *** abraxxa left [18:15] *** sno joined [18:20] *** vike joined [18:23] *** Xliff_ joined [18:26] *** Xliff left [18:33] *** __jrjsmrtn__ joined [18:35] *** _jrjsmrtn left [18:38] <[Coke]> . [18:38] 2021-02-03T16:49:45Z #raku Coke this code works but there's a question about interpolation into it, thanks Coke! [18:38] 2021-02-03T16:50:10Z #raku Coke https://pastebin.com/CYNEFSpx [18:59] * [Coke] wonders what PimDaniel is trying to do in that example. [19:01] He heu hey whoou [19:07] *** aborazmeh joined [19:12] *** aborazmeh left [19:13] *** sno left [19:43] releasable6: status [19:43] El_Che, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged [19:43] El_Che, Details: https://gist.github.com/78b176a65ba91b91c8600708ed22f608 [19:44] A bit passive aggressive there, releasable6. [19:44] ypu have to read it in a NY accent [19:45] >merge conflict on your Pr's branch "I'M PUSHIN' HERE" [19:45] aha [19:46] I prefer an upolite bot over folk who release software that is not ready. [19:46] *** tejr left [19:46] *** tejr joined [19:49] why not have both? [19:59] *** MasterDuke joined [20:00] *** patrickb left [20:23] *** MasterDuke left [20:30] *** MasterDuke joined [20:50] why make a machine polite? [20:52] *** aindilis joined [20:53] *** brtastic left [20:59] *** tejr left [20:59] *** tejr joined [21:03] *** rindolf left [21:06] perry; releasable6 is a bit testy because there was no 2021.01 release [21:06] just change it to 2021.02 then [21:07] https://github.com/rakudo/rakudo/wiki/ChangeLog-Draft [21:07] click edit and change [21:09] anybody can do it, I think [21:09] well, anybody except me :) [21:09] *** seanrobert joined [21:10] releasable6: status [21:10] MasterDuke, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged [21:10] MasterDuke, Details: https://gist.github.com/4e6e8e04f94da8eb1120d6e390085f48 [21:10] not so fast, there's a cache [21:12] aaaaah [21:12] actually, that's a bit different [21:12] I looked into the source code [21:12] what you actually need to change is this: https://github.com/rakudo/rakudo/blob/master/docs/release_guide.pod#planned-future-releases [21:12] *** squashable6 left [21:13] sorry, I got confused [21:13] *** squashable6 joined [21:16] *** CesareoAguirre joined [21:27] releasable6: status [21:27] lizmat, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged [21:27] lizmat, Details: https://gist.github.com/a14a661121edbfc688e53ec26e871350 [21:27] releasable6: status [21:27] lizmat, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged [21:27] lizmat, Details: https://gist.github.com/38fe13546c626cc149f86566af1cd46d [21:27] I've changed planned future releases [21:31] releasable6: status [21:31] AlexDaniel`, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged [21:31] AlexDaniel`, Details: https://gist.github.com/8ece87865a55b1e29e3fb1a4cf77b446 [21:31] hmmmmmm [21:32] I think that's something I wanted to fix for a long time :) [21:32] it doesn't react on webhooks, just pulls periodically [21:32] give it a minute it'll fix itself probably [21:37] *** getdevvved joined [21:38] hellooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo [21:40] *** Black_Ribbon joined [21:43] hi [21:43] releasable6: status [21:43] AlexDaniel`, Next release in ≈16 days and ≈21 hours. 1 blocker. 22 out of 111 commits logged [21:43] AlexDaniel`, Details: https://gist.github.com/5f4410cc934dd79d48af20f124de664c [21:43] lizmat: ↑ it works! Thanks! [21:43] woah epic [21:44] im new to perl but im interested in learning [21:46] *** getdevvved left [21:46] but not interested in staying, apparently [21:49] *** aindilis left [21:52] *** peanut87 joined [21:52] *** peanut87 left [21:57] *** seanrobert left [22:06] *** CesareoAguirre left [22:20] *** MasterDuke left [22:21] *** MasterDuke joined [22:27] *** Xliff_ left [22:31] *** defaultxr left [22:39] *** mowcat left [22:44] hey all, quick nativecall question here. there's a structure that I need to work with (though it can be a plain old pointer if need be) that has a statically allocated array in the middle. as far as i can tell, there isn't a way to provide hints about these sorts of things to nativecall, is there? worst comes to worse i'll just use a CPointer repr with malloc and be done with it. [22:45] (for the whole struct) [22:57] *** wamba left [22:57] *** HaraldJoerg left [23:05] i just went with the malloc workaround [23:05] works [23:22] *** defaultxr joined [23:25] summerisle: HAS int32 @.x[] is CArray [23:25] i figured it would be HAS, good to know about specifying size. thanks. [23:37] *** simcop2387 joined [23:38] *** Xliff joined [23:50] *** kaiwulf joined [23:59] *** defaultxr left