No -c no main()

Steve Teale steve.teale at britseyeview.com
Fri Mar 20 11:10:49 PDT 2009


> > dmd -c a.d
> > dmd -c b.d 
> > dmd -c c.d
> > dmd a.obj b.obj c.obj --main=b.obj
> > 
> > in the above all three obj files have a main() method. this time it must be the *linker* that needs to understand the flag and only link the main() function into the executable. this requires changing the linker which is written in asm so less likely to happen. 
> > 
> > I was not suggesting D to use a VM or the class-loader concept as in Java. even if we want that concept in D it needs to have a different implementation than in Java since there are problems with the way Java does this. (that's besides the differences due to the JVM)
> 
> I understand what you were suggesting. My point is that in Java, which 
> entry point to use is decided at run time, not compile time. From that 
> perspective, it's a useful feature. For a statically compiled language 
> like D, I don't see any obvious benefit. I mean, what is the benefit of 
> this over delegating to a specific pseudo-main method based on a 
> commandline arg or config file?
 
I just asked what I thought was a very simple question. It was not intended to be the stimulus for vast changes! This newsgroup could do with some moderation. Wandering off the original topic is normal, not just common! All should bear in mind that unless this is just intellectual wanking we need to get this language stabilized.

Then others might start to take it seriously.





More information about the Digitalmars-d mailing list