Difference between revisions of "Project Ideas"

From D Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
== Lowerer ==
 +
 +
This tool would "translate" compilable D code to compilable D code. See initial idea discussed in [https://issues.dlang.org/show_bug.cgi?id=5051 Issue 5051]. It would offer a variety of lowering services for purposes of tooling, debugging, and project management:
 +
 +
* expand all possible mixins in the code
 +
 +
* execute lookup on all symbols and write the full symbol, e.g. <tt>writeln</tt> becomes <tt>.std.stdio.writeln</tt>
 +
 +
* explicitate all user-defined operators, e.g. <tt>a + b</tt> becomes <tt>a.opBinary!"+"(b)</tt>
 +
 +
* do not output function bodies, <tt>.di</tt> style
 +
 +
* replace all wholesale <tt>import</tt>s with detailed <tt>import</tt>s that specify the symbols needed
 +
 +
* write specialized versions for all templates used within the module (this is likely to be tricky)
 +
 +
* lower all <tt>scope</tt> statements into <tt>try</tt> statements
 +
 +
* lower all <tt>foreach</tt> statements into <tt>for</tt> statements
  
== Lowerer ==
+
* 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)
 +
 
 +
* evaluate all <tt>static if</tt>s possible
 +
 
 +
* lower code using <tt>version()</tt>, i.e. make the unused branch disappear
 +
 
 +
* make all comments disappear
 +
 
 +
* make only non-documentation comments disappear
 +
 
 +
* evaluate all possible CTFEs (tricky)
 +
 
 +
* introduce named values instead of temporaries wherever order of evaluations is defined
 +
 
 +
* write deduced attributes for functions
  
 
== <tt>fork()</tt>-based Garbage Collector ==
 
== <tt>fork()</tt>-based Garbage Collector ==

Revision as of 00:02, 4 November 2016

Lowerer

This tool would "translate" compilable D code to compilable D code. See initial idea discussed in Issue 5051. It would offer a variety of lowering services for purposes of tooling, debugging, and project management:

  • expand all possible mixins in the code
  • execute lookup on all symbols and write the full symbol, e.g. writeln becomes .std.stdio.writeln
  • explicitate all user-defined operators, e.g. a + b becomes a.opBinary!"+"(b)
  • do not output function bodies, .di style
  • replace all wholesale imports with detailed imports that specify the symbols needed
  • write specialized versions for all templates used within the module (this is likely to be tricky)
  • lower all scope statements into try statements
  • lower all foreach statements into for statements
  • 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)
  • evaluate all static ifs possible
  • lower code using version(), i.e. make the unused branch disappear
  • make all comments disappear
  • make only non-documentation comments disappear
  • evaluate all possible CTFEs (tricky)
  • introduce named values instead of temporaries wherever order of evaluations is defined
  • write deduced attributes for functions

fork()-based Garbage Collector

Interfacing with C++

Linux debugger