www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - why remove octal literal support?

reply d007 <d007 gmail.com> writes:
dlang is know for compile speed,  but in reality d project 
compile slow because so much ctfe and tempalte.


Why bring more ctfe call by remmove octal literal ?
Nov 03 2023
next sibling parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Friday, 3 November 2023 at 15:07:41 UTC, d007 wrote:
 dlang is know for compile speed,  but in reality d project 
 compile slow because so much ctfe and tempalte.


 Why bring more ctfe call by remmove octal literal ?
What are you even saying?
Nov 03 2023
prev sibling next sibling parent Adam D Ruppe <destructionator gmail.com> writes:
On Friday, 3 November 2023 at 15:07:41 UTC, d007 wrote:
 dlang is know for compile speed,  but in reality d project 
 compile slow because so much ctfe and tempalte.
Some ctfe and templates are slow. Usually larger functions or array/string append loops end up being to blame. Octal literals don't really matter either way because they're so small.
Nov 03 2023
prev sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On Friday, 3 November 2023 at 15:07:41 UTC, d007 wrote:
 dlang is know for compile speed,  but in reality d project 
 compile slow because so much ctfe and tempalte.


 Why bring more ctfe call by remmove octal literal ?
octal literals are extremely error prone, because people sometimes use leading zeroes for alignment, not realizing that it means the number is completely different. Actual correct octal literal use is vanishingly small. Banning C-style octal literals just makes it so the compiler flags unintended errors like this. -Steve
Nov 03 2023
parent reply d007 <d007 gmail.com> writes:
On Friday, 3 November 2023 at 15:34:37 UTC, Steven Schveighoffer 
wrote:
 On Friday, 3 November 2023 at 15:07:41 UTC, d007 wrote:
 dlang is know for compile speed,  but in reality d project 
 compile slow because so much ctfe and tempalte.


 Why bring more ctfe call by remmove octal literal ?
octal literals are extremely error prone, because people sometimes use leading zeroes for alignment, not realizing that it means the number is completely different. Actual correct octal literal use is vanishingly small. Banning C-style octal literals just makes it so the compiler flags unintended errors like this. -Steve
Thanks you all for explain. In my opinion, use some thing like 0o700 will be a better solution compare to template.
Nov 05 2023
parent Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Sunday, November 5, 2023 9:59:22 PM MST d007 via Digitalmars-d-learn wrote:
 On Friday, 3 November 2023 at 15:34:37 UTC, Steven Schveighoffer

 wrote:
 On Friday, 3 November 2023 at 15:07:41 UTC, d007 wrote:
 dlang is know for compile speed,  but in reality d project
 compile slow because so much ctfe and tempalte.


 Why bring more ctfe call by remmove octal literal ?
octal literals are extremely error prone, because people sometimes use leading zeroes for alignment, not realizing that it means the number is completely different. Actual correct octal literal use is vanishingly small. Banning C-style octal literals just makes it so the compiler flags unintended errors like this. -Steve
Thanks you all for explain. In my opinion, use some thing like 0o700 will be a better solution compare to template.
I general, D's approach at this point is to have a solution be in the standard library rather than in the language if it doesn't need to be in the language. And in this case, not only does a template solve the problem quite easily, but it's solving a problem that only rarely needs to be solved these days. So, while some might prefer a language solution, this really isn't the sort of problem that D is likely to solve in the language at this point. - Jonathan M Davis
Nov 05 2023