Re: Small embeddable scripting language ?



On Fri, 2002-11-29 at 11:23, John Palmieri wrote:
> 
> 
> 
> > 3) As an embedded template language for code snippets and file and
> > project wizards. For example, you might want to add a code snippet for a
> > standard C header file:
> > -----------------
> > /*
> > ** File name <%=echo $file_name%>
> > ** Copyright <%=echo $current_year%> <%=echo $author_name%>
> > */
> >
> > #ifndef <%=echo upper(canonical($file_name))%>
> > #define <%=echo upper(canonical(file_name))%>
> > ....
> >
> > #endif /* <%=echo upper(canonical($file_name))%> */
> > -------------------
> 
> I just wanted to give you some thought on this part of your plan.  I am
> working on GObject Factory a GObject code generator that I eventualy
> plan to integrate into Anjuta 2.  I have recently moved to a template
> engine instead of generating everthing in C.  I found that XSLT provided
> by libxslt works well for this type of thing and is easy to setup and
> debug the templates with command line tools.
> 
> The drawbacks with XSLT is that it can get verbose and it doesn't have
> very good tools for doing things like changing strings from uppercase to
> lowercase (at least none that I have found in the documentation).  I got
> around this by doing the case changes in the C code.

That will be problematic - I want the wizard system to be scriptable
without compilation headaches. Besides, plain text with embedded code
bits is much simpler to lean IMO.

> 
> The benefit of XSLT is that it is easy to use, is a defined standard by
> the XML working group and would save you the trouble of coming up with
> another template system.  It literally took me 1/2 hour to learn and it
> is already part of the GNOME libraries.

Seems promising. But can it call code snippets inside ? A full fledged
wizard will need stuff like looping, conditions, powerful text
manipulation functions, etc. inside the template which I felt can only
be achieved with a normal language. For example, an XSLT call a python
code snippet when it encounters a certain tag with the value of the tag
?

> 
> I don't want to give you more languages to learn ;-) but it is just a
> thought.

That's fine - a new language a day keeps boredom away ;-)

Rgds,
Biswa.

> 
> --
> J5
> 
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]