<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">As an update, I’ve made a bit more progress on this. I’ve implemented an <font face="Courier" class="">impersonate-async-channel</font> function, and I’ve actually included this in the exports from <font face="Courier" class="">racket/contract</font>. I also realized the blame information is correct, it works fine. Most of the other issues remain, as well as a few new questions:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">There is no <font face="Courier" class="">impersonate-evt</font> function, so I’m not sure that my implementation will work. What should I do about this?</li><li class="">I’d assume this needs to be documented/tested as well. Where should those things be located?</li></ul></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 14, 2015, at 23:44, Alexis King <<a href="mailto:lexi.lambda@gmail.com" class="">lexi.lambda@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Currently, async channels do not have contracts to check their contents. This is a problem for Typed Racket, and it prevents typed code from interacting with code that produces async channels.<div class=""><br class=""></div><div class="">I started looking into how to add contracts to the language, and it seems to use the chaperones/impersonator system, as I suspected. However, async channels obviously cannot be impersonated, so I needed to implement that as well.</div><div class=""><br class=""></div><div class="">I modified the async-channel struct to use generics to allow it to be impersonated or chaperoned, which I have exposed by implementing <font face="Courier" class="">chaperone-async-channel</font>. I then tried implementing <font face="Courier" class="">async-channel/c</font>. The internals of the contract system are a little beyond me, but I got a working solution by following the example of the box contracts.</div><div class=""><br class=""></div><div class="">My work thus far can be found here: <a href="https://github.com/lexi-lambda/racket/commit/84b9f3604891f3f2061fb28ed4800af8afa4751b" class="">https://github.com/lexi-lambda/racket/commit/84b9f3604891f3f2061fb28ed4800af8afa4751b</a></div><div class=""><br class=""></div><div class="">First of all, is this a correct approach? Have I done anything wrong, or should I have done anything differently? I didn’t find much documentation on the internals of either of these systems, so I mostly went about things as I found them.</div><div class=""><br class=""></div><div class="">Second, obviously, not everything is implemented here. Among the additional necessary changes are:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">I need to implement support for impersonators and impersonator contracts (right now I’ve only bothered to do chaperones).</li><li class="">I need to implement <font face="Courier" class="">async-channel/c-first-order</font> and <font face="Courier" class="">async-channel/c-stronger</font>. I can probably figure out the latter, but I’m not even sure what the former is supposed to do.</li><li class="">I need to implement a <font face="Courier" class="">wrap-async-channel/c</font> macro for the export. I’m not sure how this works, either. From looking at <font face="Courier" class="">wrap-box/c</font>, it seems to add some syntax properties, but I’m not sure what they do or how they work.</li><li class="">Somehow, the blame information has to be correct. Is that what the wrap function does? Or do the async-channel functions need to be updated to assign blame?</li></ul><div class=""><br class=""></div></div><div class="">I’d really like to get this working, and I think I’m close, but I’m a little inexperienced. I’d appreciate any help, even if it’s just pointing me in the right direction.</div><div class=""><br class=""></div><div class="">Thanks!</div></div></div></blockquote></div><br class=""></body></html>