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
jemc has quit [Ping timeout: 252 seconds]
Greymouth has joined #ponylang
<Greymouth> Hello
<Greymouth> Could anyone help me out?
<Greymouth> Im having trouble compiling my code
<Greymouth> oh nvm
Greymouth has quit [Client Quit]
mvzink has quit [Ping timeout: 264 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 272 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 256 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 244 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 264 seconds]
amclain has quit [Quit: Leaving]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 264 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 272 seconds]
Matthias247 has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 265 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 272 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 244 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 252 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 252 seconds]
M-Ingo has quit [Remote host closed the connection]
srenatus[m] has quit [Remote host closed the connection]
irx[m] has quit [Write error: Broken pipe]
irx[m] has joined #ponylang
srenatus[m] has joined #ponylang
M-Ingo has joined #ponylang
M-hrjet has joined #ponylang
_andre has joined #ponylang
mvzink has joined #ponylang
srenatus[m] has quit [Ping timeout: 272 seconds]
srenatus[m] has joined #ponylang
mvzink has quit [Ping timeout: 264 seconds]
c355e3b has joined #ponylang
ben_______ has joined #ponylang
ben_______ has quit [Client Quit]
notwas has joined #ponylang
<notwas> hello
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 244 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 272 seconds]
mvzink has joined #ponylang
<notwas> hi
mvzink has quit [Ping timeout: 256 seconds]
mvzink has joined #ponylang
dinfuehr has quit [Ping timeout: 272 seconds]
dinfuehr has joined #ponylang
mvzink has quit [Ping timeout: 256 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 244 seconds]
TonyLo has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 272 seconds]
mvzink has joined #ponylang
mankyKitty has quit [Ping timeout: 272 seconds]
jonrh has quit [Ping timeout: 272 seconds]
c355e3b has quit [Ping timeout: 256 seconds]
mvzink has quit [Ping timeout: 244 seconds]
mvzink has joined #ponylang
M-hrjet has quit [Quit: node-irc says goodbye]
jonrh has joined #ponylang
mankyKitty has joined #ponylang
c355e3b has joined #ponylang
jemc has joined #ponylang
amclain has joined #ponylang
<malthe> notwas: hi
_whitelogger_ has joined #ponylang
<malthe> Help! I don't understand how to resolve the compilation error on https://gist.github.com/malthe/a0232817937a54eea8f7c0b5d6dfdcd7
<malthe> In "ip_endpoint.pony:32:9": lambda(IPAddress): String end val is not a subtype of Fulfill[IPAddress val, String val] iso: val is not a subtype of iso
<malthe> I'm trying to experiment with a "net" package that's based on promises when applicable. For example, a `TCPListener` might be able to bind to a port, but it also might not which seems to be better suited for a promises-based API than using the notifier pattern.
<jemc> malthe: this is one of the usability issues with lambdas that I want to resolve - the compiler sets the type of the lambda based only on the lambda itself, with no inferring based on the type that is expected for assignment or argument passing
<jemc> the solution is to surround your lambda in a recover block
<malthe> I tried that to no avail
<malthe> same error message. sometimes I just can't wrap my head around what I'm supposed to do, but generally speaking, once you arrive at a solution it becomes clear.
<malthe> jemc: oh, actually I think recover iso does work.
<malthe> thx
TonyLo has quit [Ping timeout: 264 seconds]
<malthe> jemc: so the only way I can make it work is to add an arbitrary (and unused) capture to the lambda - see updated gist.
<malthe> isn't that bizarre? how does that change anything
<malthe> if I leave out the capture and recover explicitly to iso, then I get "can't recover to this capability".
<jemc> this happens because a lambda with no captures is implemented as an anonymous primitive, and a lambda with captures is implemented as an anonymous class (same as an object literal)
<jemc> it's definitely a usability issue that the compiler can't make this work automatically for you
bitcrusher has joined #ponylang
<malthe> right. where to begin looking at improving that I wonder
<jemc> it needs to be fixed in the compiler passes - I've spent time working on this before, but the way the passes currently work it's rather difficult to get it done in the right place
<malthe> is it because the Fulfill is "interface iso" that it insists on the iso and not e.g. val
<jemc> I had previously been thinking of this as a case where we want to auto-recover the lambda, but your example actually shows that this isn't true, as a `val` constructor can't be recovered to `iso`
TonyLo has joined #ponylang
<malthe> ya that would break expectations :-)
<jemc> I usually hit this problem going in the other direction - I have an `ref` lambda (with captures) that I need to pass where an `iso` or `val` is expected, and recover works fine for that
<malthe> what's something that's either an iso or a val
<jemc> but your example is a great reason to think that this is a deeper problem that is more specific to lambda
<jemc> malthe: I didn't mean the same situation accepts an `iso` or `val` - I meant different situations, some expecting `val` and some expecting `iso`
<malthe> ya but so the promises interface wants an iso fulfill object, but couldn't you argue that it could accept a val just as well?
<malthe> both of those can be sent to the promise actor ... isn't that the requirement here?
_whitelogger has joined #ponylang
_whitelogger_ has quit [Remote host closed the connection]
irx[m] has quit [Quit: node-irc says goodbye]
notwas has quit [Ping timeout: 240 seconds]
<malthe> I posted the question on the dev list to see if it might be possible to adapt the promises implementation so that it might actually also accept a val fullfill/rejected.
TonyLo has quit []
<jemc> I think it probably could be, though it would complicate the codebase
<jemc> I see this as a general problem with lambda usability, rather than a specific problem with the promises package
Matthias247 has quit [Read error: Connection reset by peer]
jemc has quit [Ping timeout: 252 seconds]