EuroPython 2016

Writing Domain Specific Languages with Python

Speaker(s) Daniel Pope

Python is an expressive general purpose programming language. Its syntax provides many ways to represent structure and minimise code repetition and boilerplate.

But Python not always expressible enough. Perhaps when you’ve built a complicated enough system with hard-to-express inter-relationships, the code required to construct or operate on it can become complicated, repetitive and unreadable. Or perhaps you have users unfamiliar with Python who need to understand or edit a system. In cases like these, stepping beyond the syntax and semantics of basic Python can be an advantage.

Daniel will describe various ways you can implement your own Domain Specific Languages, languages perhaps completely unlike Python that can succinctly describe more complicated Python systems.

This talk will cover:

  • What and why of DSLs
  • Metaprogramming tricks
  • Writing simple parsers
  • The libraries PLY and PyParsing
  • Building tooling around your new DSLs


Do you have some questions on this talk?

New comment