Work in progress pure python dhall interpreter
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Disambiguating more Nov 17, 2018
dhall-lang @ 7d8bdb9 Update dhall-lang dependency and remove dhall-haskell dependency Nov 24, 2018
dhall
tests
.gitignore Configuring setuptools Nov 12, 2018
.gitmodules
.travis.yml Configuring codecov Nov 12, 2018
LICENSE
Makefile README and Makefile cleanup Nov 14, 2018
README.md Update README.md Dec 1, 2018
abnf2bnf.py Starting work on typechecking Nov 12, 2018
bnf2parglare.py Disambiguating more Nov 17, 2018
dhall.abnf.patch
grammar_desugaring.py
json2python.py Parse table precomputing Nov 4, 2018
parglare_adapter.py Starting work on typechecking Nov 12, 2018
setup.cfg Configuring setuptools Nov 12, 2018
setup.py disambiguate single quote escape Nov 17, 2018
tools.py

README.md

Dhall for python

Build Status codecov

Pure python implementation of dhall language.

Work in progres

python setup.py build  # to patch the grammar and compile parser tables
python setup.py test  # to run tests
flake8  # to lint the code
make abnf_patch  # to make changes to dhall.abnf persistent

Status

  • parsing

    All tests from acceptance test suite pass, except AST is not checked against CBOR.

  • typechecking / evaluating / normalizing

    Some tests from acceptance test suite pass, but typechecking infrastructure needs to be havily reworked.

  • import resolution

  • loading from / dumping to binary

  • (pretty)printing expressions

    There is some code responsible for printing for type errors explanation, but it's incomplete and does not properly support precedence.

Details

Parsing is done using parglare GLR parser library. grammar.abnf from dhall-lang repository is first patched, then converted into GLR parser tables. Take a look at setup.py, how it's done.

Acceptance tests comes from dhall-lang repository. They are then triggered during unit testing using awesome parametrized package. Take a look at tests/test_acceptance.py.

To check what dhall-python is capable of parsing call something like

cat dhall-haskell/tests/parser/annotations.dhall | dhall-python-parse