FP vs. JSP

Somebody who professes to not particularly like FP finds themselves implementing one: via Artima, the StringTemplate system shows what a trained software developer can do to clean up the previously somewhat filthy world of templating. (Although I think the Perl HTML templating library I used before was "push" too, by the way; maybe it is just the JSP users who were sent down the wrong path for so long).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hmm, seems a lot like Perl's Template Toolkit

I think you are thinking of Perl's Template Toolkit. It looks a lot like it to me, but not as nice a syntax (In my opinion at least).

Java bytcode as a communication protocol

Just read Cameron Roe on Java Bytecode as a Communication Protocol. I couldn't help thinking "been there, done that with lisp eons ago". Programs can communicate fairly well by sending data/code as s-expressions.

how pattern users discover FP

(Note that the one-way data flow between model and view is the "pipe" style of interface)

Lampson's Hints for System Design lists a number of forces involved in implementing systems, many of which imply a (mostly-)functional approach.

In this context, the most relevant fall under his "does it keep working?" head, and are "log updates", "make actions atomic", and "failing that, make them idempotent". As Parr points out, if the view can't change the model, these all comes for free: there are no updates to log, and actions can't leave objects in an undesired intermediate state.

Less important are some slogans under "is it fast?": "use static analysis", "cache answers", "use background/batch processing". In this case, avoiding model entanglement makes static analyses much easier, and the separation of phases means that one doesn't need interlocks or invalidates to when caching or multithreading (in general: when not committing to a specific evaluation order)

Many of his slogans from "does it work?" also encourage the FP approach, but are not as relevant in this context, with the possible exception of "divide and conquer" for the grammatical approach -- although I am sure that Parr would argue he as "did one thing and got it right".