<EEVV>
why is that whenever I ask a question here I answer it myself in 20 mins max
<vaninwagen>
it is the rubber-duck effect
<EEVV>
oh
<vaninwagen>
it is quite powerful
<EEVV>
yes I agree
<vaninwagen>
the pony openssl/libressl bindings do not expose any symmetric or asymmetic cyphers atm, only some hash functions afaik
<EEVV>
vaninwagen: I do have a question because I'm not sure how to do this... I want my TCPListener to keep track of TCPConnections is this a problem?
<Candle>
Heh. I wonder how many others actually have a rubber duck near their computer ¬_¬
<EEVV>
oh but can I directly interface with OpenSSL from pony?
<vaninwagen>
i have a small pony here
<vaninwagen>
via ffi for sure
<EEVV>
is ffi the `@function_goes_here()` thing
<vaninwagen>
yep
<EEVV>
this is ok also because I have written a prototype of my project in C so it shouldn't be too hard... not sure exactly how pony threads work but I hope openssl is thread safe
_whitelogger has joined #ponylang
endformationage has joined #ponylang
aturley has quit [Quit: aturley]
beardhatcode has joined #ponylang
<beardhatcode>
Why can I call a box method on an iso ?
<vaninwagen>
Because iso is a subtype of box
<vaninwagen>
That is you can safely use an iso as if it were a box
<SeanTAllen>
EEVV: the area you will run into problems with Pony and C projects with threading are primarily with C libraries that either: 1) use globals 2) use thread local variables.
<beardhatcode>
@vaninwagen is it because this "Automatic receiver recovery" ?
<beardhatcode>
Because this would be aliases right, violating the iso
<vaninwagen>
Right, yeah
<vaninwagen>
Forgot the aliasing of the receiver
<beardhatcode>
On the page of recovery in the tutorial. That it can be used " “Extract” a mutable field from an iso and return it as an iso.". doesn't that violate the iso principle? You can't send the initial iso anymore right? Because you have an iso alias to one of it's internals. (What is wrong with my train of tought here?)
<EEVV>
vaninwagen I wanted to use SSL but I don't know if that one has the specific RSA I need
<vaninwagen>
EEVV: you want to use the RSA key for an SSL connection or did you mean something else?
sheerluck has quit [Quit: Leaving]
<SeanTAllen>
beardhatcode: im not sure what that "extract" is referring to
EEVV has quit [Ping timeout: 256 seconds]
aturley has joined #ponylang
profetes has joined #ponylang
<profetes>
hi Sean, thanks for the comment. You were referring to the original code, or the new minimal case I created and inserted into the issue?
<SeanTAllen>
Original code
<SeanTAllen>
I will update to clarify
<profetes>
btw, I fixed my code we were discussing back then and I got it working correctly for Ss as well (periodical checking with Timer, instead of callbacks). It's on my github. But it still does not do GCing.
<SeanTAllen>
I can't comment on that. I don't know what "fixed" means. The previous code, I don't think it should have been gcing. I can't comment on it not doing it now.
<profetes>
Sure, that's fine. I also reviewed screenshots you sent - and if I'm reading them correctly - GCing did not happen, not for me, nor for you. But let's drop that program already :) The main thing i'm interested now is how to write programs that return values, but actors can be GCed. This new code in the issue addresses that. And it is much much simpler. I'll try to attend the PonySync this week to answer/ask questions faster,
<profetes>
that typing them here :)
<SeanTAllen>
i really dont understand that question
<SeanTAllen>
"how to write programs that return values"
<SeanTAllen>
what does that mean?
SeanTAllen_ has joined #ponylang
anthonybullard_ has joined #ponylang
<profetes>
I mean my typical cases, where Main spawns actors that do some work (map-reduce pattern), and then Main collects the results to process them further or write them to terminal/file. My approach so far does not allow GC apparently, I'm asking for proper architecture to let GC work.
wyvern_ has joined #ponylang
emilbayes_ has joined #ponylang
theodus has joined #ponylang
<profetes>
but nevermind, I think I'll understand more later, as I get more details on how GC work and when it works. Code provided in the issue can reproduce my issue of GC not running for cycles.
<profetes>
I'll keep experimenting on my own.
emilbayes has quit [Ping timeout: 268 seconds]
emilbayes_ is now known as emilbayes
anthonybullard has quit [Ping timeout: 268 seconds]
<SeanTAllen>
an actor is eligible to be gc'd when:
<SeanTAllen>
1- it isn't referenced by anything
<SeanTAllen>
2- it can't receive any messages
<SeanTAllen>
#2 is mostly covered by #1
<SeanTAllen>
but also includes that actor not being registered with the async io system
theodus has quit [Quit: Page closed]
<profetes>
okay, that makes it more clear. Regarding code sample: in case I have many workers, I just call OtherActor(this) every time. And in be receive_result(result: U64) I implement a logic for getting all the results. So I need a counter of how many results I'm expecting. I got it. How does that approach differs from using Promise[U64] p, that p.next(recover this~receive_result() end) and passing that as a parameter for OtherActor?
aturley has quit [Quit: aturley]
<SeanTAllen>
at minimum, less overhead
<SeanTAllen>
my approach gets less overhead because its less flexible
<SeanTAllen>
a Promise is itself an actor so there's additional overhead and message passing but you can chain promises together etc
<SeanTAllen>
the problems i solve really dont ever need promises so I don't tend to use them
<profetes>
okay, thank you for clarification. From GC point of view, after OtherActor reported results - is it ready do be GCed?
<SeanTAllen>
well...
<SeanTAllen>
1: there are no references to it
<SeanTAllen>
2: it would be done doing work
<SeanTAllen>
3: it isn't registered for asio event
<SeanTAllen>
4: it can't receive any new messages because of #1, so yes, it could be gc'd.
<SeanTAllen>
also note, there is no reason that Main has to be the actor that it is reporting back to, it could be any actor that is supposed to get results and then report them.
<SeanTAllen>
i only ever use Main to get the program initialized and then let it die out. I never add any behaviors to Main.
<profetes>
sure, using Main here is just a sample, that I get. And to me as well, OtherActor should be able to be GCed. So that answers my question about architecture, let me summary it if I get it correctly: for provided code, if I use that approach or Promises - upon finished work OtherActor should be able to be GCed independently from actor it reports to.
jemc has quit [Ping timeout: 258 seconds]
<profetes>
SeanTAllen: Thanks for all the info so far, gotta go, 11pm local time.
<SeanTAllen>
have a good night profetes
ExtraCrispy has quit [Ping timeout: 256 seconds]
srenatus has quit [Quit: Connection closed for inactivity]