Re: Adding another language to the fray
Bram Moolenaar <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Lars Ivar Igesund wrote:
> Hmm, just a thought (and please flame me for not
> seeing the obvious problems if there are any);
>
> The logical (to me) way to organize languages and
> tools and the usage of them, would be to collect all
> language specific actions/routes/etc to an .aap file
> for the language in question, collect the tools as it is
> done today, and when reading a project's recipe;
> for each language discovered to be used, import
> that language's recipe (which also checks the tools
> associated with that language).
I think this is not different from my ideas. This both makes it easy
for a person to add support for a new language and makes it easy for an
Aap user to locate the items used/supported by a language.
The question is how Aap can see that a language is being used. And this
must work in a predictable way. I discussed this with Adriaan before
and we came to the conclusion that this has the danger of becoming
"magic".
I think it's best to let the Aap user explicitly specify the language
being used. Adding ":import d_lang" to a recipe is straightforward.
An exception can be made for the meta-commands ":program", ":lib", etc.
These check the filetype of the sources and can import a module for the
detected languages. The only condition is that the name of the imported
module consistently uses the filetype. Thus if the filetype is "foo"
then the module to be imported should be "foo_lang" (or something like
that; "lang" isn't a generic choice, perhaps "foo_module" is better).
> I don't really see the reason for importing a
> language's actions before they are needed, not
> even for C/C++. And with many languages supported,
> this would be the only good way to do it (IMHO).
I think the only reason to have C/C++ support out-of-the-box is that so
many people are using it. Another reason is that "make" does support
these languages.
--
ARTHUR: Well, I AM king...
DENNIS: Oh king, eh, very nice. An' how'd you get that, eh? By exploitin'
the workers -- by 'angin' on to outdated imperialist dogma which
perpetuates the economic an' social differences in our society! If
there's ever going to be any progress--
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf