Migrating dmd to D?

Daniel Murphy yebblies at nospamgmail.com
Sat Mar 2 02:05:06 PST 2013


"Zach the Mystic" <reachBUTMINUSTHISzach at gOOGLYmail.com> wrote in message 
news:bueceuemxqmflixkqbuz at forum.dlang.org...
> On Saturday, 2 March 2013 at 04:28:40 UTC, Zach the Mystic wrote:
> You would definitely need an identifier translation table:
>
> "Dsymbols *" -> "Dsymbol[]"

Might as well just define ArrayBase etc

> "NULL" -> "null"

Sure, but what about all the places 0 is used to mean NULL?

> `//printf("...%d...", s)` -> `writef("...%s...", s)`

Why not just keep it as printf?

> "#ifdef XIFDEFVERSION" + nested ifdefs + "#endif"
> -> "version(XIFDEFVERSION) {" + nested {}'s + "}"
>
> "#ifdef 0" -> "version(none)"
>

No luck, dmd source uses #ifdefs mid-declaration, mid-statement, and 
mid-expression (even mid-string-literal)
It also uses #ifs with complex conditions.

And don't forget no-args ctors, implicit calling of ctors, stack allocated 
classes, new keywords, narrowing integer conversions, 'virtual', pure 
virtual function syntax, macros as expression aliases, string literal 
constness, the EXP_CANT_INTERPRET cast hack, macros, namespaces, macros, 
structs using inheritance, and of course more macros. 




More information about the Digitalmars-d mailing list