Re: Long-Awaited FreeMarker 3 Preview Available

2023-11-12 Thread Jonathan Revusky
On Fri, Nov 10, 2023 at 8:29 PM Benjamin Marwell 
wrote:

> >> It can never be on Maven central, because the namespace (groupid)
> >> "freemarker" is already claimed by Apache Freemarker.
> >>
>
> > Well, Ben... it is kind of disrespectful to talk > such blatant nonsense
> to
> > somebody. This is supposed to be some  serious technical forum, isn't it?
>
> Interesting how you contradict yourself in the next paragraph. You can
> chose another groupid, of course.
>

Well, I can't figure out what you're talking about. If the groupid is a
unique identifier, and org.freemarker is taken, then we have to use a
different one. So what

But really, I'm actually just totally bemused. I have been trying to figure
out what your point is. One would think that you sincerely believe that
people out there should saddle themselves with something that is obsolete
and inferior simply because the people in question control "freemarker.org"
or whatever such reason that is entirely non-technical!

On the one hand, it's hard to believe that you seriously believe this, but
then I started thinking about the history of this whole project. In the
early days, our main competitor was this thing called "Jakarta Velocity",
now called "Apache Velocity", I guess. I mean, it's not a secret that I had
something of a chip on my shoulder about that, because that Velocity thing
was so horrendously inferior that it was just kind of infuriating to be
competing with it. But anyway, now that I think about all that again, it
really does seem that these Velocity people seriously believed that people
should use their inferior dreck because it was on apache.org or something.
It was utterly inferior but it just got increasingly inferior because the
people there did not do any work at all to try to compete with us
technically. Absolutely nothing. Month after month. Year after year.

But that's all ancient history, I guess. But the whole idea that people
should use "Apache FreeMarker" because Apache FreeMarker is in possession
of the freemarker.org domain and thus the org.freemarker groupid I mean
that's just so crazy, of course...

Well, I guess the thing that is especially infuriating about it is that
there really are all these people out there who do seem to reason like
this! For whatever reason, they won't consider using something unless it
comes from what they perceive as an "approved channel". Something like
that... That's a real phenomenon, but there's nothing I can do about that
anyway, so... Well, in this case, I do have to make a best effort to get
people to understand that Apache FreeMarker is just an older, inferior
version of work by the same person. ME!

But when you start talking this stuff about the "Apache FreeMarker" project
having the "org.freemarker" groupid and that is somehow something so
important... well, it's one of these "WTF" moments, as in: WTF is wrong
with this guy?

I mean, it's about such a level of bizarre cynicism. "Oh, they should use
this because it's the real thing to use because we have the freemarker.org
domain and..."

Well, I beg to differ. But look, what do I know? I just wrote the damned
thing basically. LOL.

I mean, this guy Taher asked me why I am not doing this work on FreeMarker
3 inside of apache.org. Well, certainly somebody who didn't know the
history of this whole thing would naturally ask me that. That's
understandable. So I tried to fill him in. But anyway, it's such an
exercise in masochism, dealing with certain personality types. And you,
Ben, are not the worst by any means. This other guy who came out of the
woodwork, Lenny, really seems to have escaped from the pages of a comic
book!

But, okay, fine. I can't do the work I'm doing because I don't own the
freemarker.org domain or the org.freemarker groupid because that's really
important. And regardless, people should use some totally inferior version
of the thing (that it so happens I myself wrote as well!) because...


> But you presented your project as "freemarker", and the current root
> package is "freemarker" in your project. And I think I spotted the groupId
> "freemarker" in your ant build file. With that configuration, my claim is
> technically correct (from the perspective when I wrote it). Sonatype will
> restrict access to the freemarker namespace (groupId) to Apache committers
> now.
>

So, as I said, I'll use a different "groupid". So what? As for calling the
project "freemarker", well, that's what it is! This is a continuation of
the main stream of development. God knows why Daniel Dekany chose to take
the maintenance branch code over here and relabel it as "Apache FreeMarker"
and leave the SVN trunk abandoned. (Well, God knows and Daniel knows as
well, but I get the feeling that neither of them are going to tell us why.)


>
> > For reasons that I can only speculate about, when Daniel Dekany took the
> > FreeMarker code to Apache
>
> Instead, please focus on not blaming Daniel or me or anyone else here.
>

Well, why shouldn'

Re: Long-Awaited FreeMarker 3 Preview Available

2023-11-12 Thread Jonathan Revusky
On Fri, Nov 10, 2023 at 8:02 AM Jacques Le Roux <
jacques.le.r...@les7arts.com> wrote:

> Hi Jonathan,
>

Salut, Jacques.


>
> What about existing projects using the Apache version ?
>

Well, what about them? The basic problem is here not very different from
the decision to upgrade to a newer, not 100% backward compatible version of
whatever, like moving from Python 2.x to Python 3.x.

Now, one thing to be clear about is that in its out-of-the-box
configuration, practical NO existing Apache FreeMarker template will work
with the newer version. That's because, by default, directives like
<#assign..> and <#local...> don't work. But if you put <#ftl legacy_syntax>
up top in your template, then they do work.

But anyway, the thing is that there are different levels of user. If you
have a very basic usage pattern, like you just build up some data model
that is a tree of hashes and maps ending in scalars (strings and numbers)
and you expose that data model to your templates... well, the truth of the
matter would surely be that there is very little difference between
FreeMarker 2 and FreeMarker 3. Now, there are massive differences under the
hood and this is now very largely a rewrite, but what I mean is that a user
with a very simplistic usage pattern, (which actually could well be the
majority of users!) just would likely not notice much difference. Though,
again, they would have to use the legacy_syntax configuration or just about
nothing will work!

Since my announcement, I put up a new page which tries to gather together
all the new features in one spot. That is here:
https://github.com/freemarker/freemarker3/wiki/Summary-of-New-Features


>
> I mean the move from 2.3 version to 2.4. Like:
>
>  1. Would it be an easy move?
>

Well, again, this is a very nuanced question because there are different
kinds of users. As I say, if you have a very basic vanilla usage pattern it
probably is an easy move. In fact, most likely your templates will continue
to work with no changes (or close to none) in the legacy_syntax mode, but
even getting them to work without that is probably not so hard.

But, of course, the flip side to that is that, yes, it would probably be
quite easy to upgrade, but if your usage of the thing is that simple, then
there may not be much benefit either! That's true enough.

Now, on the other hand, if you are what is popularly called a "power user",
really pushing the limits in terms of what the tool can do, then I would
say that almost certainly you should try to move to the newer version.
(Even if it will be harder initially.) That is for a variety of reasons. If
you're a power user, and you are hitting limits in what the tool can do,
and you suggest a new feature, well, let's face it. The likelihood of that
new feature being implemented in "Apache FreeMarker" is extremely low. The
version that is now being actively developed is FreeMarker 3, and if
somebody has an idea that seems well motivated it is very likely that I'll
implement it. But the other aspect is that the codebase is so much cleaner
that it is easy now. I don't know what your level of familiarity with the
code is, but you would likely know that the grammar/parser part was written
using this rather old tool called JavaCC. FreeMarker 3 is written using
CongoCC, which is a vastly more advanced version of JavaCC. CongoCC started
as a fork of JavaCC but is now a total rewrite. But, to give you an example
of what I'm talking about, that page I linked mentions various new
features. Let's take the ternary operator as an example. Here is where it
is implemented:
https://github.com/freemarker/freemarker3/blob/master/src/parser/Expressions.inc.ccc#L95
or here, for example, is where the #assert and #exec directives are
implemented:
https://github.com/freemarker/freemarker3/blob/master/src/parser/Directives.inc.ccc#L417-L459

So, the point is that, what with using a much more powerful parser
generator tool, and the codebase being so cleaned up, it is extremely easy
to implement new features, certainly compared to trying to do it against
the 2.3 codebase. So, in particular, for anybody who really aspires to
develop more of a relationship with the code, the FreeMarker 3 codebase is
really where it's at. That's clear enough. Again, I don't know what your
understanding level of the code is, but there were things that were really
a bear to deal with in the legacy codebase, like all this
wrapping/unwrapping of variables. That's all gone. It also means that a lot
of things do actually just work more simply because you're just working
with Java objects, not all this wrapped TemplateXXXModel nonsense. So, when
write:

   #var myList = [1, 2, 3]

the object constructed is not some weird wrapper object. It's just a plain
old java.util.List (an ArrayList to be precise) you can just write:

#exec myList::add(1, "foo") #-- Look, ma! No brackets!

And then your list contains [1, "foo", 2, 3]

