Re: [FM3] Should localized template lookup be off by default?

2017-06-14 Thread Daniel Dekany
Tuesday, June 13, 2017, 2:49:17 PM, brede...@me.com wrote:

> ‎-1
>
> I think that is one place where feature by default is better than performance 
> by default. 

OK, but why?

The reason I prefer opt-in approach (as opposed to opt-out) here is
that you won't use this feature unless you are aware of its existence.
But if you are aware of its existence, and you want to use it too,
then certainly you will see that you have to turn it on. For the
others, who are the vast majority of users, why waste resources
(especially I/O) on something they will not use? For low level
libraries things like that mater, because you can't anticipate the use
cases. In some applications they may need to keep the
templateUpdateDelay low, and have many templates, so cache misses are
frequent.

> Are the missing files cached?

Yes, the fact that a file is missing is cached, for
cfg.templateUpdateDelay duration.

> Cheers,
>
> -- Denis.
>   Original Message  
> From: Daniel Dekany
> Sent: Tuesday, 13 June 2017 13:19
> To: dev@freemarker.incubator.apache.org
> Reply To: dev@freemarker.incubator.apache.org
> Subject: [FM3] Should localized template lookup be off by deault?
>
> In FM2 the localizedLookup configuration setting defaults to true, so
> by default if you issue cfg.getTemplate("foo.ftl") and cfg.locale is
> en_US, then FM will look for foo_en_US.ftl, then foo_en.ftl, then
> foo.ftl. I think most users don't use localized lookup, and they don't
> realize that this is happening, while this means extra I/O.
>
> I propose that in FM3 we change the default of this setting to false.
>

-- 
Thanks,
 Daniel Dekany



[FM3] Template file extension

2017-06-14 Thread Daniel Dekany
For FM3, because the template language changes, we need to change the
standard (recommended) template file extension. I propose this:

- ftl to fm3
- ftlx to fm3x
- ftlh to fm3h

Why not ftl3? Mostly because I think that "FTL" is kind of cryptic for
the casual user (which is almost all the users for a template
language), and so it was a mistake to introduce that term. Also in
almost all languages, the file extensions is the same or the
abbreviation of the project name. The user already knows that this
thing is called FreeMarker, hence, "fm" is the most speaking
extension. Also, we will have to clearly differentiate FreeMarker 2
from FreeMarker 3, to avoid confusion (which Manual to look into),
hence the "3". (BTW, back in the FM1 times the extensions was usually
"fm"... it should have been "fm2" after that.)

-- 
Thanks,
 Daniel Dekany



Re: [FM3] Should localized template lookup be off by default?

2017-06-14 Thread Siegfried Goeschl
Hi folks,

sorry to skip in as FM rookie :-)

IMHO both approaches (opt-in & opt-out) are valid but I personally lean towards 
opt-out

* The newbie (and casual user) is delighted if a useful feature works out of 
the box
* Changing the existing behaviour is an annoying (and potentially breaking) 
change for existing users
* Assuming that the caching works the IO is minimal even for cache misses
* Assuming that the little IO becomes relevant those user will be heavy users 
anyway

Thanks in advance,

Siegfried Goeschl


