On Mon, 29 Apr 2013 13:37:23 +0200
Fredrik Ekholdt <
fre...@gmail.com> wrote:
> Hey Evan!
> Thanks for the input!
> On YAML, I do not know it well enough to see the pros/cons on it.
> It would be good if there is a good and fast parser in Scala/Java for whatever format we choose.
> Preferably it should be something that is known by most people.
> I have nothing against HOCON - it is great for configuration. I am not sure I see the benefits of HOCON vs JSON when it is simply used for de/serialization.
> Could you elaborate a bit? Being line-oriented is a good one though :)
Humans will still read and write these things, even if 99% of the time a program does.
> See inline for more!
>
> On Apr 28, 2013, at 9:47 AM, Evan Chan wrote:
>
> > HI Fredrik,
> >
> > The big missing piece is the dependencies specification. I'd like to propose something like this (in HOCON syntax):
> Yes, absolutely!
> >
> > dependencies {
> > compile = [
> > {name: "org.slf4j/slf4j-api", version: ">= 1.6.6"}
> > {name: "scala-api", version: "2.10.*"}
> > ]
> > provided = [
> > {name: "org.apache/hadoop-core", version: "1.0.4"}
> > ]
> > conflicts = [
> > {name: "*/log4j*"}
> > ]
> > }
> >
> > provides = [
> > {name: "scala-logging", version: "1.6.3"}
> > ]
> >
> >
> > A couple of important things to note:
> > * There are multiple types or scopes of dependencies. Compile dependencies, plus the "provided" scope. I can't tell you how many times I wish that provided dependencies could be transitively declared in Maven, whereas today, "provided" deps aren't included in the POM at all, and must be re-declared in the app using a library... a total hack.
> Oh, that is a great idea! How do you see this integrating with configurations of Ivy?
I personally think Ivy configurations can be pretty much copied as is.
> > * Wildcards and operators like >= should be supported for versions. Requiring a single fixed version is extremely stifling and limits binary compatibility.
> So I am still on the fence when it comes to whether things should be more or less strictly defined (i.e. you define exactly what is supported VS you can define wildcards etc etc). I agree that strictness inhibits readability, but what is good with strictness is you won't be surprised. I leaning towards wildcards though :)
A common theme that I heard after giving the talk is that people want less surprises from resolution. The simplest scheme that meets this is strictness/no wildcards. That might work for a larger team that puts a high priority on it, but I think it otherwise imposes a large cost. This is why I proposed the multiple version scheme. I think it has fewer surprises, requires less work, but is still flexible enough.
> > * "Provides" gives a way for a library to advertise that it supports or implements a common API (for example, SLF4J). This means multiple apps can depend on the advertised API, which can be satisfied by any number of backends, without having to go through a fake "meta" jar/package.
Yes, agree.
> > * "Conflicts" gives dep-resolution-time insight into packages that may not work together. Classic example is LOG4J vs LOGBACK. Today this conflict is detected at runtime and is a huge pain to debug.
> Yep, this is a good idea.
> What do you think about having a: "replaces", where you define if this org, name replaces another org, name (thinking about handling conflicts that are google collections/guava).
Replaces implies that there is an ordering. One dependency can be chosen automatically instead of the other. Conflicts says that the two cannot both be resolved together. If the resolution engine can pick dependencies so that this is true, great. If not, it has to fail. It can't pick one automatically. Replaces sounds useful separately from conflicts, but mainly for when a module changes group ID or something. Otherwise, it seems pretty open to abuse. (As an exaggerated example, org.scala-lang "replaces" org.codehaus.groovy.)
-Mark