Live data from Hacker News

Self Healing Code with clojure.spec

blog.cognitect.com

11–20 of 30 posts

Re: Self Healing Code with clojure.spec

#11
post #6

Haven't we been there already? Systems that would run code, no matter what? The result was, that systems could be hacked by committing flawed code- which would execute completely different then intended without ever throwing a error message? The Error this was, brought forth the fail early, fail loud approach?

Did you happen to read the article _and_ have basic knowledge of spec at the same time?

Re: Self Healing Code with clojure.spec

#12
post #10
post #5

So basically, error handling code? I apologize, but I don't see what's new in this?

All of your error handling code re-writes functions in live code to replace failing function calls with calls to function that would succeed?

No, because that would be stupidly expensive. Besides, it would introduce a second problem: fixing the healing code - more specifically the parts that validate the candidate functions, which can be bugged as well as anyone who as written automated tests knows.

But I guess that saying that your system died from autoimmune disease is way more "exciting" than saying that it died from a segfault.

Re: Self Healing Code with clojure.spec

#13

Good idea. I get that it was a demonstration of the application of spec but for a real implementation of self-healing code, in my opinion, there needs to be a way to verify that the problem the matched functions are supposed to be solving is the same instead of relying on some sort of statistical confidence via IO sampling.

Why? What's wrong with inducing the function?

(Genuinely curious.)

Re: Self Healing Code with clojure.spec

#14
I don't think I'd want code to self-heal on the fly, even less in anything safety critical.

But maybe a similar method could be used as part of static analysis to help programmers. It could look through your functions and search for library functions you could import to replace them with. Or it could look for functions that do very nearly the same, but handle edge cases differently.

Re: Self Healing Code with clojure.spec

#15
This is probably a reflection of my own incomplete understanding of Erlang & BEAM, but doesn't Erlang have the capability to achieve this same end? Hot-loading new code etc?

(This comment is not meant as a criticism of the blog post btw, just a slightly related question)

Re: Self Healing Code with clojure.spec

#16
post #14

I don't think I'd want code to self-heal on the fly, even less in anything safety critical. But maybe a similar method could be used as part of static analysis to help programmers. It could look through your functions and search for library functions you could import to replace them with. Or it could look for functions that do very nearly the same, but handle edge cases differently.

How can this be used as a part of static analysis, when it works by running your code?

Re: Self Healing Code with clojure.spec

#17
post #13

Good idea. I get that it was a demonstration of the application of spec but for a real implementation of self-healing code, in my opinion, there needs to be a way to verify that the problem the matched functions are supposed to be solving is the same instead of relying on some sort of statistical confidence via IO sampling.

Why? What's wrong with inducing the function? (Genuinely curious.)

What's wrong with quantum mechanics? Same thing. If the problem isn't exactly the same then the outputs will actually differ in"edge" cases. And the problem is when trying to induce the problem we don't at first know to what degree of exactness we can make confirmations. So we either need to (a) take a long time to learn or otherwise know exactly what the problem is or (b) have the degree of wisdom (eyesight) to already be able to confirm that the problem-function will have no unexpected outputs at a glance by checking key features despite the wise person not having directly sampled/computed all possible outputs.

Re: Self Healing Code with clojure.spec

#18
The article clearly explains how self-healing code works. However, what I don't understand is why this is a good idea in the first place. If you can't correctly write a function that meets a given specification, what makes you think that some random recombination of code you've previously written will meet the specification?

Re: Self Healing Code with clojure.spec

#19

The article clearly explains how self-healing code works. However, what I don't understand is why this is a good idea in the first place. If you can't correctly write a function that meets a given specification, what makes you think that some random recombination of code you've previously written will meet the specification?

Machine learning algorithms do exactly that--they "write" a function that humans couldn't write by hand. What makes you think we couldn't eventually do the same here?

Re: Self Healing Code with clojure.spec

#20
post #19

The article clearly explains how self-healing code works. However, what I don't understand is why this is a good idea in the first place. If you can't correctly write a function that meets a given specification, what makes you think that some random recombination of code you've previously written will meet the specification?

Machine learning algorithms do exactly that--they "write" a function that humans couldn't write by hand. What makes you think we couldn't eventually do the same here?

There's a qualitative difference between tuning parameters that are real numbers (exploring a continuous space with a meaningful notion of “marginally better”) and coming up with code on the fly (exploring a discrete space of syntax trees, which can only be done by enumerating them). Topological considerations can give you an idea of what kinds of things are worth trying.
Post reply on HN