r/Clojure • • Nov 19 '19

"In contrast, in Clojure, there have been almost no breaking changes to core in 12 years."

https://twitter.com/RealGeneKim/status/1196147608948895744
87 Upvotes

8 comments sorted by

5

u/801ffb67 Nov 19 '19

We should allow library updates to change calls in the client's code. Clojure is a homoiconic language and it has indexing libraries (codeq for instance) that allows one to query code fragments easily. Let's do it folks !

5

u/[deleted] Nov 19 '19

I don't know if this is the solution. This is just extending "breaking" further.

Rich's talk is relevant here:

https://www.youtube.com/watch?v=oyLBGkS5ICk

1

u/801ffb67 Nov 20 '19

Breaking changes are a problem only because they require work to be done to support them, by either modifying calls to the updated library as well as values it returns, or by running tests to make sure nothing unexpected has changed. This could be automated or wizzarded.

In addition to allow library authors to offer patches to client code calling the library, I think library authors should be able to run the clients' tests on their own to see if breaking changes are introduced. Of course what I propose introduces a lot of questions about such a development model since it broadens and complexifies the definition of code ownership, but this is something I'd like to use even when I'm on both sides, i.e. as an author and client of the same library.

I've watched parts of Rich's talk, and there are things I do not understand about Maven. In which way does it differ from other "package managers" like Rubygems ? If I have two libraries requiring different versions of a third library, does it mean they will use their own version at runtime ? I thought they both used the most recent one.

2

u/alexdmiller Nov 20 '19

Maven’s version selection will use the version first encountered when traversing from the top of transitive dependency tree (regardless of newness).

0

u/[deleted] Nov 20 '19

[deleted]

3

u/daver Nov 21 '19

Well, in fairness to others, most people are also not coding core language libraries. The standards for breakage between random app coding and core libraries are different. That said, there are a lot of coders that don’t spend any time thinking things through and your point is well taken.

0

u/[deleted] Nov 21 '19

[deleted]

2

u/daveliepmann Nov 21 '19

Yes, they should be. Different things are different. Making a breaking change to Clojure would affect tens of thousands of people, cost serious developer time to track down across myriad projects, and could potentially cause hundreds of millions of dollars of damages from bugs. Making a breaking change to my toy lib that I published on a lark that only a small handful of people use (mostly for low-stakes projects not in production) is simply not as big a deal.

Should we have a cultural norm that encourages people/orgs to avoid breaking changes, just like we have norms discouraging excessive use of macros? Yes! But the point is to have a good default but still look at trade-offs, costs, and benefits rather than blindly follow a rule.

0

u/[deleted] Nov 21 '19

[deleted]

1

u/daver Nov 28 '19

If it’s a private library used either personally or by an individual company, I think it doesn’t matter. Break it. Sure, if you’re writing something for general consumption on github, you have to be more careful.

Also, I like what Meander does with versioning, having alpha, beta, gamma, and now epsilon releases with breaking changes at each, but with all the code in different namespaces, so if you use an older version, it doesn’t affect you. Same thing with spec.alpha, for instance. In other words, namespaces are free, so just make another one to hold the breaking changes.

1

u/121531 Dec 16 '19

Uh, this seems like an obviously apples and oranges comparison? Clojure is a programming language, but we're comparing it to NPM libraries, not JavaScript. All the changes from ES3 to ES6 and beyond were, as far as I know, not backwards-incompatible at all. The right comparison would be between NPM packages and Clojure libraries.