[Issue 11881] -betterC switch suffers from bit rot

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 12 22:39:58 PST 2015


https://issues.dlang.org/show_bug.cgi?id=11881

Mike <slavo5150 at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slavo5150 at yahoo.com

--- Comment #14 from Mike <slavo5150 at yahoo.com> ---
(In reply to Johannes Pfau from comment #13)
> 
> I'd say we introduce a core/config.di file with this content:
> ------------------
> enum RUNTIME_SUPPORTS_RTTI = false;
> enum RUNTIME_SUPPORTS_UTF_FOREACH = false; /*forach(dchar x; "utf8")*/ 
> enum RUNTIME_SUPPORTS_GC = false
> ------------------
> 
> If core/config.di isn't found the compiler automatically assumes false for
> all flags, i.e. a minimal runtime.
> 

I like this approach, but I believe Issue 12270 would provide a similar benefit
in a different way.  If TypeInfo were implemented in the runtime (or even in
the user's own code) and exposed through a .di file, then the compiler could
generate RTTI based on the implementation if finds. If the implementation it
finds is not what the code using it expects, the user will get compiler or
linker errors.  If no implementation is found, and not used, no code is
generated.  

I like that because it leverages the toolchain's intrinsic behavior.  No
special treatment for TypeInfo (well, you might need some special treatment to
support some of D's existing functionality).

--


More information about the Digitalmars-d-bugs mailing list