Re: [Haskell-cafe] Standard package file format

I would like to second this thought. Using Haskell for package
descriptions needs to be thought out and executed with great care and
attention. It's really easy to go off the rails.
Scala's build system lets you do very powerful things, but it also makes
things unnecessarily complicated and mystifying for beginners. At my
previous work where we used Scala extensively, there were many times
where the team simply resorted to external tools because figuring out
how to make some seemingly trivial change to an SBT module was too time
consuming.
On September 16, 2016 8:39:15 AM EDT, David McBride
While I would personally love having a package description in haskell, I don't think it is a good idea.
If you can't start or modify a package without already knowing haskell, it is a huge barrier to entry. I remember trying to get started in scala and having a lot of trouble with sbt because I didn't know their operators for lists and arrays or hash tables or whatever it is that they use in their files.
On Fri, Sep 16, 2016 at 4:57 AM, yogsototh
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-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

my experience with Gradle was frustrating too. Even with some experience with Java. a lot of what is often called "complexity" stems from lack of types and gaps in comments / documentation. language needs to be learnt anyway. If config syntax needs to be learnt in addition to language syntax, this is always extra work. for 1st timers to be able to write hello world, sample config files and a few tutorials would go a long way.

Am 16.09.2016 um 15:38 schrieb Imants Cekusins:
a lot of what is often called "complexity" stems from lack of types and gaps in comments / documentation.
That's a big issue with Gradle. The third problem I know Gradle for is that it makes it surprisingly difficult to inspect the execution plan.

Actually subsetting is making this worse: Things freshly learned for Haskell won't work in the config language, restrictions encountered in the config language will be unthinkingly transferred to Haskell.
I agree. This is exactly what I felt when I tried to use Fay language,
which is a «proper subset» of Haskell (in the end I switched to GHCJS).
пт, 16 сент. 2016 г. в 19:00, Joachim Durchholz
Am 16.09.2016 um 15:38 schrieb Imants Cekusins:
a lot of what is often called "complexity" stems from lack of types and gaps in comments / documentation.
That's a big issue with Gradle.
The third problem I know Gradle for is that it makes it surprisingly difficult to inspect the execution plan. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Chris Kahn writes:
I would like to second this thought. Using Haskell for package descriptions needs to be thought out and executed with great care and attention. It's really easy to go off the rails.
Scala's build system lets you do very powerful things, but it also makes things unnecessarily complicated and mystifying for beginners. At my previous work where we used Scala extensively, there were many times where the team simply resorted to external tools because figuring out how to make some seemingly trivial change to an SBT module was too time consuming.
Let me guess (have no idea about sbt) -- unbridled Turing completeness? Declarativity is king for configuration, and Turing completeness ain't it -- please, see my other mail about subsetting Haskell. -- с уважениeм / respectfully, Косырев Сергей

.. if this helps the discussion, here is cabal file "spec" https://github.com/ghc/packages-Cabal/blob/71535bfb1bf439a1af0308a8e5da9ef98... (see also other files in the same directory) these types are used to parse .cabal. one benefit from using these types in reverse (to generate .cabal from .hs) would be: it is possible to write a few libs which generate well-formed cabal files from a simplified API. It is possible this was done already.

On Friday, September 16, 2016 at 3:42:48 PM UTC+2, Kosyrev Serge wrote:
Chris Kahn writes:
I would like to second this thought. Using Haskell for package descriptions needs to be thought out and executed with great care and attention. It's really easy to go off the rails.
Scala's build system lets you do very powerful things, but it also makes things unnecessarily complicated and mystifying for beginners. At my previous work where we used Scala extensively, there were many times where the team simply resorted to external tools because figuring out how to make some seemingly trivial change to an SBT module was too time consuming.
Let me guess (have no idea about sbt) -- unbridled Turing completeness?
Declarativity is king for configuration, and Turing completeness ain't it -- please, see my other mail about subsetting Haskell.
That's not the main problem with SBT. How do I explain it? Take this as an example of what Haskell should *not* do. # SBT made difficult Look, we all know a monad is just a monoid in the category of endofunctors, right?. Now, a SBT build configuration is just a heterogeneously-typed map from keys to monadic values that can be evaluated to a graph of setting transformers and build actions, so what's the problem? And oh, I forgot to mention keys aren't simple strings but have a hierarchy themselves, and this hierarchy is used for inheritance and overriding of settings (nothing as simple as OO inheritance, mind you, think of something like CSS but different). Isn't using Haskell supposed to require a PhD? So why would its build tools use something so simple as nested records, like Cabal does? </sarcasm> I think I'm trolling, but the above is somewhat accurate (except for any misunderstanding of SBT I might have)—I personally enjoy using SBT and its power, and once you learn it can be reasonably easy, but I think Kmett's lens library might be simpler to learn. In fairness, many SBT builds can be read without having any clue of the above, because they look like imperative programs. But as soon as you need to do a bit more or you make a type error, you end up facing some of the above complexity—if you want, the "imperative program" abstraction is extremely leaky. For instance, here's something "easy" (but count the amount of custom symbolic operators): scalaVersion := "2.11.0" scalacOptions += "-deprecation" libraryDependencies += org.scalatest" %% "scalatest" % "2.0" Then you want to use one setting when defining another, and suddenly you end up with: libraryDependencies <+= scalaVersion (ver => "org.scala-lang" % "scala-compiler" % ver) Luckily, this can be done more easily nowadays, thanks to Scala macros O_O.

