Andrei Alexandrescu <> changed:

           What    |Removed                     |Added
           Keywords|                            |bootcamp
                 CC|                            |

--- Comment #10 from Andrei Alexandrescu <> ---
That would be an interesting project. I'm envisioning it as a standalone
program called e.g. "dlower" that lowers D code into a smaller subset of D.
Possible flags for that program:

--expand-mixins = expand all possible mixins in the code

--lookup = execute lookup on all symbols and write the full symbol, e.g.
writeln becomes .std.stdio.writeln

--operators = explicitate all user-defined operators, e.g. a + b becomes

--omit-function-bodies = do not output function bodies, .di style

--specialize-templates = write specialized versions for all templates used
within the module (this is likely to be tricky)

--scope = lower all scope statements into try statements

--foreach = lower all foreach statements into for statements

--explicit-import = specify the exact symbols needed for each import statement
(which means: if no symbols, the import is redundant - easy to mark as a
warning by a subsequent tool)

--static-if = evaluate all static ifs possible (this mostly makes sense if
--specialize-templates is also present)

--versions = lower code using version(), i.e. make the unused branch disappear

--omit-comments = make all comments disappear

--omit-nondoc-comments = make only non-documentation comments disappear

--ctfe = evaluate all possible CTFEs (tricky)

The tool should generate compilable D code with the same semantics as the input
and #line directives pointing to the input.

Such a tool would make possible a bunch of others. I'll talk to the graduate
students, maybe someone will take this.


Reply via email to