-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler implementation plan #1
Comments
@Gabriel439 is the above somehow accurate? Am I missing any steps? |
The only steps missing are the ones not yet standardized (specifically semantic integrity checks). Other than that it looks complete to me |
Cool thanks! I didn't consider the semantic integrity checks, added to the list. |
Update: as of 878023f, we now parse all Dhall forms (except imports) from text into an Basically parsing happens like so:
We have ~50 testcases for basic parsing here - we check that a parsed text form generates a certain AST. |
As of what to do next, I was thinking about skipping the imports for now (as some things like "semantic integrity checks" are not standard yet) and work on typechecking/normalizing/emit the "pure" subset of Dhall (so that the pipeline is in place and works). |
@Gabriel439 I'm implementing |
@f-f: It's purely an optimization and not required by the standard so if you want to do the single folding strategy that is definitely allowed. Basically the standard allows you to do anything you want as long as the final result is the same. For example,
|
@Gabriel439 cool, thanks. I'll also reuse your tests for type check/normalisation/etc (and I guess it would be nice move them to the dhall-lang repo at some point, so they can be in sync with the spec) |
The goal for the project is to provide Dhall bindings to/from Clojure. The original plan was to get an MVP working ASAP, with the following steps:
Haskell source -> running on Eta -> make Java bindings -> call from Clojure
), so that we have to only do the last mile of transforming the evaluated form to a clojure s-exp.However, this "shortcut" is not viable yet, so it probably makes more sense to just implement the compiler from the get go, to also have another complete implementation of the standard (at the time of writing only the reference Haskell implementation is complete).
A plan for the Dhall compiler implementation is detailed in dhall-lang/dhall-lang#11, and some more info is in the semantics document and the reference implementation.
Checklist for the compiler implementation:
System/getenv
)slurp
)Get URLs (also withEDIT: now tracked in Implement http imports #7slurp
? How about headers? Maybe we have to bring in clj-http)Also we'll need to perform the semantic integrity checks (basically sha256 on imports). This is not standardized yet, so it's fine if we ignore them for now.EDIT: now tracked in Perform semantic integrity checks #5After all of this is done, the "security concerns" document should be implemented.EDIT: also tracked in Implement http imports #7shift
subst
typecheck
alpha-normalize
beta-normalize
shift
subst
alpha-normalize
beta-normalize
typecheck
EDIT: tracked in Add tests for imports #9import
ParseEDIT: tracked in Portparsing
tests from the Haskell implementation #10ImportsEDIT: tracked in Add tests for imports #9emit
Clojure s-exps from the Expression TreeThe text was updated successfully, but these errors were encountered: