Austin Taylor wrote:
Hello everyone, I'm that Austin guy.

Did you look at FreeMarker? Or any other things besides Velocity before

deciding to roll your own template engine?



Yes. If we are focused on Velocity, it's because it was our favorite
template language before I wrote Viento. I can't get over the syntax. I've
never seen anything (even rhtml) that I like as well as $object.property.

Austin, are you seriously suggesting that writing $object.property is so much better than writing ${object.property} (or some other such thing) that this would be a _primary_ consideration in tool selection? To the extent that you would actually undertake writing your own template engine?

Put yourself in my shoes. I am very eager to get feedback on my work, as are you, I'm sure. But if somebody told you that the primary reason that they opted for perl over python, say, was that they liked writing 'elsif' better than 'elif', how would you react?

I mean, you understand, there's this basic dichotomy between form and structure. As somebody (one of a minority probably) who does know what an AST (abstract syntax tree) is, you surely understand that the tokens you use to delimit the structures in your language are the most trivial, superficial aspect of the thing.

In any case, if the only reason was the syntax, say, and the semantics and capabilities of FreeMarker were satisfactory, why not just tweak FreeMarker's javacc grammar to use different delimiters that you like better? Or you could write your own ideal grammar and basically have a filter that converted your syntax to FreeMarker's syntax on-the-fly. That would be some amount of work, of coursae, but an order of magnitude less work than writing and maintaining your own template engine. Surely you might consider all your options before embarking on something of that scale.

But anyway, that you don't like the tokens being used as delimiters in an open source tool does not strike me as sufficient motivation to roll your own template engine. Now, I don't really have any reason to discourage you guys. And maybe you just felt like writing your own template engine for the fun of it, but the stated *pragmatic* reasons that you have provided for doing so are very hard to process or frankly, to take seriously.

Now, of course, the other matter is that I am pretty satisfied that the syntax issue is largely a red herring. Somebody would get used to whatever syntax -- *within reason* (maybe XSLT one would never get used to) -- within a few days of starting to use the tool seriously. But even if that were the major issue that you claim, it does not, on technical or pragmatic grounds justify rolling your own template engine. I'm sorry, I just can't see it.



It's not 100% clear to me what you mean by this. Of course, as the main

author and maintainer of FreeMarker's parser code, if I don't
understand, then I think it's safe to say that most people wouldn't.
(I'm not even sure that most people in the market for a template
language know what an AST is.)



Sometimes code makes more sense than English.

Well, maybe, Austin, but my suspicion is that, far more often, when people cannot express their ideas in clear, plain English, it's because the ideas in question are rather half-baked.

This could sound insulting, but I really think that if you cannot or will not express in plain English what the advantages of using Sails over Velocity or FreeMarker are, then the natural, healthy reaction of most people should basically be to....(I don't know how else to say it...)... to not take you seriously.... I mean, I'm sorry, that's just the way it seems to me.

This
class<http://opensails.org/sails/file/org.opensails.viento/src/java/org/opensails/viento/builtins/IfMixin.java>is
the only code in the system that knows about 'if'. And this
little 
guy<http://opensails.org/sails/file/org.opensails.viento/src/java/org/opensails/viento/builtins/IterableMixin.java>is
solely responsible for list#each. The simplicity and the power
together
is what sets Viento apart. Less characters, more extensible.

For one thing, it is not obvious to me why you would ever want to

override the behavior of something as key to your language as the "if"
directive. Add new directives, sure, but, to override core ones like if
and so on???



You wouldn't. It's an illustration of the power available, not a practical
suggestion on how to use it.

Okay, so Sails is providing me this power to do something that I never want to do anyway. Okay, fine. Don't you think you should find a pragmatic example to motivate the discussion?

It's not like we specifically coded for that
sort of thing. It's just inherent in the philosophy that the core language
constructs shouldn't be 'special'. This idea is borrowed from languages like
ruby and smalltalk. It's partially purism, but I think it's going to turn
out very useful in Viento. We're just starting to use it ourselves, so we'll
see.

I don't think a run-of-the-mill person could read the above wiki entry

and understand what the pros and cons of Sails are as compared to the
alternatives. Or I should say 'alternative' in the singular, since you
only talk about Velocity.



We'll work on that.

Well, my comments above may seem harsh, but I encourage you to work on that, and do feel free to point me to links providing an updated discussion of this.

Regards,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/


Thanks,
Austin



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to