Since I triggered this discussion I feel obligated to summarize the important points that were presented. Is there a good place to record Haskell ecosystem related discussions (some wiki)? -harendra On 17 September 2016 at 05:57, Paolo Giarrusso
On Friday, September 16, 2016 at 3:42:48 PM UTC+2, Kosyrev Serge wrote:
Chris Kahn writes:
I would like to second this thought. Using Haskell for package descriptions needs to be thought out and executed with great care and attention. It's really easy to go off the rails.
Scala's build system lets you do very powerful things, but it also makes things unnecessarily complicated and mystifying for beginners. At my previous work where we used Scala extensively, there were many times where the team simply resorted to external tools because figuring out how to make some seemingly trivial change to an SBT module was too time consuming.
Let me guess (have no idea about sbt) -- unbridled Turing completeness?
Declarativity is king for configuration, and Turing completeness ain't it -- please, see my other mail about subsetting Haskell.
That's not the main problem with SBT. How do I explain it? Take this as an example of what Haskell should *not* do.
# SBT made difficult
Look, we all know a monad is just a monoid in the category of endofunctors, right?. Now, a SBT build configuration is just a heterogeneously-typed map from keys to monadic values that can be evaluated to a graph of setting transformers and build actions, so what's the problem? And oh, I forgot to mention keys aren't simple strings but have a hierarchy themselves, and this hierarchy is used for inheritance and overriding of settings (nothing as simple as OO inheritance, mind you, think of something like CSS but different). Isn't using Haskell supposed to require a PhD? So why would its build tools use something so simple as nested records, like Cabal does? </sarcasm> I think I'm trolling, but the above is somewhat accurate (except for any misunderstanding of SBT I might have)—I personally enjoy using SBT and its power, and once you learn it can be reasonably easy, but I think Kmett's lens library might be simpler to learn.
In fairness, many SBT builds can be read without having any clue of the above, because they look like imperative programs. But as soon as you need to do a bit more or you make a type error, you end up facing some of the above complexity—if you want, the "imperative program" abstraction is extremely leaky.
For instance, here's something "easy" (but count the amount of custom symbolic operators):
scalaVersion := "2.11.0" scalacOptions += "-deprecation" libraryDependencies += org.scalatest" %% "scalatest" % "2.0"
Then you want to use one setting when defining another, and suddenly you end up with:
libraryDependencies <+= scalaVersion (ver => "org.scala-lang" % "scala-compiler" % ver)
Luckily, this can be done more easily nowadays, thanks to Scala macros O_O.
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

https://github.com/ghc-proposals/ghc-proposals/ could be used for this purpose. There is also the Trac wiki but I find it is a bit too hard to keep under control with comments. Edward Excerpts from Harendra Kumar's message of 2016-09-17 08:05:38 +0530:
Since I triggered this discussion I feel obligated to summarize the important points that were presented. Is there a good place to record Haskell ecosystem related discussions (some wiki)?
-harendra
On 17 September 2016 at 05:57, Paolo Giarrusso
wrote: On Friday, September 16, 2016 at 3:42:48 PM UTC+2, Kosyrev Serge wrote:
Chris Kahn writes:
I would like to second this thought. Using Haskell for package descriptions needs to be thought out and executed with great care and attention. It's really easy to go off the rails.
Scala's build system lets you do very powerful things, but it also makes things unnecessarily complicated and mystifying for beginners. At my previous work where we used Scala extensively, there were many times where the team simply resorted to external tools because figuring out how to make some seemingly trivial change to an SBT module was too time consuming.
Let me guess (have no idea about sbt) -- unbridled Turing completeness?
Declarativity is king for configuration, and Turing completeness ain't it -- please, see my other mail about subsetting Haskell.
That's not the main problem with SBT. How do I explain it? Take this as an example of what Haskell should *not* do.
# SBT made difficult
Look, we all know a monad is just a monoid in the category of endofunctors, right?. Now, a SBT build configuration is just a heterogeneously-typed map from keys to monadic values that can be evaluated to a graph of setting transformers and build actions, so what's the problem? And oh, I forgot to mention keys aren't simple strings but have a hierarchy themselves, and this hierarchy is used for inheritance and overriding of settings (nothing as simple as OO inheritance, mind you, think of something like CSS but different). Isn't using Haskell supposed to require a PhD? So why would its build tools use something so simple as nested records, like Cabal does? </sarcasm> I think I'm trolling, but the above is somewhat accurate (except for any misunderstanding of SBT I might have)—I personally enjoy using SBT and its power, and once you learn it can be reasonably easy, but I think Kmett's lens library might be simpler to learn.
In fairness, many SBT builds can be read without having any clue of the above, because they look like imperative programs. But as soon as you need to do a bit more or you make a type error, you end up facing some of the above complexity—if you want, the "imperative program" abstraction is extremely leaky.
For instance, here's something "easy" (but count the amount of custom symbolic operators):
scalaVersion := "2.11.0" scalacOptions += "-deprecation" libraryDependencies += org.scalatest" %% "scalatest" % "2.0"
Then you want to use one setting when defining another, and suddenly you end up with:
libraryDependencies <+= scalaVersion (ver => "org.scala-lang" % "scala-compiler" % ver)
Luckily, this can be done more easily nowadays, thanks to Scala macros O_O.
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (8)
-
Chris Kahn
-
Edward Z. Yang
-
Geraldus
-
Harendra Kumar
-
Imants Cekusins
-
Joachim Durchholz
-
Kosyrev Serge
-
Paolo Giarrusso