News for hackers. Stuff that matters.
Re:A regression is the kernel not giving the same result wit... by pjmlp on Thursday November 02, 2017 @08:44AM (#15609851)
Rich Hickey has a wonderful talk about it.

"Spec-ulation" - https://www.youtube.com/watch?v=oyLBGkS5ICk

Which I fully agree with, basically there are no major, minor, patch level changes, in reality every change is a possible breaking changes, because we don't control what downstream is doing with our software.

Re:A regression is the kernel not giving the same result wit... by majewsky on Thursday November 02, 2017 @10:24AM (#15610640)
> there are no major, minor, patch level changes, in reality every change is a possible breaking changes

I noticed this when recently writing a spec that defines backwards-compatibility. There's surprisingly few things you can do when you want to stay backwards-compatible.

Re:A regression is the kernel not giving the same result wit... by greggyb on Thursday November 02, 2017 @11:12AM (#15611112)
It's much like an immutable data store. You get one operation: insert.

With full backward compatibility, you agglomerate features, and changes are implemented as optional, with the default being the old behavior.

You can add layers that depend on existing code, but you cannot make existing code depend on those new layers.

Re:A regression is the kernel not giving the same result wit... by tome on Thursday November 02, 2017 @09:47AM (#15610344)
Oh well, he should try a language with types ...

/me runs ...

Re:A regression is the kernel not giving the same result wit... by spraak on Thursday November 02, 2017 @10:12AM (#15610534)
What are you trying to say? There are already a lot of explanations for why Clojure is dynamically typed and how it fills its role nicely that way.
Re:A regression is the kernel not giving the same result wit... by tome on Thursday November 02, 2017 @10:21AM (#15610602)
I know, I know. We've been having some interesting discussions about Clojure, Haskell and dynamic and static typing on these stories

https://news.ycombinator.com/item?id=15602658

https://news.ycombinator.com/item?id=15593069

My comment was intended to be a wry one referencing those very interesting discussions and hinting that if you have types then you can more easily make breaking changes internally that aren't visible externally.

Re:A regression is the kernel not giving the same result wit... by nickbauman on Thursday November 02, 2017 @07:54PM (#15615479)
Dubious. The maintenance argument is weak. https://www.youtube.com/watch?v=2V1FtfBDsLU&feature=youtu.be...
Re:A regression is the kernel not giving the same result wit... by tome on Friday November 03, 2017 @10:35AM (#15619460)
I'm not sure what you mean. I thought it was self-evident that if your interface is an abstract type then you can change the implementation without breaking consumers. If you don't think it's true then please can you explain how? I thought the Clojure argument is not that types don't provide beneficial encapsulation, but that it's not worth paying the cost for them. Again if you know any different I'd be pleased to hear.
Re:A regression is the kernel not giving the same result wit... by nickbauman on Sunday November 05, 2017 @04:37PM (#15631772)
Apples and Oranges. We're talking about changing the interface. Did you watch the video segment?
Re:A regression is the kernel not giving the same result wit... by tome on Monday November 06, 2017 @12:34PM (#15637079)
> We're talking about changing the interface.

Who's "we"? I'm talking about changing the implementation.

> Did you watch the video segment?

I watched the bit where he said if you add a constructor to a sum type you have to change everywhere it's pattern matched. True. I'd love to see Clojure's solution where you don't have to change any existing code!

EDIT: Oh wait, I think it's even worse than that. I think he's talking about product types. In which case you should use projection functions and indeed you need to make no changes to old code!

Re:A regression is the kernel not giving the same result wit... by pjmlp on Thursday November 02, 2017 @10:16AM (#15610566)
All my favorite languages are typed and I do agree with him.
Re:A regression is the kernel not giving the same result wit... by tome on Thursday November 02, 2017 @10:21AM (#15610612)
Really? How so? If you have abstract types then you can easily make internal changes without making those changes visible externally.
Re:A regression is the kernel not giving the same result wit... by gmfawcett on Thursday November 02, 2017 @11:04AM (#15611028)
As a simple example, suppose I swap out one container type with another one in the internal code. Both implement the same interface/traits, so the change isn't visible to users. But the time complexity of the container operations are different on the new type, and the user was depending upon the time characteristics of the old container. E.g., deletions are now O(n) instead of O(1). I've violated a user expectation without breaking type safety.
Re:A regression is the kernel not giving the same result wit... by tome on Thursday November 02, 2017 @12:23PM (#15611804)
Nice counterexample!
Re:A regression is the kernel not giving the same result wit... by pjmlp on Thursday November 02, 2017 @10:48AM (#15610865)
Some examples,

1 - Not all changes can be kept internal, for example adding a new case to an ADT

2 - Internal changes can still alter the semantic of the API, even if from the outside everything still looks the same from the type system point of view

Re:A regression is the kernel not giving the same result wit... by tome on Thursday November 02, 2017 @12:23PM (#15611811)
Yes, both are true. 2 is a particularly good example.
Re:A regression is the kernel not giving the same result wit... by eternalban on Thursday November 02, 2017 @09:58AM (#15610397)
> there are no major, minor, patch level changes, in reality every change is a possible breaking changes

It is "possible" that my blowing my nose will disturb butterflies in China.

Internal to the organization that produces the software, they are highly meaningful. Extended to user base that reads the documentation, it remains equally meaningful.

Downstream that resists information and can not be controlled is on its own. Good luck.

Re:A regression is the kernel not giving the same result wit... by EGreg on Thursday November 02, 2017 @10:13AM (#15610542)
I agree that platforms should stay backward compatible as much as they can. That said, if upstream changes, sometimes you've got to change too.

There should be a mechanism for releasing breaking new major versions. And it is this:

1) Release a new version for all your DIRECT dependents. Ideally they should be subscribed to your updates.

2) After they have had ample time to test it, they will release an update for THEIR direct dependents.

At no time should C update A if C depends on B and B depends on A. In fact, ideally, if C depends on B1, ..., Bn then C will NOT upgrade A until all B's have upgraded. C should push the B's to do it and supply patches.

This means version pinning for all dependencies, my friends!!

The alternative is "dependency hell" or making multiple copies of A to live inside each B.

If some B's are taking their sweet time then it may be better for some C to submit a patch to B's repo, which even if not accepted can be pulled by other C's. The question is who "owns" or "maintains" a B project if they don't react to changes of some of their dependencies. The answer, I think, should be - fork the B if it's not being actively maintained.

Edit: I think HN needs a "reason for downvote" field, perhaps seen only by the person being downvoted. As it is, many downvotes convey very little useful information.

Re:A regression is the kernel not giving the same result wit... by cgdub on Thursday November 02, 2017 @11:24AM (#15611239)
If upstream changes, pick a better upstream.
Re:A regression is the kernel not giving the same result wit... by EGreg on Thursday November 02, 2017 @01:38PM (#15612451)
So if a large platform like facebook changes, simply stop supporting facebook? Wouldn't that kind of make your library very limited?