{"title":"警官:一个很棒但错误的主意","authors":"Y. Klimiankou","doi":"10.1109/ISPRAS47671.2019.00007","DOIUrl":null,"url":null,"abstract":"The introduction of the \"constexpr\" feature in the C++11 standard has raised a great interest in the compile-time function execution in the programming languages communities. In this paper, we evaluate this feature and argue that while the compile-time evaluations are valuable optimization methods, its explicit support on the level of a programming language is a wrong decision. We show that compile-time evaluations must be enforced by the compiler automatically and transparently to the developer. Finally, we propose a programming language design principle stating that positive optimization \"hints\" must not be a part of programming language.","PeriodicalId":154688,"journal":{"name":"2019 Ivannikov Ispras Open Conference (ISPRAS)","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Constexpr: A Great Good but Wrong Idea\",\"authors\":\"Y. Klimiankou\",\"doi\":\"10.1109/ISPRAS47671.2019.00007\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The introduction of the \\\"constexpr\\\" feature in the C++11 standard has raised a great interest in the compile-time function execution in the programming languages communities. In this paper, we evaluate this feature and argue that while the compile-time evaluations are valuable optimization methods, its explicit support on the level of a programming language is a wrong decision. We show that compile-time evaluations must be enforced by the compiler automatically and transparently to the developer. Finally, we propose a programming language design principle stating that positive optimization \\\"hints\\\" must not be a part of programming language.\",\"PeriodicalId\":154688,\"journal\":{\"name\":\"2019 Ivannikov Ispras Open Conference (ISPRAS)\",\"volume\":\"30 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2019-12-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2019 Ivannikov Ispras Open Conference (ISPRAS)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/ISPRAS47671.2019.00007\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 Ivannikov Ispras Open Conference (ISPRAS)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ISPRAS47671.2019.00007","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
摘要
c++ 11标准中引入的“constexpr”特性引起了编程语言社区对编译时函数执行的极大兴趣。在本文中,我们评估了这一特性,并认为尽管编译时求值是有价值的优化方法,但在编程语言层面上对其的显式支持是一个错误的决定。我们说明编译时计算必须由编译器自动执行,并且对开发人员是透明的。最后,我们提出了一个编程语言设计原则,即积极的优化“提示”不能成为编程语言的一部分。
The introduction of the "constexpr" feature in the C++11 standard has raised a great interest in the compile-time function execution in the programming languages communities. In this paper, we evaluate this feature and argue that while the compile-time evaluations are valuable optimization methods, its explicit support on the level of a programming language is a wrong decision. We show that compile-time evaluations must be enforced by the compiler automatically and transparently to the developer. Finally, we propose a programming language design principle stating that positive optimization "hints" must not be a part of programming language.