[Synopsis-devel] Re: software design clarification

Stefan Seefeld seefeld at sympatico.ca
Tue May 8 16:23:41 UTC 2007


Nathaniel Smith wrote:
> On Fri, May 04, 2007 at 07:39:56AM -0400, Stefan Seefeld wrote:
>> Yes, Elsa is definitely on my radar. I have been looking at the code, as
>> well as the docs, for a while, and even had some discussion with its main
>> author.
>>
>> What holds me back from hooking that up as a C++ parser is principaly
>> two reasons:
>>
>> * It doesn't have all the features Synopsis supports, and thus, even though
>>   it is more complete, it would cut on the functionality we can provide.
> 
> Hmm, what is it missing, out of curiosity?  I know it has full
> tracking of the relation between source and AST, and my impression
> is the type system is complete-ish... I guess it probably doesn't
> parse comments but that's hardly a showstopper...

Right, if it was only the comments...
It was my impression that Elsa wouldn't store pointers into the source buffer,
thus making it impossible to transform the source code (as opposed to regenerate
it). In other words, can elsa provide lossless source-to-source transformation ?

>> * The code is quite messy. While I could treat it as a black box (as long
>>   as it works, at least), I believe part of the appeal to work on Synopsis
>>   is to make all the logic of a C++ compiler frontend as transparent as possible,
>>   i.e. it is also a very educative experience (for me at least, but hopefully
>>   also to others who look at the code).
> 
> Right.  From the pace of development I see (though perhaps I am just
> missing what's really happening), it seems like in practice this means
> you are forced to choose between creating a clean and beautiful C++
> front-end to reward contemplation, and creating a tool that helps
> people achieve cool stuff.  I actually like contemplation, so I can
> respect your decision :-).  But one of the things I've learned in the
> past few years (partly from Fresco, as it happens...) is Strategy
> Matters. IME the way to optimize for long-term fast, sustainable, and
> enjoyable growth is, paradoxically, to aggressively optimize in the
> short term for dirty-yet-practical results (which bring in other
> developers, and which mean you get experience with an end-to-end
> working framework so you can actually refactor properly, and which
> mean hacking is more fun and motivating because you get to play with
> cool end-products and working code and interesting patch submissions,
> etc. etc.).  I only bring this up, of course, because I think Synopsis
> is very cool and greedily want to see it succeed wildly, so I can play
> with it too.

Thanks for the kind words. You make good points. And yes, I do value
'contemplation', as you know. :-)
But that doesn't have to stop us from providing alternative paths
that are more 'goal-oriented', or, where 'goal' is defined more in
terms of applicability. I'll think more about it, and have a(nother)
close look into the Elsa code.

> But good luck to you whatever you do :-).
> 
>> Yet another alternative that hasn't come up yet is to try to enhance GCC
>> itself, i.e. add all the hooks there to make it useable in a context like
>> Synopsis (that's the path choosen by the gccxml folks). While there are
>> a couple of people who try to convince me that this is a better way to spend
>> my spare time, I think the reasoning is principally the same as for Elsa
>> (see above).
> 
> That sounds even messier to me, and much harder to keep in sync with.
> (Though the way Synopsis works, wouldn't it be very simple to have a
> front-end that eats gccxml and produces the same Synopsis AST as a
> real front-end would?  If such a processor could be implemented
> quickly, that'd be very handy for bootstrapping the rest of Synopsis's
> Cool Stuff and you could just drop in whatever front-end you end up
> using, when it's ready?)

Right. Well, it was essentially people like Mark who suggested to work
on GCC, to provide additional hooks to bind it to Synopsis, not necessarily
to rewrite the Synopsis bits as part of GCC. (I guess there may even be some
commercial interests into adding introspection capabilities to GCC...)

Regards,
		Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...


More information about the Synopsis-devel mailing list