> On 14 Jun 2017, at 11:12, Daniel Dekany  wrote:
> 
> Tuesday, June 13, 2017, 2:49:17 PM, brede...@me.com wrote:
> 
>> ‎-1
>> 
>> I think that is one place where feature by default is better than 
>> performance by default. 
> 
> OK, but why?
> 
> The reason I prefer opt-in approach (as opposed to opt-out) here is
> that you won't use this feature unless you are aware of its existence.
> But if you are aware of its existence, and you want to use it too,
> then certainly you will see that you have to turn it on. For the
> others, who are the vast majority of users, why waste resources
> (especially I/O) on something they will not use? For low level
> libraries things like that mater, because you can't anticipate the use
> cases. In some applications they may need to keep the
> templateUpdateDelay low, and have many templates, so cache misses are
> frequent.
> 
>> Are the missing files cached?
> 
> Yes, the fact that a file is missing is cached, for
> cfg.templateUpdateDelay duration.
> 
>> Cheers,
>> 
>> -- Denis.
>>   Original Message  
>> From: Daniel Dekany
>> Sent: Tuesday, 13 June 2017 13:19
>> To: dev@freemarker.incubator.apache.org
>> Reply To: dev@freemarker.incubator.apache.org
>> Subject: [FM3] Should localized template lookup be off by deault?
>> 
>> In FM2 the localizedLookup configuration setting defaults to true, so
>> by default if you issue cfg.getTemplate("foo.ftl") and cfg.locale is
>> en_US, then FM will look for foo_en_US.ftl, then foo_en.ftl, then
>> foo.ftl. I think most users don't use localized lookup, and they don't
>> realize that this is happening, while this means extra I/O.
>> 
>> I propose that in FM3 we change the default of this setting to false.
>> 
> 
> -- 
> Thanks,
> Daniel Dekany
> 



Re: [FM3] Renaming some ore settings...

2017-06-14 Thread Woonsan Ko
On Sat, Jun 3, 2017 at 6:29 PM, Daniel Dekany  wrote:
> These:
> - cacheStoreage to templateCacheStorage
> - localizedLookup to localizedTemplateLookup
>
> Reason: As these are Configuration settings, it's not obvious what are
> we caching (tempaltes) and what are we looking up in a localized way
> (templates). Also we already have templateLoader and
> templateUpdateDelay and tempalteLookupStrategy, so this two should
> follow the same pattern.

Cool! Better naming!

Cheers,

Woonsan

>
> --
> Thanks,
>  Daniel Dekany
>


Re: [FM3] Should localized template lookup be off by default?

2017-06-14 Thread Woonsan Ko
I don't think the template lookup feature based on locale is used
often in practices, either.
In FM3, I think people need to follow a guideline on how to migrate
FM2 anyway, so it seems just fine to me if we turn it off by default
as the feature requires additional IOs.

Regards,

Woonsan


On Wed, Jun 14, 2017 at 5:55 AM, Siegfried Goeschl
 wrote:
> Hi folks,
>
> sorry to skip in as FM rookie :-)
>
> IMHO both approaches (opt-in & opt-out) are valid but I personally lean 
> towards opt-out
>
> * The newbie (and casual user) is delighted if a useful feature works out of 
> the box
> * Changing the existing behaviour is an annoying (and potentially breaking) 
> change for existing users
> * Assuming that the caching works the IO is minimal even for cache misses
> * Assuming that the little IO becomes relevant those user will be heavy users 
> anyway
>
> Thanks in advance,
>
> Siegfried Goeschl
>
>
>> On 14 Jun 2017, at 11:12, Daniel Dekany  wrote:
>>
>> Tuesday, June 13, 2017, 2:49:17 PM, brede...@me.com wrote:
>>
>>> ‎-1
>>>
>>> I think that is one place where feature by default is better than 
>>> performance by default.
>>
>> OK, but why?
>>
>> The reason I prefer opt-in approach (as opposed to opt-out) here is
>> that you won't use this feature unless you are aware of its existence.
>> But if you are aware of its existence, and you want to use it too,
>> then certainly you will see that you have to turn it on. For the
>> others, who are the vast majority of users, why waste resources
>> (especially I/O) on something they will not use? For low level
>> libraries things like that mater, because you can't anticipate the use
>> cases. In some applications they may need to keep the
>> templateUpdateDelay low, and have many templates, so cache misses are
>> frequent.
>>
>>> Are the missing files cached?
>>
>> Yes, the fact that a file is missing is cached, for
>> cfg.templateUpdateDelay duration.
>>
>>> Cheers,
>>>
>>> -- Denis.
>>>   Original Message
>>> From: Daniel Dekany
>>> Sent: Tuesday, 13 June 2017 13:19
>>> To: dev@freemarker.incubator.apache.org
>>> Reply To: dev@freemarker.incubator.apache.org
>>> Subject: [FM3] Should localized template lookup be off by deault?
>>>
>>> In FM2 the localizedLookup configuration setting defaults to true, so
>>> by default if you issue cfg.getTemplate("foo.ftl") and cfg.locale is
>>> en_US, then FM will look for foo_en_US.ftl, then foo_en.ftl, then
>>> foo.ftl. I think most users don't use localized lookup, and they don't
>>> realize that this is happening, while this means extra I/O.
>>>
>>> I propose that in FM3 we change the default of this setting to false.
>>>
>>
>> --
>> Thanks,
>> Daniel Dekany
>>
>


