Hacker News new | past | comments | ask | show | jobs | submit login

Hi Walter. I have two and a half questions:

* Regarding the syntax of 'lazy'. It seems to me that it would make for better readability if the lazy keyword were required at the callsite, along the lines of doStuff(lazy getValueUsingExpensiveComputation()); rather than the current syntax where it's not clear at the callsite which, if any, of the arguments are lazy. C# does something similar with ref. What's the thinking behind D's syntax?

* What's the state, and future, of precise garbage collection in D?




Relevant post in a discussion thread that's related to the future of lazy in D: https://forum.dlang.org/post/ngkvntcrfdbsnxzfmcky@forum.dlan...


Yeah, lazy is a failure. Can't hit a homer every time. I'm not sorry we tried it. But it's time to take it behind the woodshed.


Why is lazy a failure and what makes it so?

And are there any languages where lazy is not a failure in your opinion?

Edit: removed link to wrong swift feature proposal.


> What's the thinking behind D's syntax?

Mainly that it be easy and quick for those familiar with C and C++ to get up to speed. With C, C++, and D, you cannot really know what will happen with the argument without looking at the corresponding parameter declaration.


Got it, thanks.



That page links to [0] which says that certain patterns become unsafe using the precise GC.

[0] https://dlang.org/spec/garbage.html#precise_gc




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: