Re: DLP identify leaf functions

2018-11-30 Thread 12345swordy via Digitalmars-d-announce

On Friday, 30 November 2018 at 20:10:05 UTC, Jacob Carlborg wrote:
I would like to announce a new project I've started, called DLP 
(D Language Processing). Currently it's quite experimental but 
the idea is that it would contain a collection of commands for 
inspecting D code in various ways. It uses the DMD frontend as 
a library (the Dub package) to process D code.


This first release only contains one command, "leaf-functions". 
It will print out all leaf functions to standard out. A "leaf 
function" is considered a function that doesn't call any other 
functions or doesn't have a body. The use case for this is if 
you have a code base that you would like to add attributes to. 
Since most attributes causes the function they're attached to 
be constraint in which other functions they can call, "@nogc" 
functions can only call other "@nogc" functions, "pure" 
functions can only call other "pure" functions and so on. 
Therefore it makes most sense when starting to add attributes 
to a code base to start with the leaf functions, the functions 
that don't call any other functions.


Pre-compiled binaries are available for macOS, Linux and 
Windows.


https://github.com/jacob-carlborg/dlp
In all honestly I think the compiler should make some test with 
regards to the system attrubutes and create attributes if it 
passes or fails. @unpure, @unsafe, @gc.

The downside of this is the increase of compile time.


DLP identify leaf functions

2018-11-30 Thread Jacob Carlborg via Digitalmars-d-announce
I would like to announce a new project I've started, called DLP (D 
Language Processing). Currently it's quite experimental but the idea is 
that it would contain a collection of commands for inspecting D code in 
various ways. It uses the DMD frontend as a library (the Dub package) to 
process D code.


This first release only contains one command, "leaf-functions". It will 
print out all leaf functions to standard out. A "leaf function" is 
considered a function that doesn't call any other functions or doesn't 
have a body. The use case for this is if you have a code base that you 
would like to add attributes to. Since most attributes causes the 
function they're attached to be constraint in which other functions they 
can call, "@nogc" functions can only call other "@nogc" functions, 
"pure" functions can only call other "pure" functions and so on. 
Therefore it makes most sense when starting to add attributes to a code 
base to start with the leaf functions, the functions that don't call any 
other functions.


Pre-compiled binaries are available for macOS, Linux and Windows.

https://github.com/jacob-carlborg/dlp

--
/Jacob Carlborg