Vision for the D language - stabilizing complexity?
Timon Gehr via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jul 9 15:20:22 PDT 2016
On 09.07.2016 06:39, Andrew Godfrey wrote:
> On Friday, 8 July 2016 at 21:23:24 UTC, Timon Gehr wrote:
>> On 08.07.2016 04:25, Andrew Godfrey wrote:
>>>
>>> Another example is "return" used for monads in eg Haskell - even if it
>>> only has one meaning in Haskell, it is too mixed up with a different
>>> meaning in other common languages. D's "static if" - which is a killer
>>> feature if I ignore the keyword - gives me a similar feeling (though
>>> it's much less egregious than "return" in monads).
>>
>> 'return' in Haskell is perfectly fine.
>
> This (long) talk does a good job of explaining the problem with using
> the name 'return' in monads.
>
> https://www.infoq.com/presentations/functional-pros-cons#downloadPdf
> ...
The reason you linked to this (long) talk instead of a more digestible
source is that the presenter manages to bring across his flawed
argumentation in a way that is charismatic enough to fool a biased
audience.
It's a reasonable name. 'return' creates a computation that returns the
given value. This is a different corner in language design space, why
should C constrain Haskell's design in any way?
> Others have said it shorter.
Thanks for providing the links to that material.
> I took this example because it crosses
> languages. Of course we can't avoid clashing with other languages, there
> are only so many keywords to use. But there's definitely a principle
> here worth considering, that is if you care about D adoption.
> ...
I was complaining about the cheap shot at Haskell. This has become way
too fashionable.
> C# vs C++ have an example of a keyword clash too ("volatile" I think?)
>
That's a better example.
More information about the Digitalmars-d
mailing list