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

user1234 user1234 at 12.de
Mon May 24 19:42:00 UTC 2021


On Monday, 24 May 2021 at 12:38:59 UTC, zjh wrote:
> We need `big changes`.
> We need `todolist`(order by important).
> We need to split big files into directories.
> Small refactoring is useless.
> `Big changes` are necessary.
> We separate the `stable part` from the `unstable part` of the 
> big file.And divided into `small files`.
> According to dependence, change from `the most dependent`.
> Interfacs or func name need not to change.
> It's just that the `organization` has to be changed.
> Nobody reads `thousands of lines` functions.
> No one reads `>100kb` coding files because they are too large.
> We just `split up` large files, not modify the function 
> implementation.
> Because modifying the function implementation is `most likely` 
> to make mistakes.

100 kb is let's say 2500 slocs (or rather 1500 from the D-Scanner 
pov), that's not too crazy. Many DMD source files are big because 
they contain a visitor.
visitors cant be split in several files. Often you only actually 
are interested by a single method of a visitor so the overhall 
size of a source does not matter.

Eventually what could be done for the biggest methods of visitors 
is to extract parts of the content to several **non-nested** free 
functions, so that no more low level implementation details, like 
control loops, are visible and instead you just see do_this; 
do_that; with just a few, nzzcessarily unavoidable, flow 
statements.

The problem is that extracting and splitting the content would be 
tedious because of the decade of more or less well organized 
patchwork added to fix the bugs.

PS: backticks are for inline code, sourround with pairs of stars 
or pairs of underscores.


More information about the Digitalmars-d mailing list