[IPython-dev] IPython-dev Digest, Vol 131, Issue 2
bussonniermatthias at gmail.com
Wed Dec 3 12:49:45 EST 2014
Le 3 déc. 2014 à 18:44, Kyle Rawlins a écrit :
> I think the most straightforward approach would be to do this kind of thing using IPython magics, probably in IPython notebook. For an (alpha) example of this, you may find it helpful to look at my IPython Lambda Notebook project which uses cell magics to interface notebooks with a parser for a domain-specific mini-language (the domain is linguistics, in particular linguistic semantics, so the mini-language is a typed logic/lambda calculus). The magics pass things to the parser, and variable assignments in the mini-language are injected back into the environment in a very straightforward way, so it’s easy to switch back and forth between the mini-language and python code. I wouldn’t really recommend my approach to parsing and interpreting the mini-language, though, which is tailored to an extremely specific brand of scientific computing (and not for actually doing efficient parsing or computation).
> Less relevant to this mailing list but I’d also caution against literally targeting a superset of python, this will be really, really hard to get right. At least start with a domain-specific language that is python-like but tractable.
Looks cool !
Nbviewer link for the lazy:
> Kyle Rawlins
> Department of Cognitive Science
> Johns Hopkins University
> IPython-dev mailing list
> IPython-dev at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev