Where are the the comments in dmd?

Walter Bright newshound2 at digitalmars.com
Fri May 7 09:32:11 UTC 2021


On 5/3/2021 6:17 AM, Blatnik wrote:
> Honestly another difficult thing to get is the file names themselves.
> 
> `ty.d`

TYpes

> `ph2.d`

Precompiled Headers

> `mars.d`

Entry point. So named when D was originally the "Mars" programming language. It 
was the first source file! I tend to name the source file that contains the 
program entry point with the name of the ultimate executable.

> `melf.d`

The D translation of "melf.h", a system file

> `fp.d`

Floating Point

> `ee.d`

Execution Environment

> `e2ir.d`,

Expression To Intermediate Representation

> `eh.d`

Exception Handling

> `el.d`

ELements

> I get that it's probably nice to not have to type a lot in the import statements 
> when you actually know what the all the files are after a year of hacking, but 
> it's really hard to guess where something is.

Now you know. No need to guess anymore!

> Also, a lot of comments are rather useless.
> 
> /*********************************
>   * Loop data structure.
>   */
> 
> struct loop { ... }


Holds the state for analyzing Loops in the optimizer


> struct loc_t
> {
>      elem *e;
>      int flags; // LFxxxxx
> }
> ```
> 
> Ahhh that's what the flags are, I totally get it now. Thanks comment! :P

No reason to copy/paste the LF comments.

> There's basically no way to know what something is for without doing a grep for 
> it across the entire codebase..

Indeed. Grep is your best friend, unless you have an IDE that can automatically 
take you to the definition of a type.


More information about the Digitalmars-d mailing list