<div dir="ltr"><div><div>Hi Anatoly,<br><br><br></div>Do you know about manhole? I made a video that also demos axiom, but it should show you what manhole does :)<br><br><a href="https://www.youtube.com/watch?v=3-UZiO-AnLc">https://www.youtube.com/watch?v=3-UZiO-AnLc</a><br>

<br></div>Essentially it's "repl in a running process".<br><div><br><br>hth<br>lvh<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 5, 2014 at 4:43 AM, anatoly techtonik <span dir="ltr"><<a href="mailto:techtonik@gmail.com" target="_blank">techtonik@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, network hackers,<br>
<br>
Recently I've got a Raspberry Pi and a friend showed me its serial<br>
interface and helped to setup it. I was stunned. What I saw - you open<br>
serial terminal, and you jump in into the middle of boot section. Just<br>
open a terminal and you see what's going on inside of R.Pi. Any time.<br>
That's was an intro. =)<br>
<br>
For a long time I wanted the same interface for debugging software<br>
programs. When I was hacking on Spyder I found that my human brain is<br>
too limited to squeeze details of dynamic of interaction of objects at<br>
run-time. Spyder is written in Python with Qt, and it is a parallel<br>
application much like any Twisted app is. But I wanted to push the<br>
progress, I have to deal with complexity, so I badly needed to be able<br>
to draw a video of interaction at run-time. That was the problem I<br>
tried to solve.<br>
<br>
And for the first step I needed a way to connect to Spyder at run-time<br>
and see what's going on. I didn't know how to call that way before,<br>
but now I have a rather accurate wording - "a serial interface for an<br>
application". That is the background for the question I am trying to<br>
ask.<br>
<br>
What is the best way to implement such interface considering the<br>
following properties:<br>
1. it needs to be simple (so that you can quickly create python script<br>
that reads the info)<br>
2. it needs to be universal (so that script for one app worked for other)<br>
3. it should be asynchronous (connected terminal should not degrade performance)<br>
4. it needs to be reliable (at least detecting missing packets)<br>
5. and cross-platform (and pure python)<br>
<br>
Why Twisted? For the first I think that this problem is actual for<br>
people who are dealing with complexity of dynamic and interconnected<br>
systems built with the help of Twisted. For the second I believe it<br>
can only be solved or analyzed by people skilled in interprocess and<br>
internetwork communications.<br>
<br>
One button test:<br>
1. program behaves weird<br>
2. user hits the button<br>
3. terminal pops up<br>
4. shows a lot of data for a running program<br>
<br>
I am interested to know.<br>
1. how the button should discover the program<br>
network port seems cool, but what about two parallel programs? what<br>
about different programs that provide this interface?<br>
<br>
2. how terminal receives the data<br>
i see it as line based - one line - one event, everything is text<br>
<br>
3. how to make it fast<br>
TCP clearly won't here<br>
<br>
4. how to send the data<br>
what if two threads (or parallel code) produce serial data? who should<br>
run the server that serves connected terminals, and how other thread<br>
will send message to this server? you can not run two TCP servers on<br>
the same port on the app side, so is there an alternative? how to<br>
detect missing data in a stream? how to avoid dealing with incomplete<br>
packets and low level network details?<br>
<br>
Thanks. I'd like to get back to hacking on Spyder one day, but this is<br>
a stumbling block for me every time I think about it or any program of<br>
compared complexity.<br>
<span class="HOEnZb"><font color="#888888">--<br>
anatoly t.<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</font></span></blockquote></div><br></div>