[IPython-dev] How to parse a domain-specific language on top of Python

Joachim Wuttke j.wuttke at fz-juelich.de
Wed Dec 3 11:37:14 EST 2014


((cross-posting from http://stackoverflow.com/questions/27274607
   where this question gets close votes for being "too broad":))


I want to construct a domain-specific language as a superset of Python. 
Cryptic commands like

     f7:10y=x^2

designed to minimize typing shall be parsed into plain Python

     for k in range(7,10):
         f[k].set_y( expr='x^2' )

before being executed. Probably, the command-line interface shall be 
IPython.

What would be an appropriate architecture: Shall I implement the 
cryptic-to-plain-Python translation in the IPython command-line shell or 
in its kernel daemon? Are there helpful libraries / tutorials / examples?

Or more generically: Are there examples how to add complex syntactic 
sugar to Python?


Thanks in advance - Joachim


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5013 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141203/ef624d4f/attachment.bin>


More information about the IPython-dev mailing list