🦋 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:00 HaraldJoerg left, PimDaniel joined, 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
sampersand hi all! 01:08
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:09
01:10 kline left
sampersand also, how should i be creating objects? with positional parameters or keyword  parameters? 01:11
01:15 daxim joined
elcaro 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:15
sampersand so i may as well use it in this case? 01:16
elcaro eg. sub square($n) is pure { $n ** 2 }; my $x = square(2); # <- since 2 is known at compile time, it may be constant folded
so you "can" use it on impure subs, but I don't know why you would. 01:17
sampersand ah ok
elcaro re: objects, by default, you create them with named args, tho you can create a `multi new` that accepts positional args
sampersand what's more idiomatic? 01:18
elcaro wellll... given Raku is related to Perl, the general sentiment is TIMTOWTDI (there is more than one way to do it) 01:19
sampersand sure, but TIMTOWTDIBSCINABTE
elcaro 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
timotimo äp5
elcaro 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
sampersand cool ok 01:20
i dont really understand how `new` and `BUILD` relate, and why `has $!foo; sub new($f) { self.bless :$foo }` doesn't work 01:21
elcaro 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
0racle.info/articles/everyone_loves_porgs
If Porgs was a module, you would just `use Porgs; class Foo does Porgs { ... }` 01:22
sampersand yeah. the fact that `...` is an actual thing (for stubbing out classes) tripped me up before lol 01:23
elcaro I never published Porgs... but feel free to steal it, rename it, publish, and claim it as your own... i'm not fussed
sampersand does idiomatic raku leave off the trailing `;` at the last statement? what about for multiline statements
elcaro 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:24
sampersand yeah makes sense 01:25
elcaro 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)
sampersand i just want my code to be as normal as possible lol
elcaro as far as semi's are concerned. i often exclude them on a line if it's the only line in a block
sampersand yeah ok cool 01:26
elcaro if I put 2 lines in a block... both will have semi's. that's just how I do
sampersand yeah makes sense
01:27 mowcat joined
sampersand is there a way to make infix methods? something like `class Frac { method infix:<+>($rhs) { ... } }` 01:27
elcaro as in... infix:<+> that works on your own class. yes, absolutely, but you declare the sub outside your class
tonyo 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
sampersand tony: the problem is my thing won't have side effects if the values passed to me dont have side effects
tonyo then you have side effects 01:29
sampersand ok cool, so i need to be certain i wont
elcaro m: class M { has $.x }; multi infix:<+>(M $a, M $b) { $a.x ~ $b.x }; say M.new(x => 'A') + M.new(x => 'B')
evalable6 AB
tonyo you can do a purity check on the arguments
sampersand purity check?
re inflx: so i always have to declare it outside the class?
elcaro 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
sampersand ah 01:34
 ok
