C++ TODOs

Hi all,

I am new to the list and have been lurking a few days. I am interested in clang mainly as a possible component for tools supporting the C++ language. As I may spend some spare time on the C++ support I would like to know more about what it involves. If there are any suggestions for small tasks (TODOs) that may give me a good introduction to developing for clang, that would be nice. Do you have some sort of roadmap for the C++ support that we plan to follow? If not, is the best way forvard something like this:

1. Find small basic C++ snipplets that work.
2. Add use of features as it is natural until something breaks. 3. Ask on the list if the found use-case this is a good one to fix now.
4. Implement, test, and post patch to list for revew. (reject, rework, repost as required)
5. If not tired, move back to #1.

Open source works best if you follow what makes you happy. Find a C++ code you like, and start compiling it. Could be g++.dg from the g++ testsuite, could be llvm, could be hello world.

Personally, I started with hello world. :slight_smile:

Try a snippet, see if it works, if it does, move on to next bit of code.
If it doesn't, implement the parser for it, then the AST for it, then the semantic actions for it, then the ast printer for it, then the codegen for it... rinse, repeat.

C is the focus right now. What if I say C++ roadmap begins and ends at "Eventually we want to support C++" ? :slight_smile:

Seriously, there is no simple answer. Until most of active developers shift their focus to C++, it is unlikely that C++ roadmap with enough details will emerge. However that should not stop you moving forward.

  Where do you want to start,

  - depends on your skill set ... do you consider yourself a C++ language lawyer ? power C++ developer ? programming language tools guy ? software designer ? skilled programmer interested in C++ ? newbie ? etc...

  - depends on your end goal ... develop C++ compiler, develop tools to analyze C++ code, tools to manage C++ project etc..

clang's well designed architecture includes separate preprocessor, lexer, parser, semantic analysis, AST, code generation modules. IMO, this will make your life easier once you decide where to start.

To get your feet wet, you may want to initially focus on areas where C and C++ language do not agree with each other. For example, Incompatibilities Between ISO C and ISO C++ .

Again it is up to you. Where ever you start, you want to follow incremental development model.

Devang Patel skrev:

Hi all,

I am new to the list and have been lurking a few days. I am interested
in clang mainly as a possible component for tools supporting the C++
language. As I may spend some spare time on the C++ support I would
like to know more about what it involves. If there are any suggestions
for small tasks (TODOs) that may give me a good introduction to
developing for clang, that would be nice. Do you have some sort of
roadmap for the C++ support that we plan to follow?

C is the focus right now. What if I say C++ roadmap begins and ends at "Eventually we want to support C++" ? :slight_smile:

Yes, I got that "state of affairs" from presentations and info on the web site.

Seriously, there is no simple answer. Until most of active developers shift their focus to C++, it is unlikely that C++ roadmap with enough details will emerge. However that should not stop you moving forward.

Where do you want to start,

    - depends on your skill set ... do you consider yourself a C++ language lawyer ? power C++ developer ? programming language tools guy ? software designer ? skilled programmer interested in C++ ? newbie ? etc...

Well I hate to categorize myself, but I am neighther a language lawyer nor a newbie, except from those I would say more or less yes to all..

    - depends on your end goal ... develop C++ compiler,

no.

develop tools to analyze C++ code, tools to manage C++ project etc..

yes and yes,

clang's well designed architecture includes separate preprocessor, lexer, parser, semantic analysis, AST, code generation modules. IMO, this will make your life easier once you decide where to start.

I guess my main interrest is in the C++ code to AST steps.

To get your feet wet, you may want to initially focus on areas where C and C++ language do not agree with each other. For example, Incompatibilities Between ISO C and ISO C++ .

Thanks for that link, seems to contain many things to look for.

Again it is up to you. Where ever you start, you want to follow incremental development model.

certainly.

Mike Stump skrev:

Do you have some sort of roadmap for the C++ support that we plan to follow?

Open source works best if you follow what makes you happy. Find a C++ code you like, and start compiling it. Could be g++.dg from the g++ testsuite, could be llvm,

Well, I don't think neighter I, nor clang is ready for that.. ;-).

could be hello world.

Personally, I started with hello world. :slight_smile:

That is what I will do.

Try a snippet, see if it works, if it does, move on to next bit of code.
If it doesn't, implement the parser for it, then the AST for it, then the semantic actions for it, then the ast printer for it, then the codegen for it... rinse, repeat.

Sounds good, I will give it a go when I get some time and see if it is
any fun ;-). I may stop at the AST printer level if that make any
sence. LLVM is new to me and not my primary goal
-- at least not yet. I may need the codegen part to get usfull
verification of success, we will just have to see as we go.