🦋 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:06
yewscion joined
00:10
yewscion left
00:11
yewscion joined
00:20
yewscion left
00:36
simcop2387 left
00:39
yewscion joined
00:47
yewscion left
00:50
yewscion joined
00:56
yewscion left
01:10
yewscion joined
01:17
yewscion left
01:19
yewscion joined
01:24
yewscion left
01:27
kylese left,
kylese joined
01:29
yewscion joined
01:33
yewscion left
01:41
yewscion joined
01:46
yewscion left
01:47
yewscion joined
01:52
yewscion left
01:56
kylese left
01:57
kylese joined
02:06
yewscion joined
02:11
yewscion left
02:15
kylese left,
kylese joined
|
|||
SmokeMachine | Voldenet: I was playing with your idea and it is very interesting! This is where I got for now: usercontent.irccloud-cdn.com/file/.../image.png | 02:26 | |
02:31
yewscion joined
02:39
yewscion left
02:45
yewscion joined
02:53
yewscion left
02:58
Aedil joined
|
|||
Voldenet | SmokeMachine: I like the idea of using field names as actual service names, feels really idiomatic | 03:02 | |
without `is keyed<a>` sort of stuff | 03:03 | ||
03:04
yewscion joined
|
|||
Voldenet | I think it should be possible to do `OAuthClient $oauth is keyed(OAUTH_CLIENT1)` or something similar in case someone wants to use constant variable as service name… | 03:06 | |
`OAuthClient $oauth_client1` would prevent you from finding the symbol that easily - you gotta do text search for `oauth_client1` and hope to find all attrs/parameters with the name | 03:07 | ||
03:08
yewscion left
|
|||
Voldenet | (I've used DI that way and that's the biggest problem with using string as dependencies, bigger than typos or misconfigurations) | 03:08 | |
as an aside, containers are not agreeing with how to resolve the missing keyed dependency | 03:10 | ||
in your example when requesting `Int $b` some containers give you first registered service, some containers give you last, some containers give you first unnamed, some containers give you an error | 03:11 | ||
it's actually major headache, because it means you can't trivially replace them even if they mostly share the same interface | 03:12 | ||
what's worse, some libraries/frameworks may require one behavior, different from others | 03:13 | ||
03:28
yewscion joined
03:40
yewscion left
03:45
kylese left
03:48
kylese joined
03:51
yewscion joined
03:56
yewscion left
04:07
yewscion joined
04:10
Guest19 joined
04:13
arkiuat left
04:15
yewscion left
|
|||
Guest19 | have we considered moving rakudo away from github/microsoft? or the weekly away from wordpress/matt mullenweg? | 04:24 | |
04:27
arkiuat joined
05:04
arkiuat left
05:33
arkiuat joined
05:37
yewscion joined
05:38
arkiuat left
05:43
yewscion left
05:48
yewscion joined
05:54
yewscion left
05:57
yewscion joined
06:02
yewscion left
06:07
arkiuat joined
06:12
arkiuat left
06:13
yewscion joined
06:22
yewscion left
06:27
Sgeo left
06:42
yewscion joined
06:43
arkiuat joined
06:47
arkiuat left
06:51
yewscion left
06:54
arkiuat joined
07:23
apac joined
07:37
Guest15 joined,
apac left
07:55
dakkar joined
07:57
Guest15 left
07:59
arkiuat left
08:01
Guest19 left
08:06
yewscion joined
08:11
yewscion left
08:23
lichtkind joined
08:26
yewscion joined
08:30
arkiuat joined
08:31
yewscion left
08:35
arkiuat left
08:39
Aedil left
08:42
yewscion joined
08:51
yewscion left
08:53
arkiuat joined
08:58
arkiuat left
09:07
yewscion joined
09:12
yewscion left
|
|||
wayland76 | Guest19: To what? | 09:20 | |
09:23
yewscion joined
09:27
arkiuat joined
|
|||
melezhik. | Sourcehut, codeberg , Gitlab - not too many alternatives. But GH still has advantages not presented there, imho . | 09:30 | |
09:31
arkiuat left
09:33
yewscion left,
yewscion joined
|
|||
librasteve | there is definitely a desire to move from Wordpress since Matt imploded (for me) … I build Wordpress sites for money and HARC is born out of “this sucks, I like to code (in raku), there must be a better way” … initially HARC is going to check off static sites (think updated raku.org) so blog is a bit downstream since I want to write my text in markdown and i want to have raku code highlighting plus will need | 09:39 | |
authentication which needs forms (which is current wip) and CRUD | |||
09:39
melezhik joined
|
|||
SmokeMachine | Voldenet: I think `has $.oauth is named-on-deps<blablabla>` would make sense and should be possible (or anything similar). How should be defined what to do with a not exact match? Something like this? `has $.bla is dying-on-unnamed-dep`, `has $.ble is first-unnamed-dep`, `has $.bli is last-unnamed-dep`. Does something like that make sense? Or should it be defined on the container? | 09:39 | |
melezhik | Testing my irc client … | 09:40 | |
librasteve | otoh, I treat GH as a necessary evil for now … but one day an alternate would be nicer | ||
09:42
yewscion left
09:45
arkiuat joined
09:58
yewscion joined
10:03
yewscion left
10:09
yewscion joined
10:14
yewscion left
10:29
wayland76 joined,
wayland left
10:52
arkiuat left
11:11
arkiuat joined
11:16
arkiuat left
|
|||
Voldenet | SmokeMachine: I don't know, there hasn't been a single good aproach to this I've seen – I've seen it done as switchable container defaults (it obviously breaks library expectations) or per-dependency config (pointless, because not idiomatic) | 11:30 | |
oh, also I've seen per-parameter configurators (if you see class X having parameter Y, use this dependency, otherwise use that), it helps resolving some problems which are headache to figure out | 11:34 | ||
I guess the latter is fine, but nobody uses named dependencies soon enough | 11:35 | ||
11:38
arkiuat joined
11:47
yewscion joined
12:03
yewscion left,
nine left
12:04
nine joined
12:26
yewscion joined
12:31
yewscion left
12:35
yewscion joined
|
|||
antononcube | GitHub is way too convenient. Also, it renders Jupyter notebooks. From 2019 to 2022 I have been "forced" to use GitLab and Bitbucket, I they were not providing that many features as GitHub. (They might now, but I am not that curious to try them.) | 12:38 | |
12:41
yewscion left
|
|||
SmokeMachine | Voldenet: I forgot to show how my try is working about mro and roles... for now it looks like this: usercontent.irccloud-cdn.com/file/.../image.png | 13:29 | |
Voldenet: do you mind if I continue playing with that? I'm having a lot of fun. And do you mind if I keep asking your opinion? | 13:31 | ||
librasteve | yeah this was the sadya nutella way … kill with kindness | 13:42 | |
Xliff | \o | 13:43 | |
What happens during zef STAGING phase? | |||
SmokeMachine | ??? | ||
Xliff | What operations are performed? | ||
SmokeMachine | I may have missed something... | 13:45 | |
SmokeMachine is confused | |||
Xliff | zef performs a staging phase during install. I was wondering what happens in that phase. | 13:46 | |
This may be a ugexe question. | 13:47 | ||
SmokeMachine | Voldenet: maybe I'm going too far... but I thought about this: usercontent.irccloud-cdn.com/file/.../image.png | 14:05 | |
14:06
yewscion joined
|
|||
SmokeMachine | any opinion about that ☝️? | 14:06 | |
14:11
yewscion left
|
|||
Voldenet | SmokeMachine: I don't mind when people have fun in general :> | 14:28 | |
SmokeMachine | Voldenet: I mean, I don't want to still your ideas... :) | ||
steal? rob... | 14:29 | ||
14:30
yewscion joined
|
|||
SmokeMachine | (sorry... may English is too bad...) | 14:30 | |
Voldenet | you can't steal them, because they're already stolen from various DI implementers ;p | ||
but yeah, I admit that on top of being useful, this allows a lot of room for experiments | 14:31 | ||
SmokeMachine | in portugese we say that a robber that steals from another robber has 100 years of pardon ("ladrao que rouba ladrao tem 100 anos de perdao") | 14:32 | |
Voldenet | :) | ||
SmokeMachine | Voldenet: do you have an opinion about my extrapolation? (I mean my last image) | 14:33 | |
Voldenet | it actually makes sense to have scoping simplified like that, but | 14:34 | |
there should be a way to use two scopes at the same time | 14:35 | ||
it's actually very useful, because it allows you to move or copy data between scopes | |||
14:35
yewscion left
|
|||
SmokeMachine | could you point me to an example of that? | 14:36 | |
Voldenet: usercontent.irccloud-cdn.com/file/.../image.png | 14:41 | ||
14:42
yewscion joined
14:47
yewscion left
14:52
Aedil joined
|
|||
SmokeMachine | Voldenet: import-deps adds a container as parent of the current conteiner: usercontent.irccloud-cdn.com/file/.../image.png | 14:56 | |
15:02
arkiuat_ joined
15:04
arkiuat left
15:06
yewscion joined
|
|||
Voldenet | SmokeMachine: example what I have in mind (of course "new-scope" is not implemented) 0x0.st/8xIs.raku | 15:25 | |
I didn't even syntax-check it, but I hope it's more or less clear what should be possible | 15:29 | ||
also, one thing is pretty important - scopes should be implicit in most cases | 15:30 | ||
so, background thread should have its scope, request also should etc. | 15:31 | ||
I think assigning the scope to deps could work if you skip the fact that scopes dispose - this is actually important for things like db connections | 15:32 | ||
so `deps { … }` should mean `$di.new-scope; …; $di.dispose` - it's fine in most cases | 15:33 | ||
the "explicit" management should be used only in cases like the example - where you really want to dance with multiple containers and do stuff | 15:34 | ||
SmokeMachine | but isn't enough to left the scope to it be destroyed? | 15:36 | |
Voldenet | nope, GC with finalization queue can cause a lot of db/http connections being alive | 15:37 | |
and if there's not much memory pressure, they can survive for a long time | |||
so, when request ends, scope should have something like '.cleanup', that would automatically run all the cleanups registered in scope | 15:38 | ||
since we're in DI world, it's easy to define `register(Http::Client, -> Cleanups $x { my $c = Http::Client.new; $x.on-cleanup({ $c.close-all }); $c })` | 15:40 | ||
it's even worse when you do connection pooling, 100 connections is plenty, but if you don't release them back to the pool, you'll going to exhaust the pool quicker than DESTROY can kick in | 15:43 | ||
s/you'll/you're/ | |||
but with di automatically doing cleanup after every request: `register(Connection, -> ConnectionPool $p, Cleanups $x { my $c = $p.rent; $x.on-cleanup({ $p.release }); $c });` would solve the problem | 15:45 | ||
erm, it should be $c.release | 15:46 | ||
maybe more idiomatic than .new-scope/.cleanup would be .enter-scope, .on-leave, .leave | 15:47 | ||
and in fact: `register(Connection, -> ConnectionPool $p, Scope $s { my $c = $p.rent; $s.on-leave({ $p.release }); $c });` - using "Scope" as di variable could effectively mark its lifetime as Scope-bound | 15:48 | ||
SmokeMachine | or maybe if using `deps {...}`, maybe it could use `deps { LEAVE do-release; ... }` ? | 15:57 | |
16:37
dakkar left
|
|||
SmokeMachine | Voldenet: maybe I went too far again: usercontent.irccloud-cdn.com/file/.../image.png | 16:47 | |
17:01
RakuGuest joined
17:08
apac joined
17:30
RakuGuest left
18:02
librasteve_ joined
|
|||
jubilatious1_98524 | Matt? | 18:13 | |
librasteve | www.reddit.com/r/Wordpress/comment...down_from/ | 18:17 | |
SmokeMachine | Voldenet: github.com/FCO/Deps | 18:24 | |
librasteve | SmokeMachine: thanks for the lesson in traits ... hopefully my latest commit works for you | 18:28 | |
SmokeMachine | :) I'm running the tests now | 18:39 | |
librasteve: merged! | 18:40 | ||
18:45
MoC joined
|
|||
antononcube | Cannot make much sense of it. Good to know, anyway. | 18:48 | |
librasteve | SmokeMachine: thanks! | 19:03 | |
@antononcube there is no sense in what Matt is doing with Wordpress - time to bail | 19:04 | ||
antononcube | My WordPress blogs are too "popular", so, I will be very slow at that... 🙂 | 19:05 | |
librasteve | well seems like we will need to export / import ... rome wasn't built in a day - my advice is to have your own domain name | 19:40 | |
20:16
Aedil left
20:33
yewscion left
21:01
MoC left
|
|||
SmokeMachine | Is there a way to changes a sub’s signature wrapping it? | 21:03 | |
21:06
yewscion joined
|
|||
SmokeMachine | m: sub a($a) { say $a }; &a.wrap: sub () { nextwith 42 }; a # I mean something like this | 21:07 | |
camelia | ===SORRY!=== Error while compiling <tmp> Calling a() will never work with declared signature ($a) at <tmp>:1 ------> $a }; &a.wrap: sub () { nextwith 42 }; <HERE>a # I mean something like this |
||
SmokeMachine | m: sub a($a?) { say $a }; &a.wrap: sub () { nextwith 42 }; a # if I make it optional, it works… but I didn’t want that… | 21:08 | |
camelia | 42 | ||
21:12
yewscion left
21:15
apac left
21:37
yewscion joined
21:39
Xliff left
21:42
yewscion left
22:06
yewscion joined
22:12
yewscion left
22:43
yewscion joined
22:47
yewscion left
22:55
lichtkind left
23:04
melezhik left
23:05
wayland76 left
23:15
yewscion joined
23:20
yewscion left
23:29
yewscion joined
23:34
yewscion left
|
|||
ab5tract | It should at least work for this case: | 23:36 | |
m: sub a($a) { say $a }; &a.wrap: sub (--> Int) { nextwith 42 }; a() | |||
camelia | ===SORRY!=== Error while compiling <tmp> Calling a() will never work with declared signature ($a) at <tmp>:1 ------> a.wrap: sub (--> Int) { nextwith 42 }; <HERE>a() |
||
ab5tract | that is, when the sub signature guarantees a value | 23:37 | |
SmokeMachine: would you mind making a ticket for this? | |||
23:39
Sgeo joined
23:52
yewscion joined
|
|||
SmokeMachine | ab5tract: github.com/rakudo/rakudo/issues/5890 | 23:56 |