www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What does the -betterC switch in dmd do?

reply TheFlyingFiddle <borin.lukas gmail.com> writes:
The description in dmd help says: omit generating some runtime 
information and helper functions.

What runtime information are we talking about here?  My 
understanding is that it's basically an experimental feature but 
when (if) completed what subset of the language would still be 
usable?
Nov 12 2015
parent reply Justin Whear <justin economicmodeling.com> writes:
On Thu, 12 Nov 2015 19:37:41 +0000, TheFlyingFiddle wrote:

 The description in dmd help says: omit generating some runtime 
 information and helper functions.
 
 What runtime information are we talking about here?  My 
 understanding is that it's basically an experimental feature but 
 when (if) completed what subset of the language would still be 
 usable?
I believe the purpose of the switch is to help folks who are trying to write for bare or embedded systems by not emitting references to the D runtime library and runtime module information. Whether it actually does that in its current implementation is another question.
Nov 12 2015
parent reply Jacob Carlborg <doob me.com> writes:
On 2015-11-12 23:24, Justin Whear wrote:

 I believe the purpose of the switch is to help folks who are trying to
 write for bare or embedded systems by not emitting references to the D
 runtime library and runtime module information.  Whether it actually does
 that in its current implementation is another question.
I'm pretty sure that the only things that are excluded are module info and type info. It's still possible to use "new" and all the array features that requires support in the runtime (slicing, concatenation, appending and so on). -- /Jacob Carlborg
Nov 15 2015
next sibling parent reply Meta <jared771 gmail.com> writes:
On Sunday, 15 November 2015 at 15:34:19 UTC, Jacob Carlborg wrote:
 I'm pretty sure that the only things that are excluded are 
 module info and type info. It's still possible to use "new" and 
 all the array features that requires support in the runtime 
 (slicing, concatenation, appending and so on).
Don't those features require type info?
Nov 15 2015
parent Jacob Carlborg <doob me.com> writes:
On 2015-11-16 01:27, Meta wrote:

 Don't those features require type info?
Hmm, now that you mention it. I expected the compiler to give an error as soon as the D runtime was referenced, but that's at least not the case. -- /Jacob Carlborg
Nov 16 2015
prev sibling parent Mike <none none.com> writes:
On Sunday, 15 November 2015 at 15:34:19 UTC, Jacob Carlborg wrote:

 I'm pretty sure that the only things that are excluded are 
 module info and type info. It's still possible to use "new" and 
 all the array features that requires support in the runtime 
 (slicing, concatenation, appending and so on).
In my experience, the only thing removed by -betterC is the ModuleInfo [1] However, there is a pending pull request to remove TypeInfo also [2] I don't think it was every fully implemented to the author's intention, and I'm not sure if it ever will be [3] Mike [1] http://forum.dlang.org/post/mailman.273.1386260316.3242.d.gnu puremagic.com [2] https://github.com/D-Programming-Language/dmd/pull/5105 [3] http://forum.dlang.org/thread/lddug4$jgv$1 digitalmars.com
Nov 16 2015