vaninwagen has quit [Quit: Connection closed for inactivity]
dougmacdoug has quit [Quit: dougmacdoug]
jemc has quit [Ping timeout: 248 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 248 seconds]
chasegeaton has joined #ponylang
jemc has joined #ponylang
jemc has quit [Ping timeout: 268 seconds]
dougmacdoug has joined #ponylang
<strmpnk>
I'm trying to understand the impact of this change: https://github.com/ponylang/ponyc/pull/2499 I'm not sure I see an obvious way to use iftype when my return value is exactly A from the parameter.
<strmpnk>
An example would be a `class X[A: Any #read]` with a field of type `(A | None)` and a partial method which returns an A and calls error otherwise.
<strmpnk>
`match field | let a: A => a else error end` used to work. I see that this is broken intentionally but maybe I'm missing how the feature is supposed to be implemented (documentation around this part of the language seems to be sparse or missing).
<SeanTAllen>
do you have a small example of the problem you can put in the playground and drop a link here strmpnk ?
<strmpnk>
Yeah. Let me remove some of my experimental code first and recompile with master ponyc.
<strmpnk>
Works with the release compiler but it fails with a " this capture violates capabilities, because the match would need to differentiate by capability at runtime instead of matching on type alone" error on master.
<SeanTAllen>
ah
<SeanTAllen>
ok
<strmpnk>
So that specific commit is the one that breaks the code.
<strmpnk>
I'm trying to understand the intended alternative code.
<strmpnk>
But iftype isn't documented and I'm not sure if it applies here.
<SeanTAllen>
Looking at it, the reason it complains is, I think that it will never be A
<strmpnk>
It clearly can be though. It's confused by the None alternative.
<SeanTAllen>
how can _data be something other than None?
<strmpnk>
With update.
<strmpnk>
My example runs and returns 42.
jemc has joined #ponylang
<strmpnk>
I just default it to none for this toy example.
<SeanTAllen>
ah update is missing
<SeanTAllen>
im not sure how this compiled before
<strmpnk>
?
<SeanTAllen>
o wait
<strmpnk>
I see it in the code on the playground.
<SeanTAllen>
sorry copy and paste fail
<SeanTAllen>
i missed the update()
<SeanTAllen>
it was below the fold for me
<SeanTAllen>
that changes everyhting
<strmpnk>
Sorry that it's contrived but I wanted to keep it minimal.
<SeanTAllen>
im definitely the wrong person to help with that praetonus would definitely be better
<SeanTAllen>
thats an area that I get confused with
<strmpnk>
Same. Generics in Pony seem very powerful but I don't have a good enough handle yet so I was surprised to see this when I recompiled (I haven't been using a packaged compiler .. maybe I should switch to a tagged release.)
<SeanTAllen>
Now Im watching mitchell and webb thanks to twitter
khan has quit [Quit: khan]
khan has joined #ponylang
mollymorphic has quit [Ping timeout: 252 seconds]
SenasOzys has quit [Ping timeout: 268 seconds]
khan has quit [Client Quit]
khan has joined #ponylang
chasegeaton has quit [Ping timeout: 245 seconds]
dougmacdoug_ has joined #ponylang
brainproxy has joined #ponylang
<dougmacdoug_>
if I pass val objects around which actor is responsible for gc when there are no more handles?
dipin has quit [Quit: dipin]
<strmpnk>
The actor that creates something will eventually collect it.
<strmpnk>
The current GC follows the ORCA protocol. There's a paper on it that's pretty accessible. In general, it uses Pony's own actor messaging to create a sort of delayed reference count for sent capabilities.
<dougmacdoug_>
so if i have 1 actor creating a bunch of objects for other actors to use (as vals) .. the objects expire frequently .. so I am thinking about creating an actor that recreates itself.. is that a pattern in pony?
<strmpnk>
I wouldn't know... I'm still working on learning Pony but I would gather that it's not from the code I've read.
<dougmacdoug_>
yeah. me too.. i have done a bit with pony but I am just getting to the point now where I am trying to use a lot of actors and passing a lot of data.. so its becoming a concern
<strmpnk>
It certainly makes sense to have multiple actors if you thing the reclamation work is too high for one but I'm not sure the actors will be your bottleneck at that point.
<strmpnk>
Instead, the allocating actor could do less work, ensuring computations are never blocking resource collections.
<dougmacdoug_>
pony doesnt gc until the actor is no longer referenced.. so my plan is essentially clone the allocating actor and let it expire so it can gc all the old objects it created
<dougmacdoug_>
unless thats not true
<strmpnk>
As usual, see if you can measure the time being spent first. I don't have a good intuition around that vs the way jemalloc interacts with the schedulers so I'd definitely try to run a few variants to see how the runtime behaves.
<strmpnk>
Oh? Actors should GC when they are in a receivable state, regardless of tags.
<strmpnk>
Many pony systems have long running actors. Of course shutting an actor down will mean it's collected references and that can't be done until the count goes to zero, but it shouldn't have much overhead outside of memory bookkeeping if you aren't using the actor anymore.
<dougmacdoug_>
well, i have to get the messaging system working first then run some tests under load and measure the memory .. then i will decide if I need to build a phoenix actor
<strmpnk>
Definitely follow up with what you find. It's always good to hear how things are working for people.
<dougmacdoug_>
will do
dougmacdoug has quit [Quit: dougmacdoug]
endformationage has quit [Quit: WeeChat 1.9.1]
chasegeaton has joined #ponylang
patroclos has joined #ponylang
jemc has quit [Ping timeout: 248 seconds]
_whitelogger has joined #ponylang
_whitelogger_ has quit [Remote host closed the connection]