elcaro yeah, just remember that in Raku, most "operators" (eg. infix) are _just_ functions. Classes do not do operator overloading 01:36
not in the traditional sense, at least 01:37
sampersand so, to learn new languages i write a dumb little programming language
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
01:38 asymptotically left, asymptotically joined
elcaro 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
sampersand 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:41
01:42 JRaspass left
sampersand so now im doing `String.new("12").add(Number.new(1))` 01:42
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
tonyo 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
evalable6 x is pure
y ;
02:29 mowcat left 02:33 orinthe joined
guifa 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:34
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 02:36
03:18 asymptotically left, asymptotically joined 03:24 sampersand joined
sampersand 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:26
03:45 gnufr33dom joined, kaiwulf left
sampersand beuler? D: 03:47
04:08 cooper left
guifa only public fields are set automatically 04:10
at least for the default BUILD
04:10 sampersand left 04:21 sampersand joined
sampersand 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:22
04:42 sampersand left 04:52 neshpion left 04:55 brtastic joined 05:13 vike left 05:24 aluaces joined, jmcgnh left, rindolf joined 05:29 jmcgnh joined 06:07 parabolize left 06:32 orinthe left, orinthe joined
elcaro .tell sampersan maybe this helps (re: $!private attrs, `bless` and `new`) gist.github.com/0racle/959a94fdb38...a150150dfc 06:46
tellable6 elcaro, I haven't seen sampersan around, did you mean sampersand?
elcaro .tell sampersand maybe this helps (re: $!private attrs, `bless` and `new`) gist.github.com/0racle/959a94fdb38...a150150dfc
tellable6 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, 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, abraxxa joined 08:13 domidumont joined 08:15 squashable6 left 08:17 aborazmeh left, abraxxa left, aborazmeh joined, 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
PimDaniel \o 09:56
tyil o/
sjn \o/ 09:57
PimDaniel I'v found a simple way to EXPORT_OK some tags : without writing "is export" on each of them : pastebin.com/HBSnq6s5
09:57 Nyx left 10:07 PimDaniel left 10:24 PimDaniel joined
PimDaniel 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:24
Here is the code , the question is at the line HERE IS THE QUESTION. Thanks in advance. 10:25
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, hlafarge left 11:29 PimDaniel joined, PimDaniel left 11:38 sno left
Xliff jmerelo: Good morning. You around? 11:59
.tell jmerelo Considering github.com/perl-foundation-outreac...ndings.md, I wouldn't mind serving as an additional mentor to the project, assuming finalyst doesn't mind. Especially given: github.com/Xliff/p6-GtkPlus 12:00
tellable6 Xliff, I'll pass your message to jmerelo
Xliff .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
tellable6 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
ugexe 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:35
Xliff ugexe: Use of parallel rakudo process for precomp. 12:36
ugexe Zef has no hand in any of that
Why would you think it did?
Xliff I don't. That's the problem.
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.
Another installer must then fit that niche.
ugexe Raku has no way of doing this
precomp happens inside Raku own install method 12:38
Xliff Yes, it does. I spent a good few months writing code that inspired nine to add the proper code to do it.
ugexe I think you’re confused the
Xliff ugexe: Will 'raku -e 'use Module' precompile said module? 12:39
ugexe For a CURFS report sure
that isn’t CURI
Xliff Then I am not speaking CURI
And CURI is insufficient for large scale deployment. 12:40
ugexe Then why would an installer matter
installers use CURI for installation... that’s the point
Xliff ugexe: See github.com/Xliff/p6-GtkPlus
ugexe I’m aware
Xliff Installing that module will take zef over an hour.
ugexe install it with core Raku will take an hour then 12:41
Xliff Would you find that time acceptable?
So another solution needs to be developed.
That's what I would like to discuss.
ugexe Great , so quit blaming zef everything you have this issue
Xliff 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.
See: github.com/Xliff/p6-GtkPlus/blob/m...-build.pl6 for an attempt at a solution. 12:43
ugexe You have said what you have said. If you wish to continue saying it I will continue to correct it
Xliff But you aren't correcting. You are starting an argument where there isn't one.
And you continue to ignore the attempt at furthering raku. 12:44
How would you define it?
ugexe Well one thing that lessens my involvement is accusations 12:46
12:46 ugexe left
tadzik Xliff: the www.gtk.org/screenshots/ from your readme looks like a dead link :) 12:46
Xliff tadzik: Thanks! I'll fix.
ugexe: Well, by doing so, you are saying you are unwilling to be involved in the solution. 12:47
tellable6 Xliff, I'll pass your message to ugexe
Xliff And that behavior is the reason why Raku will not grow beyond small scripts.
For the record, I would take zef at least 6000 seconds to install p6-GtkPlus from scratch. 12:50
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
patrickb 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.
tellable6 2021-02-01T09:32:41Z #raku-dev <MasterDuke> patrickb not sure i'd seen that problem-solving PR. yeah, i'll add a comment there
2021-02-01T09:34:03Z #raku-dev <MasterDuke> 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
Xliff patrickb: Thank you for calmly stating what I indended. 13:05
patrickb 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:09
13:10 domidumont joined
patrickb 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:14
13:22 aluaces left 13:25 JRaspass left, PimDaniel joined
PimDaniel \o 13:25
Is there something that can emulate libio-string-perl? 13:26
I need to write into a fixed buffer.
*fixed sized.
13:27 Some-body_ joined
Xliff PimDaniel: Why not use Buf? 13:27
PimDaniel Xliff: I do no know , i look at this ... 13:28
Xliff stackoverflow.com/questions/621602...ingbuilder
^^ Not fixed length, though.,
13:29 DarthGandalf left, Some-body_ is now known as DarthGandalf 13:31 aluaces joined
PimDaniel Xliff: Thank's! 13:32
Xliff PimDaniel: Working on another one for you, one sec.
PimDaniel Is there a difference between Str and str type? 13:37
moritz PimDaniel: yes, see docs.raku.org/language/nativetypes 13:38
PimDaniel ok
13:38 Sgeo joined
Xliff PimDaniel: How's this? Feel free to fork. 13:40
PimDaniel Interesting! 13:44
I will have to make a virtual screen buffer. Despite that the fact fixed size is not, it can be controlled. 13:46
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.
pastebin.com/W0H1bfJW 13:48
The question is into the post if you may look at it. Thank's in advance, I cannot interpolate. Nothing is urgent. 13:49
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:50
back later... 13:55
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, MasterDuke left 14:48 MasterDuke joined, JRaspass joined 14:56 sno left 14:57 wamba joined 15:08 wamba left 15:09 wamba joined 15:26 patrickb left
tonyo if you have a way to make precomp faster, it should be in core. 15:35
15:36 parabolize joined
[Coke] .tell pimdaniel - your paste doesn't compile, guessing one of those notes should be a comment. 15:45
tellable6 [Coke], I'll pass your message to PimDaniel
15:46 neshpion joined 15:47 patrickb joined 16:07 ufobat left, ufobat joined 16:22 JRaspass left 16:25 PimDaniel joined
PimDaniel .tell Coke i know it does not. 16:26
tellable6 PimDaniel, I'll pass your message to [Coke]
PimDaniel .tel Coke i'll modify it for it compiles...
tellable6 2021-02-03T15:45:35Z #raku <[Coke]> pimdaniel - your paste doesn't compile, guessing one of those notes should be a comment.
PimDaniel .tell Coke i'll modify it for it compiles...
tellable6 PimDaniel, I'll pass your message to [Coke]
16:30 PimDaniel left
[Coke] . 16:30
16:49 PimDaniel joined
PimDaniel .tell Coke this code works but there's a question about interpolation into it, thanks Coke! 16:49
tellable6 PimDaniel, I'll pass your message to [Coke]
PimDaniel .tell Coke pastebin.com/CYNEFSpx 16:50
tellable6 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
[Coke] . 18:38
tellable6 2021-02-03T16:49:45Z #raku <PimDaniel> Coke this code works but there's a question about interpolation into it, thanks Coke!
2021-02-03T16:50:10Z #raku <PimDaniel> Coke pastebin.com/CYNEFSpx
[Coke] wonders what PimDaniel is trying to do in that example. 18:59
perry He heu hey whoou 19:01
19:07 aborazmeh joined 19:12 aborazmeh left 19:13 sno left
El_Che releasable6: status 19:43
releasable6 El_Che, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged
El_Che, Details: gist.github.com/78b176a65ba91b91c8...08ed22f608
perry A bit passive aggressive there, releasable6. 19:44
El_Che ypu have to read it in a NY accent
perry >merge conflict on your Pr's branch "I'M PUSHIN' HERE" 19:45
El_Che aha
gfldex I prefer an upolite bot over folk who release software that is not ready. 19:46
19:46 tejr left, tejr joined
El_Che why not have both? 19:49
19:59 MasterDuke joined 20:00 patrickb left 20:23 MasterDuke left 20:30 MasterDuke joined
tonyo why make a machine polite? 20:50
20:52 aindilis joined 20:53 brtastic left 20:59 tejr left, tejr joined 21:03 rindolf left
lizmat perry; releasable6 is a bit testy because there was no 2021.01 release 21:06
AlexDaniel` just change it to 2021.02 then
github.com/rakudo/rakudo/wiki/ChangeLog-Draft 21:07
click edit and change
anybody can do it, I think 21:09
well, anybody except me :)
21:09 seanrobert joined
MasterDuke releasable6: status 21:10
releasable6 MasterDuke, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged
MasterDuke, Details: gist.github.com/4e6e8e04f94da8eb11...e390085f48
AlexDaniel` not so fast, there's a cache
aaaaah 21:12
actually, that's a bit different
I looked into the source code
what you actually need to change is this: github.com/rakudo/rakudo/blob/mast...e-releases
21:12 squashable6 left
AlexDaniel` sorry, I got confused 21:13
21:13 squashable6 joined 21:16 CesareoAguirre joined
lizmat releasable6: status 21:27
releasable6 lizmat, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged
lizmat, Details: gist.github.com/a14a661121edbfc688...c26e871350
lizmat releasable6: status
releasable6 lizmat, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged
lizmat, Details: gist.github.com/38fe13546c626cc149...66af1cd46d
lizmat I've changed planned future releases
AlexDaniel` releasable6: status 21:31
releasable6 AlexDaniel`, Next release will happen when it's ready. 1 blocker. 22 out of 110 commits logged
AlexDaniel`, Details: gist.github.com/8ece87865a55b1e29e...a4cf77b446
AlexDaniel` hmmmmmm
I think that's something I wanted to fix for a long time :) 21:32
it doesn't react on webhooks, just pulls periodically
give it a minute it'll fix itself probably
21:37 getdevvved joined
getdevvved hellooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo 21:38
21:40 Black_Ribbon joined
AlexDaniel` hi 21:43
releasable6: status
releasable6 AlexDaniel`, Next release in ≈16 days and ≈21 hours. 1 blocker. 22 out of 111 commits logged
AlexDaniel`, Details: gist.github.com/5f4410cc934dd79d48...f124de664c
AlexDaniel` lizmat: ↑ it works! Thanks!
getdevvved woah epic
im new to perl but im interested in learning 21:44
21:46 getdevvved left
eseyman but not interested in staying, apparently 21:46
21:49 aindilis left 21:52 peanut87 joined, 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
summerisle 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:44
(for the whole struct) 22:45
22:57 wamba left, HaraldJoerg left
summerisle i just went with the malloc workaround 23:05
works
23:22 defaultxr joined
tonyo summerisle: HAS int32 @.x[<size>] is CArray 23:25
summerisle 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