digitalmars.D - Early detection of type errors in templates
- bearophile (9/9) Sep 14 2014 This paper suggests a way to improve the detection of errors
- Andrei Alexandrescu (2/11) Sep 14 2014 That's a solid paper, thanks. -- Andre
- Dicebot (4/13) Sep 17 2014 I am rather terrible at calculus and math in general, is it
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (9/12) Sep 17 2014 Try to read it backwards, and only the last page. Much easier! :-)
- Dicebot (8/21) Sep 19 2014 Well just from reading the concept it immediately felt like
This paper suggests a way to improve the detection of errors inside C++-style templated code without reducing expressivity of the templates (and without annotations or Concepts), I presume the same ideas are usable in D: "Early Detection of Type Errors in C++ Templates" by Sheng Chen, Martin Erwig: http://web.engr.oregonstate.edu/~erwig/papers/C++TemplateErrors_PEPM14.pdf Bye, bearophile
Sep 14 2014
On 9/14/14, 3:12 PM, bearophile wrote:This paper suggests a way to improve the detection of errors inside C++-style templated code without reducing expressivity of the templates (and without annotations or Concepts), I presume the same ideas are usable in D: "Early Detection of Type Errors in C++ Templates" by Sheng Chen, Martin Erwig: http://web.engr.oregonstate.edu/~erwig/papers/C++TemplateErrors_PEPM14.pdf Bye, bearophileThat's a solid paper, thanks. -- Andre
Sep 14 2014
On Sunday, 14 September 2014 at 22:12:23 UTC, bearophile wrote:This paper suggests a way to improve the detection of errors inside C++-style templated code without reducing expressivity of the templates (and without annotations or Concepts), I presume the same ideas are usable in D: "Early Detection of Type Errors in C++ Templates" by Sheng Chen, Martin Erwig: http://web.engr.oregonstate.edu/~erwig/papers/C++TemplateErrors_PEPM14.pdf Bye, bearophileI am rather terrible at calculus and math in general, is it possible to provide a very short example of errors that can be detected with such system?
Sep 17 2014
On Wednesday, 17 September 2014 at 16:06:06 UTC, Dicebot wrote:I am rather terrible at calculus and math in general, is it possible to provide a very short example of errors that can be detected with such system?Try to read it backwards, and only the last page. Much easier! :-) It appears to be a type system for reasoning about type safety in generic code without instantiating templates. I guess the most promising possibility is to infer type constraints on parameters directly from the code as well as detecting conflicts (they apparently have discussed something related to this in other papers dealing with "choice types"). But it appears to be a work in progress…
Sep 17 2014
On Wednesday, 17 September 2014 at 17:34:29 UTC, Ola Fosheim Grøstad wrote:On Wednesday, 17 September 2014 at 16:06:06 UTC, Dicebot wrote:Well just from reading the concept it immediately felt like something that D can use even better. It should be possible to infer concepts implicitly from the template constraints and match those to actual code in template body using proposed calculus. However I am not sure if I am just seeing what I want to see or it is really true.I am rather terrible at calculus and math in general, is it possible to provide a very short example of errors that can be detected with such system?Try to read it backwards, and only the last page. Much easier! :-) It appears to be a type system for reasoning about type safety in generic code without instantiating templates. I guess the most promising possibility is to infer type constraints on parameters directly from the code as well as detecting conflicts (they apparently have discussed something related to this in other papers dealing with "choice types"). But it appears to be a work in progress…
Sep 19 2014