[IPython-dev] Implementing inline images in a kernel

Doug Blank doug.blank at gmail.com
Wed Jan 29 02:44:22 EST 2014


On Tue, Jan 28, 2014 at 11:41 PM, Fernando Perez <fperez.net at gmail.com>wrote:

>
> On Tue, Jan 28, 2014 at 6:11 PM, Doug Blank <doug.blank at gmail.com> wrote:
>
>> Well, that is probably true in general. But Calico is a very different
>> kind of beast. It doesn't run the languages independently in their own
>> space... all of the languages run in the same space. They can share data
>> and functions and memory, but not by marshaling between systems.
>
>
> Actually, that's sort of how the %julia magics work: we initialize the
> julia interpreter in-process, by dlopen'ing libjulia and then create a
> julia interpreter, passing it a pointer to the underlying Python VM.  This
> allows the two languages to seamlessly share data structures in-memory.
>
> I'm not saying that you shouldn't  build your own native kernel, as
> there's obviously a ton of things that should be done that way (and that's
> why, in addition to %julia, there's also a real, native julia kernel as
> Brian mentioned).  I just wanted to point out that language %magics in the
> IPython kernel aren't limited to working out-of-process.
>
>
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...

-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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140129/97b2ab52/attachment.html>


More information about the IPython-dev mailing list