On Wed, 12 Sep 2018 07:40:37 -0700 Ian Lance Taylor <i...@golang.org> wrote:
> The difference I see is that in one case we write code that can not be > compiled, and then tell the compiler not to compile it. > we direct the compiler to automatically insert wrappers that > make the type fit the contract. Who is supposed to write such wrapper, how does author of automata knows how to make any type fit the contract? What if automata decides to "make type fit" where author of the "unfit" contract **consciously** made her contract in a way to get some possible type(s) excluded? (eg due to implementation needs) And most important: How I as a code reader can know what kind of wrappers compiler may threw under the code that **I see**. > We never write code that can not be compiled. If an author of the `for type case` wrote the case she supposedly wrote a test case for that branch. So she will see because this branch will be tried. [ If "We never write code that can not be compiled" referred to CGG proposal's constraint clauses, I wholeheartedly agree to get them in backticks and name it "constraint identifiers". Syntax highliters can cope with that, too ] > I understand if you disagree but I would hope that you can express > your disagreement while avoiding language like "direction of doom." I humbly apologize for heavy words, I did not meant them to be insult to anyone. I love Go for its simplicity. I love Go for its readability. I did not miss generics much but I was happy seeing "generics proposal" from the team. I must admit that the idea of ‘lets infer constraint from a statement’ is so clever one. I see (or I think I see) how this approach can give an easy, lightweight and fast path to get working compiler. But now we are discussing contracts that are confusing even for developers that cut their teeth on Go (often after decades in other languages). Contracts that on one path say 'Generic Min is impossible' on other path (Alex') says 'generic methods are not welcome nor needed'. So, this brilliant idea that recently gave hope unfortunately outputs something that just does not read as Go, something that wrings my mind and swirl around instead of just telling constraints straight. Is it possible that it's abstruse only for me? That's why I am somewhat reluctant to back off on my doom premonitions, at least entirely, at least now. I apologize again for heavy words. Don't take them personally. > Thanks. > > Ian TC -- Wojciech S. Czarnecki << ^oo^ >> OHIR-RIPE -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.