Hello! I am discovering gcc and his plugin system. I have tried MELT. I would like to say that the lispy syntax is not so difficult. It mights look unattractive to have such number of parenthesis but we quikly get used to the structure.
The harder for me is to have a good view of the GCC internals and that's not mainly a question of MELT or not (We could even say that the abstraction of MELT can be an help). In reality I think the most important feature of MELT is the patterm matching system. I have mainly use it at gimple level and that's easy to recover an element wich has a property or another. For exemple, it is pretty easy to get a gimple_cond which compare a pointer to null or such things. Looks interesting for making test on the code, having new warnings... On the contrary that is not ready for modifying directly the representation. I can understand that peoples who are used to C plugins don't want to learn MELT, but I think it might be a good way for newcomers and curious. Best regards Pierre Vittet > On Sun, 23 Jan 2011 15:49:48 +0100 > Daniel Marjamäki <daniel.marjam...@gmail.com> wrote: > >> GCC-MELT is an interesting project. But it seems to be very difficult >> to write lisp scripts. You don't have a C interface also, do you? > > The few people who tried writing MELT code are founding on the contrary > that coding in MELT is easier than coding in C (even if I agree that > MELT is not very well documented). > > The major MELT idea is on the contrary that coding in MELT, using the > powerful features provided by the MELT language (pattern matching, > functional/applicative & object programming styles), is much easier > than coding in C. And MELT philosophy is indeed that it is a > higher-level language than C (you don't have any pattern matching in C > for instance). > > So I disagree with the idea that writing MELT code is difficult (and > harder than writing in C). But it is also matter of taste. > >> I would like to see how I can use plain C. > > In that case, MELT is not really for you. The selling point of MELT is > precisely to avoid the low level details of C and to give something > higher-level to you. If you really want to code in C, don't use MELT. > > There is no interface from C to MELT, and there cannot be one... The > purpose of MELT is to avoid coding plugins in C! > > >>> I want to write a plugin that parse the AST. Could I get some hint >>> about how to do it? > > The major issue is to understand all the details of GCC internal > representations (i.e. Trees, Gimples). Did you understand them? > > Regards > > > -- > Basile STARYNKEVITCH http://starynkevitch.net/Basile/ > email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 > 8, rue de la Faiencerie, 92340 Bourg La Reine, France > *** opinions {are only mine, sont seulement les miennes} ***