[IPython-dev] Implementing inline images in a kernel

Doug Blank doug.blank at gmail.com
Wed Jan 29 07:40:56 EST 2014


On Wed, Jan 29, 2014 at 3:26 AM, Brian Granger <ellisonbg at gmail.com> wrote:
> The %julia magic works in an entirely blocking manner. All of the
> widget stuff works through asynchronous messaging.
>
> Here is a perfect illustration: what if you run the following in calico:
>
> import time
> for i in range(10):
>     print i
>     time.sleep(1)
>
> It should print 1 integer with a 1 second delay in between. But if
> Calico is talking to the Python backend through a blocking API, you
> won't see anything for 10 seconds, and then you will see all of it.

Calico interpreting whatever language shows the output intermittently
over the course of the 10 seconds, just like IPython running the
Python kernel. Calico doesn't "talk" to a Python backend... Calico
*is* Python, in a sense. And it is also Basic, Logo, etc. There isn't
one primary language talking to the others---there is just the thin
socket kernel talking to a specific language's eval function. But the
eval occurs in the "same space". Lower level calls to functions like
print() in the interpreted language's eval() inject messages to the
iopub stream. Even our Java works this way.

This is why I find some of the assumptions stated
confusing---insisting that "one language/one kernel" is the future
apparently misses some possibilities in design :) It may be that we
made unique design decisions. In any event, it appears that Calico
running scripts is very different in a fundamental way that IPython's
Python running the integrated Julia.

I wonder what the best technical way to describe this difference is? I
guess that you had assumed some type of blocking behavior. Perhaps I
need a better way of describing how Calico operates. My question to
you is why does %julia block?

-Doug

> On Wed, Jan 29, 2014 at 12:14 AM, Doug Blank <doug.blank at gmail.com> wrote:
>> On Wed, Jan 29, 2014 at 3:10 AM, Brian Granger <ellisonbg at gmail.com> wrote:
>>>
>>> > That's interesting... IJulia using the Python VM... Then, this is very
>>> > similar to Calico. Because all of the languages share memory, I was able
>>> > to
>>> > put a global object in there. I have now written display(), HTML(),
>>> > Image(),
>>> > and Audio(), and all is working very well. HTML, Image, and Audio all
>>> > have a
>>> > specially named method (similar to Python's __rep__) that when called,
>>> > returns the dictionary of mime-types and strings, and display() sends
>>> > the
>>> > proper message. Demo to follow...
>>>
>>> That is absolutely similar to the Calico idea. But keep in mind,
>>> running Julia through the %julia magic will *never* allow things like
>>> the widgets or tab completion to work. Only the true native Julia
>>> kernel will allow that.
>>>
>>
>> Why can't the Julia-using-the-PythonVM magic use the widgets or tab
>> completion? What is the limitation?
>>
>> -Doug
>>
>>>
>>>
>>> > -Doug
>>> >
>>> >>
>>> >> Cheers,
>>> >>
>>> >> f
>>> >>
>>> >>
>>> >> --
>>> >> Fernando Perez (@fperez_org; http://fperez.org)
>>> >> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
>>> >> fernando.perez-at-berkeley: contact me here for any direct mail
>>> >>
>>> >> _______________________________________________
>>> >> IPython-dev mailing list
>>> >> IPython-dev at scipy.org
>>> >> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>> >>
>>> >
>>> >
>>> > _______________________________________________
>>> > IPython-dev mailing list
>>> > IPython-dev at scipy.org
>>> > http://mail.scipy.org/mailman/listinfo/ipython-dev
>>> >
>>>
>>>
>>>
>>> --
>>> Brian E. Granger
>>> Cal Poly State University, San Luis Obispo
>>> bgranger at calpoly.edu and ellisonbg at gmail.com
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
>
> --
> Brian E. Granger
> Cal Poly State University, San Luis Obispo
> bgranger at calpoly.edu and ellisonbg at gmail.com
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



More information about the IPython-dev mailing list