D seems interesting, but...

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Oct 15 10:53:15 PDT 2012


On 10/15/12 1:37 PM, foobar wrote:
> On Monday, 15 October 2012 at 15:22:38 UTC, Andrei Alexandrescu wrote:
> <snip>
>>>
>>> Yes, this is a nice thing Java, .NET and Python have.
>>
>> Wonder if a simple convention would suffice, e.g. every module that
>> wanna defines a moduleMain(string[] args) and then you have one module
>> main.d that has:
>>
>> void main(string[] args) { import wuddever; moduleMain(args); }
>>
>>
>> Andrei
>
> Great idea! But why add another (redundant) level of indirection?
> It should go in the C main in druntime together with a mechanism to call
> the correct D main, by e.g. reading the module name from the command line.

Well there's a tension here: good language design generally aims at 
providing few general features applicable to many use cases. Encoding 
particular use cases in the language is warranted by either 
disproportionate frequency in use or disproportionate difficulty in 
implementing them within the language. I don't think this particular 
feature scores very highly in either category.


Andrei


More information about the Digitalmars-d mailing list