(Not that I'm even saying that the above is necessaril

Re: Long-Awaited FreeMarker 3 Preview Available

2023-11-12 Thread Daniel Dekany
To clarify, he calls it simply "FreeMarker" (no "Apache" in it), and it's
from a branch that was made (and then was abandoned for, I guess, 12 years,
or so) long before donation to Apache. But, with the donation to ASF,
"FreeMarker" is the trademark of the ASF.

On Sun, Nov 12, 2023 at 6:45 AM  wrote:

> Hi, Jonathan,
>
> First of all, I am disappointed to see all the personal attacks from you
> here. There is no cause of need for this.
> Let’s keep civilized.
>
> The major issue here I believe is that (at least in my perception) you are
> trying to take the project out of Apache,
> but not following the rules for doing so (are there rules?).
>
> You can’t have your cake and eat it too. IMHO you can’t call it Apache
> Freemarker and not follow Apache rules.
>
> Of course, you can make a fork and innovate from there, but I don’t think
> you can call that Apache FreeMarker.
>
> In other words:
> - You can contribute to the project Apache way
> - Don’t call your fork Apache Freemarker
>
> You can’t have both.
>
> > On Nov 9, 2023, at 7:50 PM, Jonathan Revusky  wrote:
> >
> > On Thu, Nov 9, 2023 at 9:00 PM Benjamin Marwell 
> wrote:
> >
> >> I never knew there was an "original" freemarker project.
> >>
> >
> > So you actually thought that FreeMarker was developed at Apache?
> >
> > Well, no. FreeMarker is a very very old project at this point.
> FreeMarker 1
> > was originally written by a guy named Benjamin Geer, in the late 90's.
> > Though Ben Geer was, strictly speaking, the original author, I don't
> think
> > he was really involved in the project for very long. He wasn't involved
> > when I showed up in the community in late 2001 anyway. At that point, I
> > basically took over, and within a few months, the thing was a complete
> > rewrite. And that was when FreeMarker 2.0 came into being. From 2002 to
> > 2004/2005 we went through 4 release cycles, 2.0, 2.1, 2.2, and 2.3. Each
> > release cycle added quite a bit more functionality. It is kinda sad that
> > there is just about no meaningful difference between 2023 "Apache
> > FreeMarker" and FreeMarker 2.3 from 2005 (or even late 2004).
> >
> > But the thing to understand is that this Apache FreeMarker code, the
> > continuation of the FreeMarker 2.3 codebase, is really something very
> > ancient. Most of the work on this was done in the period from 2002 to
> 2005
> > or so, about a decade before there was any "Apache FreeMarker".
> Basically,
> > the project was very old and stagnant at that point and came to Apache to
> > die, I guess. So I've decided to resuscitate it. Or give it my best
> shot...
> >
> >
> >> Your web site is down, the documentation on the GitHub project is
> sparse.
> >>
> >
> > That is true at the moment but is all quite remediable -- especially if
> > some people want to get involved and do some heavy lifting. (I get the
> > feeling that's not you!) In any case, I said quite clearly that this is a
> > preview. You can't expect something that is a preview to be as polished
> as
> > something as old as FreeMarker 2.3, which has been pretty stable since
> 2004
> > or thereabouts!
> >
> >
> >> There is no way to tell whether it really is more advanced or not.
> >>
> >
> > Well,  frankly, this is just nonsense. There is no legitimate controversy
> > over whether this version of FreeMarker is more advanced or not. Of
> course
> > it is. As I explained in the previous note in response to Taher
> Alkhateeb,
> > it is built on top of the 2.4 codebase, while Apache FreeMarker is a
> > continuation of the 2.3 codebase. Aside from that, just scan over the
> > commit record: https://github.com/freemarker/freemarker3/commits/master
> > Truth told, over the last few months, I have effected something close to
> a
> > complete rewrite.
> >
> > But this is just ridiculous! Tell me, do you think there is some
> legitimate
> > controversy over whether JDK 8 is more advanced than JDK 7? That's just
> > silly. In any case, both FreeMarker 2.3 and this FreeMarker 3.0 preview
> > that I just announced are largely my work. Is it possible that an earlier
> > version of work by the same author is more advanced than the later
> version?
> > Does that make any sense? Of course this version is more advanced!
> >
> > It can never be on Maven central, because the namespace (groupid)
> >> "freemarker" is already claimed by Apache Freemarker.
> >>
> >
> > Well, Ben... it is kind of disrespectful to talk such blatant nonsense to
> > somebody. This is supposed to be some serious technical forum, isn't it?
> >
> > The "groupid" used on Maven Central is not something with any real
> > transcendence at all. It certainly has no technical meaning. I mean,
> look,
> > here is an example. The main OSS project I'm working on, as I said
> before,
> > is CongoCC. A few months ago, our project (finally!) put out an
> "artifact"
> > on Maven Central. That is here:
> >
> https://central.sonatype.com/artifact/org.congocc/org.congocc.parser.generator
> > I later realized that some