[IPython-dev] How to parse a domain-specific language on top of Python
Doug Blank
doug.blank at gmail.com
Wed Dec 3 12:08:51 EST 2014
On Wed, Dec 3, 2014 at 11:55 AM, Joachim Wuttke <j.wuttke at fz-juelich.de>
wrote:
> Thank you, Doug!
>
> Could you possibly give me a hint what you mean by "magic" under
> (2) and (3) ?
Sure! "Magics" are metacommands in IPython... things like "%lsmagic" will
list all of the magics. They can do lots of different things... almost
limitless. They can also be packaged up, and distributed independently. See
http://ipython.org/ipython-doc/dev/interactive/tutorial.html for use...
there may be developer docs for creating your own magic... don't know.
IPython is in the process of being split into two main parts: language
agnostic parts and IPython/Python specific parts. This allows other
languages to use the IPython infrastructure. It sounds like you want to
stay with Python, but even if you did, you could build your own version of
a kernel (for Python or another language) and then use a different magic
system (a language-agnostic version). That is what metakernel does.
-Doug
>
>
> - Joachim
>
>
> 2) You could do this as a magic. You could use a simple parser to just
>> output regular Python. This is the least complex, and should be easier
>> to keep working over time.
>>
>> 3) You could implement your own parser written in Python as its own
>> kernel (google "wrapper kernel"). You can even have your own magics etc.
>> (see https://github.com/blink1073/metakernel)
>>
>
>
>
> _______________________________________________
> 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/20141203/b96d2f7c/attachment.html>
More information about the IPython-dev
mailing list