We're talking about *three* options:
1. syntax for pure Haskell values, which I'll call HSON (Haskell
jSON). That's just an alternative to YAML/TOML/... That would need
extensions to allow omitting optional fields entirely.
2. a pure Haskell embedded domain-specific language (EDSL) that simply
generates cabal description records (GenericPackageDescription
values). That would allow abstraction over some patterns but not much
more. But that alone is already an argument for EDSLs—the one Harendra
already presented.
3. a Haskell embedded domain-specific language (EDSL) designed for an
extensible build tool, like Clojure's (apparently), SBT for Scala or
many others. That would potentially be a rabbit hole leading to a
rather *different* tool—with a different package format to boot. That
can't work as long as all libraries have to be built using the same
tool. But stack and cabal are really about how to manage package
databases/GHC/external environments, while extensible build tools are
about (a more powerful form) of writing custom setup scripts. I
suspect some extensions might be easier if more of the actual building
was done by the setup script, but I'm not sure.


On 16 September 2016 at 10:57, yogsototh <yann.espos...@gmail.com> wrote:
>
>> I guess the overriding question I have here is: what is the PROBLEM being
>> solved?
>
>
> Let me share my experience with Clojure and lein. They use a clojure
> hash-map for their configuration. So yes arbitrary code could be executed
> and I believe this is a _very good thing_.
>
> Why? Because it makes it very easy to add sub-configuration that can be used
> by third party plugin. For example:
>
> - a plugin that help the use of environment variables (lein-environ) which
> is really helpful for application development (not so much for library
> development)
> - a plugin that use S3 for our private dependencies (not supported by
> default by lein)
>
>
> For deployment: we were able to add request to our API server that provide
> not only the written version but also the git commit hash. So we could be
> certain of the version of the server. Too much time there were sys/admin
> deployment errors. And that could only be achieved because we were able to
> run arbitrary command in the project description file.
>
> I certainly forget many other advantages of having a package description
> format which is simply a data structure in the hosted language. But this has
> by far my preference.
>
> - cabal is ok, but very imperfect, I generally need to have a lot of
> copy/paste, I need to change it very often while writing application with
> many dependencies
> - JSON/YAML/TOML are simply not powerful enough to match all semantics we
> might need to configure a project. For example we might want to have Set
> instead of List for some properties. Or I don't know maybe ternary tree
> structures.
>
> The point is: we pay a price by adding a step between the semantic and the
> syntax.
> While if our configuration format was in Haskell we could express the
> semantic more directly.
>
> _______________________________________________
> Haskell-community mailing list
> Haskell-community@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-community
>



-- 
Paolo G. Giarrusso - Ph.D. Student, Tübingen University
http://ps.informatik.uni-tuebingen.de/team/giarrusso/
_______________________________________________
Haskell-community mailing list
Haskell-community@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-community

Reply via email to