[erlang-questions] Programming Erlang: Chap 18, Websockets
Jesper Louis Andersen
Mon Jun 26 14:48:21 CEST 2017
On Sun, Jun 25, 2017 at 11:00 PM Joe Armstrong <erlang@REDACTED> wrote:
> Welcome to the world of broken software.
> In my opinion this (making sure software evolution does not break
> existing functioning software) is one of the biggest remaining
> software problems - my guess is that this problem is getting worse
> (due to the explosion in the numbers of programming languages,
> libraries and frameworks and build systems) and will be even worse in
> the IoT world.
> Lots for you guys to work on :-)
I think a viable source of inspiration is biology. A cell will have
situations in which it will have to adapt to the "new interface." (whatever
that is). Obviously, cells manage to do this, partly because the "API" is
simple enough you can apply fixes.
Currently, code needs continuous maintenance to survive. If you don't, then
the code will eventually rot and become unusable. As Richard and you
observe, the more dependencies, the less your adaptability. This is a
darwinistic approach, but the fitness function is obviously wrong. Effort
that doesn't mean the code is good, elegant or adaptable.
The hard part is that we'd like some code to be ephemeral. Perry Metzger
observes that hardware is ephemeral: it naturally breaks down, and so does
the errors in the hardware as a result. Software has the ability to survive
hardware generations which means that it is far more persistent. This is
dangerous from a security perspective. It is dangerous from a correctness
perspective as well. We need to kill the right kind of code by making it
not work anymore.
I'm a big fan of something like Golang's `fix` tool. Before 1.0, you could
run `go fix` and have your code rewritten to match the new spec
automatically. Wrangler in the Erlang world by Simon Thompson can do the
same for when things are altered. In the C world, semantic patches as in
Coccinelle is highly useful for the same thing since you can apply a fix
all over a code base easily.
I'd really like a set of "fixups" which applies globally to code. If we
look at the ezwebframe problems 7stud encountered, they are all fairly
trivial rewrites. We even have a coherent hivemind (e.g., Tristan :) who
knows what the problems are and how to fix them. With a bit of luck, we can
take fixes in one project and apply them to other projects. Projects where
the fixups are not easy are probably fit for a black hole.
I'd also like a repository of formally proven algorithms which can be
extracted from e.g. Coq into different programming languages. This would
allow us to reuse components which have a high level of assurance all over
the place. To get this to work, however, we would need political support.
You have to outright demand that level of assurance, or companies will
gravitate toward the simplest solution which works.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions