Now, after dusting off the code from the Sourceforge trunk in preparation for a new release (which I intend to name FreeMarker NG) I am faced with this whole issue of the various third-party libraries needed to compile all the code.
Finally, I think this is a big mess that needs to get cleaned up. I took the whole codebase into IntelliJ and, of course, it didn’t compile (over a thousand errors) because I did not have a whole slew of dependencies. Well, the solution is obvious. I had to hunt down the various .jar files and stick them in a libs directory. But really, the whole exercise raises various questions. For starters, there is just the whole versioning problem. All these various libraries have different versions. This project has been neglected for about 10 years, so back then, presumably we were compiling against fairly recent versions of the various libraries, but now those are very old and obsolete. So what to do?
There is also the more general issue of whether the subcomponent that requires whatever library should really be supported moving forward anyway.
So, okay, breaking this down, we have:
- The Servlet/JSP API’s.
- The XML-related libraries
- Logging (or really, various logging abstractions!)
- support for other JVM-based languages, like Jython, JRuby, Rhino
- JUnit for the unit tests.
Am I missing something? (Well, if I am, I’ll fill it in later.)
On this point, it seems obvious that the main existing usage of FreeMarker is in the web space, so we have to keep the various Servlet related stuff in shape and, I believe, the JSP support as well. There is no question of removing this, so the real problem is which version (or versions) we are supporting. And whether what we have is up to date.
XML related API’s
This one makes me nervous. We had Xalan 2.7.0 as a build dependency and Xalan is not just a DOM/XPath thingy, but is a full implementation of XSLT. (Who uses XSLT nowadays, I wonder.) There is built-in support for the various XML support in the latest JDK’s, I’m sure (as there is support for just about anything) and my sense is that we should try to just use that and get rid of any external dependencies. There is also this thing called Jaxen, an XPath implementation. I want see about getting rid of that as a dependency.
Now, as a more general comment, I scoured the net looking for people discussing the use of FreeMarker to transform XML. Now, it does work very well for that task, I do know that, but what is the community (if any) of people using FreeMarker for this?
First some history. (As best I understand it.) Once upon a time in the early days of Java, some guy (actually, he did have a name, Ceki Gülcü ) came up with a logging library called Log4J that became a sort of de facto standard out there. Later, Sun Microsystems, rather than simply incorporated that library into the JDK, rolled up their own version, the java.util.logging API that was introduced in JDK 1.4. Some people thought that what Sun did was quite inferior (not only Ceki, apparently, other people) and preferred to keep using Ceki’s library and there were some other logging libraries and then some people saw the need for a logging abstraction, which is what this SFL4J thing is.
My own instinct (but I don’t absolutely trust it) is to use whatever is currently in the JDK and get rid of all these logging abstractions. But I really don’t know and would like some people to weigh in on it. (I really hate this logging API topic because it just seems like such a much ado about nothing.)
Supporting alternative languages for the JVM (Jython, JRuby, Rhino)
This is actually quite an interesting topic and I got into this just because I saw that it was just very much fun. So, I believe that I wrote some initial wrappers for Jython and JRuby objects as a sort of proof of concept. Also, an entire Jython runtime could be embedded in a FreeMarker template, but it is hard to really see the use case for this. I did it because it could be done and it remained in the code repository. Later, Attila Szegedi got very interested in this whole alternative JVM language issue and took ownership of that initial work I did and surely polished it off quite a bit.
There is, however, a problem with all that. There is not the slightest evidence I can find that anybody actually uses any of this!
Now, supporting all these various things has all sorts of versioning problems and I have not even checked whether any of this compiles against more recent versions of Jython, JRuby.
Well, to make a long story short, my solution for building everything on my own box was just to rip it all out. I don’t think anybody is using it and if, contrary to my belief, people are using it and will complain, then they can show up and complain and maybe we’ll put it back. Or maybe some other people will take ownership of all this and keep it working. I don’t think I am willing to do so, certainly not in a situation where there is zero evidence that anybody uses it. In fact, there is close to zero evidence that anybody (at least any significant number) are using FreeMarker to process/transform XML. However, in that case, the most basic usage patterns should still be kept working.
We were compilng the test cases against the junit 3.7 jarfile and, on my local box, I have that as a dependency. But I have to assume that this is something very old and we either have to see about updating to a more recent version or switching to some other testing framework. This, ideally, would be something that some eager person wanting to get involved could take ownership of.
Oh, and I ripped out support for JRebel as well. I’m not actually a hundred percent sure what that is, but I don’t want to keep carrying these things forward. I’d rather get the codebase down to a more lean, mean level so that we can do some fundamental things without carrying forward all this cruft that, basically, nobody uses. Still, I start this as a topic so that people can put in their two cents on all this.