Yeah, something like that I can imagine, as the effects of that shouldn’t change the program. And for example in a linter, if it understood what you did at large, it could give some really good tips.
What I was imagining there, was that it took liberal decisions based on how it interprets your specification.
For example, instead of writing a for-loop that takes two lists, subtracts each element from the other and puts each loop-result into a list, you would just tell it “Subtract listA from listB and put that into listC”.
And then it might misinterpret that as you meaning you want it to calculate the average of each list and subtract those averages from each other, or something like that.
Well, as I said, hard to imagine, especially when many high-level languages already allow you to express the above example very precisely as e.g. “val listC = listA.zip(listB).map((a, b) => b - a)”.
Yeah, something like that I can imagine, as the effects of that shouldn’t change the program. And for example in a linter, if it understood what you did at large, it could give some really good tips.
What I was imagining there, was that it took liberal decisions based on how it interprets your specification.
For example, instead of writing a for-loop that takes two lists, subtracts each element from the other and puts each loop-result into a list, you would just tell it “Subtract listA from listB and put that into listC”.
And then it might misinterpret that as you meaning you want it to calculate the average of each list and subtract those averages from each other, or something like that.
Well, as I said, hard to imagine, especially when many high-level languages already allow you to express the above example very precisely as e.g. “val listC = listA.zip(listB).map((a, b) => b - a)”.