D code running on the Nintendo 3DS

Iain Buclaw ibuclaw at gdcproject.org
Sun Oct 20 18:57:59 UTC 2019


On Sun, 20 Oct 2019 at 20:40, TheGag96 via Digitalmars-d-announce
<digitalmars-d-announce at puremagic.com> wrote:
>
> On Sunday, 20 October 2019 at 15:27:35 UTC, Iain Buclaw wrote:
> > Great stuff!  Though I don't think you'll find much improvement
> > in gdc 10 regarding switching off D features.  Backported
> > patches to make gdc on parity with dmd as of April 2019 was
> > done prior to the gdc 9 release.  I'm not aware of much more
> > being done regarding that other than some extern(C) library
> > functions being converted into templates, and the C main
> > function being moved to a common location in D runtime (C main
> > is not "compiled into" gdc unlike previous versions of dmd).
>
> Darn... Are there any plans at some point in the future to add a
> real -betterC sort of flag? It would be really really nice to be
> able to compile something like...
>
> import std.bitmanip : bitfields;
>
> struct Stuff {
>    mixin(bitfields!(
>          uint, "x",    2,
>          int,  "y",    3,
>          uint, "z",    2,
>          bool, "flag", 1));
> }
>
> extern(C) void main() {
>    Stuff x;
> }
>
> ...just as in DMD or LDC.

I called the option switch -fno-druntime, because -betterC was at the
time of invention (and still is) a terrible name for a switch.
Originally, for a long time, it just meant -fno-mduleinfo, but then
-fno-exceptions and -fno-rtti got added which warranted giving it a
name that turned off all three (well, four including D asserts, that
is not exposed as an option as far as I recall).

If the above works for you in the latest dmd, that's probably because
the library has improved, not the compiler. (You need to write code in
a way that doesn't depend on D runtime, not just expect the compiler
to do everything for you. :-)

-- 
Iain


More information about the Digitalmars-d-announce mailing list