1. Unifying python parsing libraries

Python has a few alternatives for parsing, but some of them are unmaintained and most of them use their own format. A few examples:
(Please visit Ned Batchelder's Python parsing tools post for a comprehensive list)
The first goal is to support of as many formats/libraries using compatible abstractions and running with the same python interpreter (2.7/3.x).

2. Providing new abstractions for language related functionalities

Most of the libraries mentioned in the first goal provide at least one of the following abstractions:
  • Testing: Grammar Definition + Input -> Bool
  • Parser: Grammar Definition + Input -> Parse Tree
  • Parser Generator: Grammar Definition -> Paser code (Python)
  • Translation: Grammar Definition + Input -> Translated Output
The second goal of pydsl is to provide uniform access to these functions in a format agnostic way. And on top of these abstractions, provide new high level functions that are based in the Parsing/Translation process
  • Validation: Details about why an input doesn't conform a grammar (like w3c validator)
  • Diff: Print the differences between two inputs according to a grammar
  • Part extraction: Get the subparts of an input according to a grammar (like groups in regular expressiones)
  • Guessing: Test an input against a collection of Grammars

3. Creating an environment that allows free use of DSL

Regular expressions and SQL are examples of DSLs that are common within programming languages, but not completely integrated like arithmetic or boolean logic.

I think DSLs contain a lot of domain knowledge, and they are the result of choices and compromises. Pydsl attempts to organise functions around DSL and glue them together with a common programming language (python) with the abstractions/functions mentioned in goals 1 and 2.

This is the long term goal of pydsl.