f-f / dhall-clj Goto Github PK
View Code? Open in Web Editor NEWDhall to and from Clojure
License: Eclipse Public License 1.0
Dhall to and from Clojure
License: Eclipse Public License 1.0
As standardized in dhall-lang/dhall-lang#266, dhall-lang/dhall-lang#271 and implemented in dhall-lang/dhall-haskell#675
We should test that given a Dhall expression, both the Haskell implementation and this one serialize to the same bytes
As standardized in dhall-lang/dhall-lang#307 and implemented in dhall-lang/dhall-haskell#726
Most likely with GitlabCI. It should run tests only on master
for now.
This is not theoretically blocked by #7, but in practice it's not needed until then.
It should be possible to import Dhall expressions over http/https, as defined in the standard.
This would mean implementing proper "import chaining", and check that we're respecting the Security Concerns document.
As standardized in dhall-lang/dhall-lang#263 and implemented in dhall-lang/dhall-haskell#667
As mentioned in dhall-lang/dhall-haskell#568, the current tests for the Haskell implementation do not check for the "correct parse", so it'd be nice to generate the correct AST and check against that.
As standardized in dhall-lang/dhall-lang#308 and (partially) implemented in dhall-lang/dhall-haskell#728
As standardized in dhall-lang/dhall-lang@af53b07
..and implemented in dhall-lang/dhall-haskell#657
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
)slurp
? How about headers? Maybe we have to bring in clj-http)shift
subst
typecheck
alpha-normalize
beta-normalize
shift
subst
alpha-normalize
beta-normalize
typecheck
import
emit
Clojure s-exps from the Expression TreeWe should perform the semantic integrity checks on imports (right now they are skipped)
Blocked by #4 (as we should hash the binary-encoded blob)
The ?
operator to alternatively resolve imports should be supported
To preserve source information, the Haskell implementation uses a Note
constructor as a wrapper.
We get this data already from Instaparse as metadata, so we should just pass this metadata around.
This would probably mean be careful about creating new objects (because they should carry the meta from the old ones) or even just applying non-meta-aware functions to them.
E.g. see ClojureScript's AppVeyor config
The following expression is broken in our interpreter:
λ(x : Bool) → λ(x : Bool) → x@1
since it emits the following form:
(clojure.core/fn [x] (clojure.core/fn [x] x-1))
which doesn't make any sense.
The problem here is that Clojure does not support accessing shadowed bindings, so to fix this we should rename all variables to something unique; the sanest option is to use the De Bruijn indices for it e.g. x@0
-> x_0
.
In this way we can solve this by just applying α-normalization parametrized by the rename variable (instead of _
)
As implemented in dhall-lang/dhall-haskell#863
As described in the standard
As standardized in dhall-lang/dhall-lang#334
As standardized in dhall-lang/dhall-lang#238
As standardized in dhall-lang/dhall-lang#293 and implemented in dhall-lang/dhall-haskell#690
Since we get the type of an expression from the typecheck
, we could validate it against a user-provided spec.
Some tests for beta-normalization
are failing
As standardized in dhall-lang/dhall-lang#194
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.