Re: [FM3] Template file extension

2017-06-14 Thread Woonsan Ko
On Wed, Jun 14, 2017 at 5:25 AM, Daniel Dekany  wrote:
> For FM3, because the template language changes, we need to change the
> standard (recommended) template file extension. I propose this:
>
> - ftl to fm3
> - ftlx to fm3x
> - ftlh to fm3h

I'm fine with that. When I look up the file extension, ftl, I get a
correct information. e.g, http://www.file-extension.info/format/ftl
But, there seems to be something else associated with fm3 already.
Wouldn't be a big problem, I guess.

Regards,

Woonsan

>
> Why not ftl3? Mostly because I think that "FTL" is kind of cryptic for
> the casual user (which is almost all the users for a template
> language), and so it was a mistake to introduce that term. Also in
> almost all languages, the file extensions is the same or the
> abbreviation of the project name. The user already knows that this
> thing is called FreeMarker, hence, "fm" is the most speaking
> extension. Also, we will have to clearly differentiate FreeMarker 2
> from FreeMarker 3, to avoid confusion (which Manual to look into),
> hence the "3". (BTW, back in the FM1 times the extensions was usually
> "fm"... it should have been "fm2" after that.)
>
> --
> Thanks,
>  Daniel Dekany
>


Re: [FM3] Should localized template lookup be off by default?

2017-06-14 Thread Christoph Rüger
+1 for turning it off by default. Just make sure it is clearly described in
the localization section of the manual. I know it always depends but
outofthebox-performance is more important here in my opinion.

Am 14.06.2017 4:20 nachm. schrieb "Woonsan Ko" :

> I don't think the template lookup feature based on locale is used
> often in practices, either.
> In FM3, I think people need to follow a guideline on how to migrate
> FM2 anyway, so it seems just fine to me if we turn it off by default
> as the feature requires additional IOs.
>
> Regards,
>
> Woonsan
>
>
> On Wed, Jun 14, 2017 at 5:55 AM, Siegfried Goeschl
>  wrote:
> > Hi folks,
> >
> > sorry to skip in as FM rookie :-)
> >
> > IMHO both approaches (opt-in & opt-out) are valid but I personally lean
> towards opt-out
> >
> > * The newbie (and casual user) is delighted if a useful feature works
> out of the box
> > * Changing the existing behaviour is an annoying (and potentially
> breaking) change for existing users
> > * Assuming that the caching works the IO is minimal even for cache misses
> > * Assuming that the little IO becomes relevant those user will be heavy
> users anyway
> >
> > Thanks in advance,
> >
> > Siegfried Goeschl
> >
> >
> >> On 14 Jun 2017, at 11:12, Daniel Dekany  wrote:
> >>
> >> Tuesday, June 13, 2017, 2:49:17 PM, brede...@me.com wrote:
> >>
> >>> ‎-1
> >>>
> >>> I think that is one place where feature by default is better than
> performance by default.
> >>
> >> OK, but why?
> >>
> >> The reason I prefer opt-in approach (as opposed to opt-out) here is
> >> that you won't use this feature unless you are aware of its existence.
> >> But if you are aware of its existence, and you want to use it too,
> >> then certainly you will see that you have to turn it on. For the
> >> others, who are the vast majority of users, why waste resources
> >> (especially I/O) on something they will not use? For low level
> >> libraries things like that mater, because you can't anticipate the use
> >> cases. In some applications they may need to keep the
> >> templateUpdateDelay low, and have many templates, so cache misses are
> >> frequent.
> >>
> >>> Are the missing files cached?
> >>
> >> Yes, the fact that a file is missing is cached, for
> >> cfg.templateUpdateDelay duration.
> >>
> >>> Cheers,
> >>>
> >>> -- Denis.
> >>>   Original Message
> >>> From: Daniel Dekany
> >>> Sent: Tuesday, 13 June 2017 13:19
> >>> To: dev@freemarker.incubator.apache.org
> >>> Reply To: dev@freemarker.incubator.apache.org
> >>> Subject: [FM3] Should localized template lookup be off by deault?
> >>>
> >>> In FM2 the localizedLookup configuration setting defaults to true, so
> >>> by default if you issue cfg.getTemplate("foo.ftl") and cfg.locale is
> >>> en_US, then FM will look for foo_en_US.ftl, then foo_en.ftl, then
> >>> foo.ftl. I think most users don't use localized lookup, and they don't
> >>> realize that this is happening, while this means extra I/O.
> >>>
> >>> I propose that in FM3 we change the default of this setting to false.
> >>>
> >>
> >> --
> >> Thanks,
> >> Daniel Dekany
> >>
> >
>

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: [FM3] Should localized template lookup be off by default?

