Purity, memoization and parallelization of dmd

Per Nordlöw per.nordlow at gmail.com
Thu Jul 16 18:58:18 UTC 2020


On Thursday, 16 July 2020 at 18:21:11 UTC, Per Nordlöw wrote:
> What's the status/progress on making dmd (completely) pure?
>
> Is this task on somebody's agenda? If so, are there any big 
> obstacles that currently has no clear solution or is just a 
> very large pile of small ones?
>
> And, in the long run, will a pure compiler (finally) enable 
> caching/memoization of, for instance, template 
> instantiations/ctfe-evaluations and, perhaps further into 
> future, parallelization of the compiler?

Natural obstacles with possible solutions are

- Global variables (of course) that should be stored in structs 
and/or classes
- Debug printing (fixed by prepending `debug` in front of 
printf's)
- File I/O can be wrapped in (fake)-pure input- and output-ranges 
that are lazy eagerly forwarded to stdout and stderr.


Have any of the alternative (experimental) D compilers been 
written with these things in mind? I recall there is any 
experimental D compiler which is complete lazy.


More information about the Digitalmars-d mailing list