How can we make it easier to experiment with the compiler?

Walter Bright newshound2 at digitalmars.com
Thu May 27 05:08:41 UTC 2021


On 5/24/2021 4:24 AM, Alexandru Ermicioi wrote:
> Please limit use of abbreviations to minimum, and those that are used, should be 
> documented.

   grep -w aa *.d

yields:

argtypes_aarch64.d: * 
https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst.
clone.d:             * int[S] aa;   // Currently AA key uses bitwise comparison
dinterpret.d:                 *     aa[i][j] op= newval;
dinterpret.d:                 *     aa = [i:[j:T.init]];
dinterpret.d:                 *     aa[j] op= newval;
dinterpret.d:            // Create a CTFE pointer &aa[index]
dinterpret.d:private Expression interpret_aaApply(UnionExp* pue, InterState* 
istate, Expression aa, Expression deleg)
dinterpret.d:    aa = interpret(aa, istate);
dinterpret.d:    if (exceptionOrCantInterpret(aa))
dinterpret.d:        return aa;
dinterpret.d:    if (aa.op != TOK.assocArrayLiteral)
dinterpret.d:    AssocArrayLiteralExp ae = cast(AssocArrayLiteralExp)aa;
dmangle.d:    private extern(D) bool backrefImpl(T)(ref AssocArray!(T, size_t) 
aa, T key)
dmangle.d:        auto p = aa.getLvalue(key);
dsymbol.d:        AliasAssign aa = new AliasAssign(loc, ident,
dsymbol.d:        return aa;
e2ir.d:            elem *aa = toElem(ie.e2, irs);
e2ir.d:            // aaInX(aa, keyti, key);
e2ir.d:            elem *ep = el_params(key, keyti, aa, null);
e2ir.d:                //      *aaGetY(aa, aati, valuesize, &key);
e2ir.d:                //      *aaGetRvalueX(aa, keyti, valuesize, &key);
expression.d:         *     aa[k1][k2][k3] op= val;
expression.d:         *     auto ref __aatmp = aa;
expressionsem.d:                 *  aa.remove(arg) into delete aa[arg]
expressionsem.d:                    ce.error("expected key as argument to 
`aa.remove()`");
expressionsem.d:                     *      aa[key] = e2;
expressionsem.d:                     *      ref __aatmp = aa;
sideeffect.d:             *  S[int] aa;
sideeffect.d:             *  aa[1] = 0;
sideeffect.d:             *  1 in aa ? aa[1].value = 0 : (aa[1] = 0, 
aa[1].this(0)).value;
sideeffect.d:             *  int value = (aa[1] = 0);    // value = aa[1].value

which is not perfect, but very helpful. It usually means "Associative Array", 
but sometimes "AliasAssign". grep is very, very handy at this sort of thing. I 
use it constantly.


> Yet there is no official guidance on where to start. Also, please note that not 
> all volunteers prefer reading source code, and invest hours at understanding the 
> architecture and inner workings, starting from lexer or parser, some of them 
> just want to fix a small bug, and be done with it. It is extremely hard to do 
> that now.

Start here:

   https://github.com/dlang/dmd/blob/master/src/dmd/README.md

Each source file has handy links at the start. For example, dsymbol.d:

   https://github.com/dlang/dmd/blob/master/src/dmd/dsymbol.d

has a link to its documentation generated from Ddoc:

   https://dlang.org/phobos/dmd_dsymbol.html



More information about the Digitalmars-d mailing list