2017-06-14 Thread Daniel Dekany
Wednesday, June 14, 2017, 11:55:10 AM, Siegfried Goeschl wrote:

> Hi folks,
>
> sorry to skip in as FM rookie :-)
>
> IMHO both approaches (opt-in & opt-out) are valid but I personally lean 
> towards opt-out
>
> * The newbie (and casual user) is delighted if a useful feature works out of 
> the box
> * Changing the existing behaviour is an annoying (and potentially
> breaking) change for existing users

Note that FM3 is practically another template engine (see rationale on
https://cwiki.apache.org/confluence/display/FREEMARKER/FreeMarker+3),
so assuming someone doesn't approach it with that mind set, the
annoyance factor is maximized anyway. I'm seriously considering
renaming FM3 to FreeMarker NG 1.0.0 or such, just to avoid that.

> * Assuming that the caching works the IO is minimal even for cache misses
> * Assuming that the little IO becomes relevant those user will be heavy users 
> anyway
>
> Thanks in advance,
>
> Siegfried Goeschl
>
>
>> On 14 Jun 2017, at 11:12, Daniel Dekany  wrote:
>> 
>> Tuesday, June 13, 2017, 2:49:17 PM, brede...@me.com wrote:
>> 
>>> ‎-1
>>> 
>>> I think that is one place where feature by default is better than 
>>> performance by default. 
>> 
>> OK, but why?
>> 
>> The reason I prefer opt-in approach (as opposed to opt-out) here is
>> that you won't use this feature unless you are aware of its existence.
>> But if you are aware of its existence, and you want to use it too,
>> then certainly you will see that you have to turn it on. For the
>> others, who are the vast majority of users, why waste resources
>> (especially I/O) on something they will not use? For low level
>> libraries things like that mater, because you can't anticipate the use
>> cases. In some applications they may need to keep the
>> templateUpdateDelay low, and have many templates, so cache misses are
>> frequent.
>> 
>>> Are the missing files cached?
>> 
>> Yes, the fact that a file is missing is cached, for
>> cfg.templateUpdateDelay duration.
>> 
>>> Cheers,
>>> 
>>> -- Denis.
>>>   Original Message  
>>> From: Daniel Dekany
>>> Sent: Tuesday, 13 June 2017 13:19
>>> To: dev@freemarker.incubator.apache.org
>>> Reply To: dev@freemarker.incubator.apache.org
>>> Subject: [FM3] Should localized template lookup be off by deault?
>>> 
>>> In FM2 the localizedLookup configuration setting defaults to true, so
>>> by default if you issue cfg.getTemplate("foo.ftl") and cfg.locale is
>>> en_US, then FM will look for foo_en_US.ftl, then foo_en.ftl, then
>>> foo.ftl. I think most users don't use localized lookup, and they don't
>>> realize that this is happening, while this means extra I/O.
>>> 
>>> I propose that in FM3 we change the default of this setting to false.
>>> 
>> 
>> -- 
>> Thanks,
>> Daniel Dekany
>> 
>
>

-- 
Thanks,
 Daniel Dekany



Re: [FM3] Template file extension

2017-06-14 Thread Daniel Dekany
Wednesday, June 14, 2017, 4:32:41 PM, Woonsan Ko wrote:

> On Wed, Jun 14, 2017 at 5:25 AM, Daniel Dekany  wrote:
>> For FM3, because the template language changes, we need to change the
>> standard (recommended) template file extension. I propose this:
>>
>> - ftl to fm3
>> - ftlx to fm3x
>> - ftlh to fm3h

BTW, we also have this thing (agreed upon earlier), that for the sake
of easier tooling like IDE plugins, we will remove syntax auto
detection, and instead rely on extension. (I'm yet to see any tool
that can deal with FM2 syntax detection, unless it has used FreeMarker
itself to parse the template... so we can conclude that it didn't work
out very well in practice.) So we will need one more variation on all
of all these for square bracket syntax. Maybe fm3s, fm3sx, fm3sh (ugh,
my eyes...).

> I'm fine with that. When I look up the file extension, ftl, I get a
> correct information. e.g, http://www.file-extension.info/format/ftl
> But, there seems to be something else associated with fm3 already.
> Wouldn't be a big problem, I guess.

For 3 letter file extensions that happens quite easily... and
fortunately Lotus 3 is not very main stream nowadays. (It's quite
surprising that the ftl didn't collide with anything.)

> Regards,
>
> Woonsan
>
>>
>> Why not ftl3? Mostly because I think that "FTL" is kind of cryptic for
>> the casual user (which is almost all the users for a template
>> language), and so it was a mistake to introduce that term. Also in
>> almost all languages, the file extensions is the same or the
>> abbreviation of the project name. The user already knows that this
>> thing is called FreeMarker, hence, "fm" is the most speaking
>> extension. Also, we will have to clearly differentiate FreeMarker 2
>> from FreeMarker 3, to avoid confusion (which Manual to look into),
>> hence the "3". (BTW, back in the FM1 times the extensions was usually
>> "fm"... it should have been "fm2" after that.)
>>
>> --
>> Thanks,
>>  Daniel Dekany
>>
>

-- 
Thanks,
 Daniel Dekany



Re: [FM3] Should localized template lookup be off by default?

2017-06-14 Thread Denis Bredelet
Hi Daniel,

>> * Assuming that the caching works the IO is minimal even for cache misses
>> * Assuming that the little IO becomes relevant those user will be heavy 
>> users anyway
>> 
>> Thanks in advance,
>> 
>> Siegfried Goeschl
>> 
>> 
>>> On 14 Jun 2017, at 11:12, Daniel Dekany  wrote:
>>> 
>>> Tuesday, June 13, 2017, 2:49:17 PM, brede...@me.com wrote:
>>> 
 ‎-1
 
 I think that is one place where feature by default is better than 
 performance by default. 
>>> 
>>> OK, but why?

With caching the performance impact is minimal so I don’t see why it is a 
concern.

For specialised applications the opt-out setting is there and should be used.

>>> The reason I prefer opt-in approach (as opposed to opt-out) here is
>>> that you won't use this feature unless you are aware of its existence.
>>> But if you are aware of its existence, and you want to use it too,
>>> then certainly you will see that you have to turn it on.

That is assuming that users will read the manual ;-)

We don’t want people to turn away from FreeMarker because they assume the 
feature is missing or not working when they try (foo_en.ftl is almost a 
standard for localisation).

That is only my opinion.

Cheers,
— Denis.

>>> For the
>>> others, who are the vast majority of users, why waste resources
>>> (especially I/O) on something they will not use? For low level
>>> libraries things like that mater, because you can't anticipate the use
>>> cases. In some applications they may need to keep the
>>> templateUpdateDelay low, and have many templates, so cache misses are
>>> frequent.
>>> 
 Are the missing files cached?
>>> 
>>> Yes, the fact that a file is missing is cached, for
>>> cfg.templateUpdateDelay duration.
>>> 
 Cheers,
 
 -- Denis.
  Original Message  
 From: Daniel Dekany
 Sent: Tuesday, 13 June 2017 13:19
 To: dev@freemarker.incubator.apache.org
 Reply To: dev@freemarker.incubator.apache.org
 Subject: [FM3] Should localized template lookup be off by deault?
 
 In FM2 the localizedLookup configuration setting defaults to true, so
 by default if you issue cfg.getTemplate("foo.ftl") and cfg.locale is
 en_US, then FM will look for foo_en_US.ftl, then foo_en.ftl, then
 foo.ftl. I think most users don't use localized lookup, and they don't
 realize that this is happening, while this means extra I/O.
 
 I propose that in FM3 we change the default of this setting to false.
 
>>> 
>>> -- 
>>> Thanks,
>>> Daniel Dekany
>>> 
>> 
>> 
> 
> -- 
> Thanks,
> Daniel Dekany



Re: [FM3] Template file extension

2017-06-14 Thread Denis Bredelet
Hi Daniel,

> On 14 Jun 2017, at 23:14, Daniel Dekany  wrote:
> 
> Wednesday, June 14, 2017, 4:32:41 PM, Woonsan Ko wrote:
> 
>> On Wed, Jun 14, 2017 at 5:25 AM, Daniel Dekany > > wrote:
>>> For FM3, because the template language changes, we need to change the
>>> standard (recommended) template file extension. I propose this:
>>> 
>>> - ftl to fm3
>>> - ftlx to fm3x
>>> - ftlh to fm3h

I am fine with it but isn’t « fm » used mostly for FrameMaker?

We could just use « f3 ».

> BTW, we also have this thing (agreed upon earlier), that for the sake
> of easier tooling like IDE plugins, we will remove syntax auto
> detection, and instead rely on extension. (I'm yet to see any tool
> that can deal with FM2 syntax detection, unless it has used FreeMarker
> itself to parse the template... so we can conclude that it didn't work
> out very well in practice.) So we will need one more variation on all
> of all these for square bracket syntax. Maybe fm3s, fm3sx, fm3sh (ugh,
> my eyes…).

You can put is as prefix sfm3, sfm3x, sfm3h (or sf3, sf3x, sf3h - Street 
Fighter here we come!).

Cheers,
— Denis.

>> I'm fine with that. When I look up the file extension, ftl, I get a
>> correct information. e.g, http://www.file-extension.info/format/ftl 
>> 
>> But, there seems to be something else associated with fm3 already.
>> Wouldn't be a big problem, I guess.
> 
> For 3 letter file extensions that happens quite easily... and
> fortunately Lotus 3 is not very main stream nowadays. (It's quite
> surprising that the ftl didn't collide with anything.)
> 
>> Regards,
>> 
>> Woonsan
>> 
>>> 
>>> Why not ftl3? Mostly because I think that "FTL" is kind of cryptic for
>>> the casual user (which is almost all the users for a template
>>> language), and so it was a mistake to introduce that term. Also in
>>> almost all languages, the file extensions is the same or the
>>> abbreviation of the project name. The user already knows that this
>>> thing is called FreeMarker, hence, "fm" is the most speaking
>>> extension. Also, we will have to clearly differentiate FreeMarker 2
>>> from FreeMarker 3, to avoid confusion (which Manual to look into),
>>> hence the "3". (BTW, back in the FM1 times the extensions was usually
>>> "fm"... it should have been "fm2" after that.)
>>> 
>>> --
>>> Thanks,
>>> Daniel Dekany
>>> 
>> 
> 
> -- 
> Thanks,
> Daniel Dekany