<div dir="ltr">IPython --debug would have saved me so many hours. Dear lord I can't believe I didn't know about that flag. Thank you thank you thank you.<div><br></div><div>-- Andrew Gibiansky</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 3:04 PM, Matthias BUSSONNIER <span dir="ltr"><<a href="mailto:bussonniermatthias@gmail.com" target="_blank">bussonniermatthias@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Le 23 janv. 2014 à 14:47, Doug Blank a écrit :<br>
<div class="im"><br>
> On Tue, Jan 21, 2014 at 12:41 PM, Doug Blank <<a href="mailto:doug.blank@gmail.com">doug.blank@gmail.com</a>> wrote:<br>
>> On Mon, Jan 20, 2014 at 12:01 PM, Matthias BUSSONNIER<br>
>> <<a href="mailto:bussonniermatthias@gmail.com">bussonniermatthias@gmail.com</a>> wrote:<br>
>><br>
>> [snip]<br>
>><br>
>>>>> Haven't looked at your simple_kernel.py yet.<br>
>>>><br>
>>>> I have cleaned up the code some, but as far as I can tell, nothing is working.<br>
>>><br>
>>> I'm not sure sockets like passing between threads.<br>
>>> And I think kernel side should use bind instead of connect because there is an asymetrie in req/res and pub/sub<br>
>><br>
>> Thanks for the feedback... your comments help me realize that I was<br>
>> looking at the wrong side of the socket code as examples. I've made<br>
>> more progress, but still looking for help on the code:<br>
>><br>
>> <a href="https://github.com/dsblank/simple_kernel" target="_blank">https://github.com/dsblank/simple_kernel</a><br>
><br>
> Thanks to hints given, I now have a working, simple_kernel.py.<br>
<br>
</div>Yeahhh<br>
<div class="im"><br>
<br>
> No one<br>
> from IPython has looked at that yet, so I don't know if there are<br>
> issues, let alone if this is best practices. But it does work.<br>
<br>
</div>You were not **really** stuck :-)<br>
<div class="im"><br>
><br>
> Questions still:<br>
><br>
>> Some specific questions:<br>
>><br>
>> 1) Does the kernel need to handle the "ident" bytes on the front end<br>
>> of messages before the delimiter? I see a couple of options: a) ignore<br>
>> them, b) pass them back with responses, c) do something with them?<br>
>> What do they represent?<br>
><br>
> It looks like the ident bytes on the front are a type of routing info<br>
> in the form of "username.engine_id.message_id". I have ignored them so<br>
> far. Am I losing functionality if I don't send them?<br>
<br>
</div>Ident might be used only to avoid replay attack, don't remember.<br>
Jump on hip chat and ping @minrk, he is the one with the more<br>
 knowledge of msg spec I think.<br>
<div class="im"><br>
><br>
>> 2) Could someone provide an example of a execute_request/execute_reply<br>
>> exchange of messages. I'm having trouble getting the conversation to<br>
>> work. Specifically, looking for how execute_reply, pyout, pyin<br>
>> message_types are related, and which sockets they are sent on.<br>
><br>
<br>
</div>start IPython with --debug, you should see the messages comming one going printed to stderr<br>
<div class="im"><br>
> I now have that working. Errors that I had: using socket.connect() vs<br>
> socket.bind(), not flushing the stream when sending, using wrong<br>
> zmq.MODE (DEALER, PUB, SUB, etc) when creating the socket, missing<br>
> JSON fields, and using the wrong socket (ie, "channel"). To solve<br>
> these issues I put some print statements in IPython/kernel/channels.py<br>
> when sending and recving and mirrored these details.<br>
<br>
</div>if you think those are needed you could put log.debug statement and open a PRs<br>
<div class="im"><br>
><br>
> The documentation is good, but I find that examples of the messages<br>
> being exchanged to be useful to make it concrete. Also, it seems that<br>
> some details are not specified in the docs.<br>
<br>
</div>Please open Issues on github and/or PR that how things will move forward on the doc :-)<br>
<div class="im"><br>
> I'll continue to make simple_kernel better, if I receive feedback or<br>
> add to it. Now, I'm ready to implement my real goal in C#...<br>
<br>
</div>Nice, is F# a derivative on C# ?<br>
<a href="https://github.com/BayardRock/IfSharp" target="_blank">https://github.com/BayardRock/IfSharp</a><br>
<br>
Microsoft integrate IPython with visual studio, maybe they have some pieces Public in C# ?<br>
<br>
Is there a list of IPython  kernels somewhere ? Maybe we should create a page on the Wiki.<br>
<br>
You could try to run your kernel again the test-suite, it could give you hint if things are missing.<br>
<br>
--<br>
Matthias<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br></div>