Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] RFC: Templates preprocessor syntax proposal

On 2016-08-05, 12:51 PM, "cdt-dev-bounces@xxxxxxxxxxx on behalf of Liviu
Ionescu" <cdt-dev-bounces@xxxxxxxxxxx on behalf of ilg@xxxxxxxxxx> wrote:

>
>> On 05 Aug 2016, at 19:33, Derek Morris <dmsubs@xxxxxxxxxxxxx> wrote:
>> 
>> Freemarker is a TEMPLATE ENGINE, not a generic scripting language.
>> 
>> I have used Freemarker (for creating and implementing templates), and
>>would certainly recommend it. I suggest you take a look.
>
>I did.
>
>assuming the template is used to generate C/C++ files, did you try to
>reformat the template file with the CDT formatter?

Not sure why you would do that. You have no idea whether the text being
substituted would be formatted correctly. My thought is to feed the
generated files through CDT¹s formatter as part of the generation process.
Once I¹m working with more complex templates, I¹ll take look at that.

My point of using Freemarker was to not create yet another template
engine. It¹s widely used and has been around for quite a while. CDT¹s
template engine is unmaintained and really oversolves the problem IMHO so
I wasn¹t planning in moving it forward.

I have also structured the template framework to potentially use other
template engines in it¹s place if something better comes along. Thymeleaf,
for example, looks pretty good.


>
>I am also considering scriptable command line versions of my wizards,
>that will probably be written in Go. how likely is to be able to process
>Freemarker templates in other languages than Java?

That isn¹t a requirement for me so you¹re solution may be different.
Having used command-line template generators, I tend to stay away from
them. They¹re way too error prone without a UI to help guide you. And
they¹re not something you run very often that would require automation
that command-line offers. But that again is just my opinion.

Doug.

>
>---
>
>my proposal which uses JavaScript embedded as comments in a plain C/C++
>file meets the re-formatting requirement and JavaScript engines are now
>available for all major languages.
>
>to me this solutions seems more general, more easy to use, the features
>available in the scripting engine are more powerful (being limited only
>by JavaScript), and everything is more portable.
>
>I currently do not see any disadvantage, but you might, and this is the
>reason I asked for your opinion.
>
>regards,
>
>Liviu
>
>_______________________________________________
>cdt-dev mailing list
>cdt-dev@xxxxxxxxxxx
>To change your delivery options, retrieve your password, or unsubscribe
>from this list, visit
>https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top