Is anyone aware of work on what I'd call "evolutio...
# thinking-together
k
Is anyone aware of work on what I'd call "evolution-safe programming"? The question is how one can write software in such a way that every part in every layer can evolve freely without breaking everything depending on it. There are some aspect of this in [Dark](https://darklang.com/) (recently discussed here), and in [Unison](http://unisonweb.org/), but is there any work on theoretical foundations or practical evaluation of proposed approaches?
👍 1
i
I've only heard this talked about in a rule-of-thumb or aspirational sense. For instance, that you should structure abstractions, or layers of your system, so that the things that are likely to be changed at the same time are easy to change at the same time, without needing to change any other things. Never really any explanation of how to do a good job of this. I've seen people say that composition via protocols (as opposed to class inheritance or interfaces) helps with this by allowing for better separation of concepts. The Clojure community is big on that. But again, nothing too formal. I believe the book Elements of Clojure by Zach Tellman (which is ostensibly more of a book of general principles than it is notions exclusive to Clojure) talks about this in more detail, but I haven't read it yet.
Rails, Phoenix, and similar web frameworks are seemingly designed with this as an underlying goal. They make an attempt to help you organize your web service into conceptually separate slices of domain logic ("resources"), and to organize each piece of each slice into a purpose-specific area of the codebase (model, view, migration, controller, services, script, stylesheet, etc). They also create homes for code that must be shared, for cross-cutting concerns (literally called "concerns" in Rails). So when you're working on a particular problem, you can think of it in terms of "I need to make a change that will affect just models", or "... a change that affects just the Users resource" and clearly identify which parts of the code need to be changed, and which don't. Of course, this falls apart in the real world, because resources are often tightly interdependent and it's hard to draw clear boundaries.
Elm does a little bit of this by using static types to enforce automatic semantic versioning, but that only really helps at the library level, not within a single codebase.
Rich Hickey gave a talk about safely evolving software and what the semantics around it are, but his recommendations were pretty controversial. Here's the HN discussion, so that you can get some meta commentary along with the talk itself if you'd like. https://news.ycombinator.com/item?id=13085952
👍 1
d
Like "sheer layers" in buildings: Being able to change the drapes without having to rip up the carpet
k
@Ivan Reese Wow, that's a lot of stuff, thanks! I am mostly interested in the large scale, i.e. library and language dependencies, rather than the internal structure of a code base. Rich Hickey's talk addresses most of the issues I was thinking of, and the comments on Hacker News add various points of view.
d
That's funny, because I would have thought that the applicability was more the other way around -- I guess it works both ways. I do know he had a whole other presentation on package dependencies though
i
Oh, I thought this was the talk about package dependencies
Maybe I linked the wrong talk
I was thinking of the one where he proposed never making breaking changes. If you need to make a breaking change, make a new thing with a different name instead.
s
We believe Storyscript could be a good fit for this idea because it’s simply a language for gluing microservices. Those microservices can evolve independently, AB test and micro-scale. Fully polyglot development, cloud-native at docs.storyscript.io
TBH I’m not sure a new language that replaces all other languages will truly transform the industry. IMO a new level of programming (call it top-level or cloud-native) should just be glue for polyglot microservices+functions+openapi+graphql+etc. — I’m still in shock that we (as a community) think a new one-size-fits-all language with an attitude of throw everything else out will resonate. It’s Smalltalk all over.
k
@Ivan Reese You linked exactly that talk!
👍 1