Re: GCC Plugin introduction

2021-03-30 Thread SAIFI

On Mon, 29 Mar 2021, Gabriele Serra wrote:



I have written a very basic article on GCC Plugins (how to build a plugin 
from the ground, some info on APIs, and how to instrument code). The material 
is based on GCC 9. The code is fully documented and working.


https://gabrieleserra.ml/blog/2020-08-27-an-introduction-to-gcc-and-gccs-plugins.html



Gabriele thanks for sharing the detailed write up.

in the spirit of 'gcc-help', can you please share pointers as to how one can 
profile C++ code using GCC plugins ?

in your example you mention 'f1 ()'; i'd like to replace that with a instance 
of class 'X' created and then profile or instrument a member function.

Have you explored that ? any preliminary thoughts on how does one go about 
doing it ?



warm regards
Saifi.



Re: GCC Plugin introduction

2021-04-01 Thread SAIFI

On Tue, 30 Mar 2021, SAIFI wrote:


On Mon, 29 Mar 2021, Gabriele Serra wrote:



 I have written a very basic article on GCC Plugins (how to build a plugin
 from the ground, some info on APIs, and how to instrument code). The
 material is based on GCC 9. The code is fully documented and working.

 
https://gabrieleserra.ml/blog/2020-08-27-an-introduction-to-gcc-and-gccs-plugins.html



Gabriele thanks for sharing the detailed write up.

in the spirit of 'gcc-help', can you please share pointers as to how one can 
profile C++ code using GCC plugins ?




Gabriele please see Stephen Friedl's blog posts on GCC plugins
https://stephanfr.com/category/gcc/

and git repo
https://github.com/stephanfr/GCCPlugin

Have you had a chance to see these posts during your literature survey ? Any 
thoughts ?


warm regards
Saifi.



Re: [RFC] database with API information

2022-09-09 Thread SAIFI
> 
> let's use a simple database, a CSV file for simplicity, and generate both 
> files from this.

Curious to learn, why wouldn't you want to do it in C++ itself ?

As an example, please see
https://github.com/cplusplus/lib-issues-software

warm regards
Saifi.


Re: [RFC] database with API information

2022-09-09 Thread SAIFI
On 9 September 2022 11:47:30 am UTC, Jonathan Wakely  
wrote:
>On Fri, 9 Sept 2022 at 12:17, SAIFI wrote:
>>
>> >
>> > let's use a simple database, a CSV file for simplicity, and generate both 
>> > files from this.
>>
>> Curious to learn, why wouldn't you want to do it in C++ itself ?
>>
>> As an example, please see
>> https://github.com/cplusplus/lib-issues-software
>
>That repo has been dead for years, maybe you want the still maintained code at:
>https://github.com/cplusplus/LWG/tree/master/src
>
>I'm not persuaded that 4000 lines of C++ code for processing XML into
>HTML is really a good alternative to 150 lines of Python.

To quote again, the OP words for emphasis, "let's use a simple database, a CSV 
file for simplicity, and generate both files from this."

Do you think the effort estimate to implement this requirement is "4000 lines 
of C++" ? 

Am i missing something here ?

warm regards
Saifi.


Re: [RFC] database with API information

2022-09-09 Thread SAIFI
>  ---Original Message---
>  From: Jonathan Wakely 
>  
>  > Am i missing something here ?
>  
>  OK ...
>  
>  This script would be needed to bootstrap GCC. Using C++ would mean
>  that we need to restrict it to C++11 (since that's all that is needed
>  for bootstrapping GCC), and deal with all the peculiarities of the
>  platform's C++ compiler and linker. We already do that to build GCC
>  itself, but now we'd also need to do it for this tool that has to be
>  built first, and would need to use all the right CXXFLAGS and LDFLAGS
>  etc. to compile on the build machine (which might have unconventional
>  linker properties, for example). 

Perhaps this is something the current build scripts take care of anyway. Is it 
possible to reuse ?


> We'd also need to implement a CSV parser from scratch.
>  

Would any of the C++11 compliant CSV parsing libraries make the cut in your 
analysis ?

Vince CSV parser (RFC4180 + flavours)
https://github.com/vincentlaucsb/csv-parser

C++11 header only (MT can be turned on/off).
https://github.com/ben-strasser/fast-cpp-csv-parser

If not, Is there is something else that is needed for the CSV parsers to 
qualify ?

Thanks for sharing your perspective. Much appreciated !


warm regards
Saifi.


Re: [RFC] database with API information

2022-09-09 Thread SAIFI
>  ---Original Message---
>  From: Jonathan Wakely 
> 
>  > Would any of the C++11 compliant CSV parsing libraries make the cut
>  > in your analysis ?
>  
>  I'm not going to waste my time looking.
>  
>  > Vince CSV parser (RFC4180 + flavours)
>  > https://github.com/vincentlaucsb/csv-parser
>  >
>  > C++11 header only (MT can be turned on/off).
>  > https://github.com/ben-strasser/fast-cpp-csv-parser
>  >
>  > If not, Is there is something else that is needed for the CSV
>  > parsers to qualify ?
>  
>  Why add an extra dependency that would have to be included in the GCC
>  sources, when Python already has what's needed to do this.
>  
>  Somebody has written a new tool, and you seem to be asking them to
>  rewrite it for your preferences. If you want to rewrite the script in
>  C++ feel free to proposed a patch, but this digression for your
>  curiousity doesn't seem productive to me.

Well, it seems then the 'innocent CSV' proposed by Ulrich is the strawman that 
leads to meson !

Please feel free to correct me if that is not the 'unstated' intent.


warm regards
Saifi.