Discuss versioning requirements for dependencies
Today, versioning requirements for dependencies in Mix is done via regular expressions. You pass a regular expression with the supported version of the dependency you want. This is quite error prone as you need to escape dots, matching double digits requires special care, express "negations" are complicated, etc.
I am aware with Ruby's style for those. In Ruby, we simply use a string in a special format. For example, ~> 0.1 means 0.x, = 0.1 means an exact version, >= 0.1 means everything ahead of 0.1 and so forth.
How are other languages solving this problem? What can we learn from them?
I like this initiative!
This is how Haskell solves it, which is close to Ruby but slightly different syntax: http://www.haskell.org/cabal/users-guide/developing-packages.html#build-information
There is the dependencies of invyfile.
http://ant.apache.org/ivy/history/2.3.0-rc1/ivyfile/dependency.html#revision which is pretty cool
From the site: Examples: [1.0,2.0] matches all versions greater or equal to 1.0 and lower or equal to 2.0 [1.0,2.0[ matches all versions greater or equal to 1.0 and lower than 2.0 ]1.0,2.0] matches all versions greater than 1.0 and lower or equal to 2.0 ]1.0,2.0[ matches all versions greater than 1.0 and lower than 2.0 [1.0,) matches all versions greater or equal to 1.0 ]1.0,) matches all versions greater than 1.0 (,2.0] matches all versions lower or equal to 2.0 (,2.0[ matches all versions lower than 2.0
But I find it counter intuitive to use parentesis instead of equality operators for example. But I like the range thing.
@ericmj I like haskell approach more than Ruby's one. Using * is clearer than Ruby's ~> and && and || are very clear in intent.
@pedrosnk ranges are super concise but I agree with you: I also prefer the clarify of equality operators and Ruby's ~> and Haskell's * solves the need for most ranges. :)
I will write a new proposal. :) Thanks guys! :heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart: