On Wed, Apr 22, 2015 at 8:23 AM, Nick Wellnhofer <[email protected]> wrote:
> Well, a compiler for the Clownfish package has to support almost all > Clownfish features. I don't think it would be very small, but look very much > like CFC in it's current form. It would only need one back end, and it might be able to share the lexer and parser. But you're right that it would still be substantial. Let's leave this idea aside. >> The rationale for CFCSymbol as a superclass was that classes, inert >> variables, inert functions, and methods (or at least their implementing >> functions) all live in one global namespace as unique symbols. > > Do they? The way I see it, only classes live in a global namespace, and > variables and callables (functions and methods) live in a class's namespace. OK, sure -- I can see things that way. It's more Clownfish-centric than C-centric. These days, I might argue that parcels live in the global namespace, classes live inside parcels, and callables live inside classes. > I don't think that symbol tables would buy us much except for detecting name > clashes between variables and callables. I would like it if CFC stuck more closely to classic compiler design paradigms, and that includes using symbol table scoping instead of jamming such functionality into various type innards. It would also include implementing semantic analysis as parse-tree walking, which we don't really do at all. But all of these wishes are implementation details. > Anyway, there are some commits in my cfc_symbol branch that I definitely > want to merge: > > - micro_sym/macro_sym cleanup > - CFCCallable base class > - CFCMethod_is_fresh helper +1 to merge the whole branch. I skimmed each patch -- these are big diffs, but I trust your attention to detail and I like the ideas behind the changes. Thanks for the big contribution! Marvin Humphrey
