www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - DLP - D Language Processing 0.3.0 - infer attributes

reply Jacob Carlborg <doob me.com> writes:
I would like to announce a new release of DLP, 0.3.0.

For those not familiar with DLP, it's a tool collecting commands/tasks 
related to processing the D programming language. It uses the DMD 
frontend as a library to process D code.

The major new feature in this release a new command that has been added: 
`infer-attributes`. This command will print the inferred attributes of 
all functions that are normally not inferred by the compiler. These are 
regular functions and methods. Templates, nested functions and lambdas 
are inferred by the compiler and will not be included by this command. 
By default, virtual methods are not inferred. Use the flag 
`--include-virtual-methods` to enable inferring of virtual methods.

The attribute inference is enabled only on the file that is currently 
being processed. This is to avoid the tool outputting attributes that 
would not be valid unless other files are modified. For example, your 
code is calling a third-party function. The third-party function is 
inferred to be `pure`. Now your function is inferred to be `pure` as 
well. But if you only change your function to be `pure`, it will fail to 
compile because the third-party function has not been updated.

The intention of this command is to help you in adding attributes to 
your code. You don't have to figure out exactly which attributes you can 
add to a function, just have the compiler tell you instead. It's 
recommend to run DLP in an iterative process. Run it on a file, update 
the file with the new attributes, run it again and repeat the process 
until the tool doesn't output any more inferred attributes.

The release is available here [1]. Pre-compiled binaries are available 
for macOS, FreeBSD and Linux 64bit and Windows 32bit and 64bit.

For the full change log, see [1].

[1] https://github.com/jacob-carlborg/dlp/releases/tag/v0.3.0


-- 
/Jacob Carlborg
Dec 18 2020
parent reply Dave P. <dave287091 gmail.com> writes:
On Friday, 18 December 2020 at 20:07:25 UTC, Jacob Carlborg wrote:
 I would like to announce a new release of DLP, 0.3.0.
 [...]
Looks very useful. Something strange I noticed though, it seems to be doing the analysis in 32 bits? I had some static assertions go off due to this which halted the program. I’m using a mac on with macOS 10.15 if that changes anything.
Dec 18 2020
parent Jacob Carlborg <doob me.com> writes:
On 2020-12-19 00:26, Dave P. wrote:

 Looks very useful. Something strange I noticed though, it seems to be 
 doing the analysis in 32 bits? I had some static assertions go off due 
 to this which halted the program.
Wow, I haven't noticed that. That's not indented. I've created an issue [1] and I'll take a look at it. [1] https://github.com/jacob-carlborg/dlp/issues/7 -- /Jacob Carlborg
Dec 19 2020