jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
Matthias247 has quit [Read error: Connection reset by peer]
unbalanced has joined #ponylang
unbalanced has quit [Ping timeout: 252 seconds]
<SeanTAllen> was there not one kulibali? that would explain the lack of GH activity emails. work has been very busy for me lately and i havent been able to attend.
<kulibali> theo and i hung around for a while, but no one else showed up
unbalanced has joined #ponylang
TwoNotes has joined #ponylang
<TwoNotes> Package level doc strings look like just the thing for http. What happens if more than one file in the package has them?
jemc has quit [Ping timeout: 256 seconds]
prettyvanilla_ has joined #ponylang
prettyvanilla has quit [Ping timeout: 258 seconds]
TwoNotes has quit [Read error: Connection reset by peer]
unbalanced has quit [Ping timeout: 245 seconds]
amclain has quit [Quit: Leaving]
jemc has joined #ponylang
jemc has quit [Ping timeout: 265 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 256 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
rurban has joined #ponylang
Matthias247 has joined #ponylang
M-hrjet has quit [Quit: Client limit exceeded: 5000]
_andre has joined #ponylang
mrkishi has joined #ponylang
mrkishi has quit [Ping timeout: 268 seconds]
rurban has quit [Quit: Leaving.]
buchanon[m] has quit [Ping timeout: 258 seconds]
buchanon[m] has joined #ponylang
<zevlg> hey guys! I'm very new to pony .. I'm quite astonished that there is no Exception type to dispatch on in order to find out what was going wrong inside try
<zevlg> is there any ways to do this? maybe write exception-less code ?
rurban has joined #ponylang
c355e3b has joined #ponylang
<Candle> zevlg: The pattern is to make only one thing raise for only one reason. If there are multiple possible, then passing in an error handling interface (see the TCP Listeners) is the way to go.
<zevlg> that makes sense, however I'm looking into json_doc.pony right now and it has some workarounds: storing error state inside object before rising error - it might work for me that way
Praetonus has joined #ponylang
TwoNotes has joined #ponylang
jemc has joined #ponylang
unbalanced has joined #ponylang
<TwoNotes> I continue to work out details for the HTTP streaming RFC
amclain has joined #ponylang
sjums has quit [Quit: Connection reset by beer]
sjums has joined #ponylang
<SeanTAllen> if you can have more than 1 type of error zevlg then using a union type that indicates the error makes sense
<SeanTAllen> type MyResult is (Success | Failure)
<SeanTAllen> type Failure is (Reason1 | Reason2 | Reason3)
<zevlg> yes, but in this case you have to handle errors every time you call stuff, you can't just jump-out to some error handler as with raising exception
<zevlg> you are talking about exception-less style, it does work of course .. but kind of boilerplates the code
<SeanTAllen> you get some boilerplate in return for more safety. exception have lots of terrifying edge cases that arent so edge.
<SeanTAllen> jemc: i'm using something that looks like the access pattern and i've run into a testing issue of getting a ref to the enclosing actor for testing without spinning up that actor (that might in turn have a ton of other dependencies), have you found a good way to address that?
<Praetonus> I've been thinking about an extension to the exception system that would allow programmers to emulate a dynamic exception system (as in C++ or Java) while keeping the safety and (relative) speed of the current system in the default cases where you're not interested in the type of the exception
<Praetonus> I'll have to make a RFC about that
<SeanTAllen> jemc: in particular, we arent taking in a lambda, its an actor handing this to another class that needs to be setup for testing
<SeanTAllen> hmmm actually i see a way to do this
<SeanTAllen> its just really painful
<jemc> SeanTAllen: you could also use a modified form of the access pattern which passes a ref to an interface type instead of a ref to the concrete actor type
<jemc> with the actor being a subtype of that interface
<jemc> then you could also have a test fixture class that also fulfills the interface
rurban has left #ponylang [#ponylang]
<SeanTAllen> yeah that is what I had
<SeanTAllen> and the last step is what I am doing
<SeanTAllen> i wanted to be able to test the logic without spinning up the actor but thats not possible
<SeanTAllen> thanks for confirmation on my current strategy though
<SeanTAllen> jemc: and then john mumm swooped in with a better solution
<SeanTAllen> jemc: stubbed it out with a class that can be a ref using fun tag for the behaviors... https://gist.github.com/SeanTAllen/4f66cad5d37e1d2e0a1511d46b6cbee9
<jemc> ah yes, I forgot that `fun tag` can mock `be`
<SeanTAllen> me too
Praetonus has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
c355e3b has quit [Quit: Connection closed for inactivity]
rurban has joined #ponylang
<SeanTAllen> jemc: do you have any idea what the perf it is in terms of lost performance calling through an interface instead of directly on a class? i've seen some optimization that Benoit did that only apply when not going through an interface but didn't pay much attention to them at the time.
<jemc> I haven't done work in Pony that is as deeply perf critical as yours, so I can't really quantify the magnitude of the effect for you, but I can suggest an approach that should completely avoid the overhead while retaining that flexibility for testing
<jemc> that is, make the accessed type be a type parameter *constrained by* the interface instead of making it literally the interfacre
<jemc> for example
<jemc> `be access[T: MyInterface ref = MyConcreteActor](fn: {(T)} val) =>`
<jemc> so by default there is no interface overhead, as the concrete actor type is used when you don't pass a type parameter
<jemc> or rather:
<jemc> `be access[T: MyInterface ref = MyConcreteActor ref](fn: {(T)} val) =>`
<jemc> in your tests would be the only type you pass an explicit type argument - for example: `mock.access[MyMocktype]({(m: MyMockType) => ... })`
<jemc> you could leave out the default if that creates problems for you, but then you also have to include the type argument in your production code:
<jemc> `be access[T: MyInterface ref](fn: {(T)} val) =>`
rurban has quit [Quit: Leaving.]
<SeanTAllen> huh
<jemc> if you use a type parameter you can specify the concrete type as the type used in compilation, so that the overhead of the interface can be avoided at runtime - the interface is only used as a constraint at compile time
<SeanTAllen> when my brain isnt melted, i'm going to have to go back and read this more and understand it
<SeanTAllen> thanks jemc
<SeanTAllen> unrelated but I found a way to get `fun tag` to segfault
<SeanTAllen> which might work in general
<SeanTAllen> im going to have to dig into it ore
<SeanTAllen> im going to have to dig into it more
c355e3b has joined #ponylang
sjums has quit [Quit: Connection reset by beer]
Praetonus has joined #ponylang
sjums has joined #ponylang
prettyvanilla_ has quit [Remote host closed the connection]
prettyvanilla has joined #ponylang
Praetonus has quit [Quit: Leaving]
irx[m] has quit [Quit: Client limit exceeded: 5000]
Matthias247 has quit [Read error: Connection reset by peer]
PonyLover has joined #ponylang
<PonyLover> Hai
PonyLover has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]