Re: [web-devel] A light-weight web framework

The maintenance nightmare happens when someone uses the embedded language to
specify business logic, and that's entirely the web-{developer,designer}'s
fault. Thus, the problem is not that these languages shouldn't be powerful
enough.
IMHO, a safe approach would be simply not allowing I/O inside templates
(hey, sounds familiar ;-)
On 4/5/07, Maurice Codik
A few things, some of which I sort of mentioned in my previous email:
- If I'm already going to commit some time to learn a templating language, why dont I just spend that same amount of time learning the little bit of haskell I need to make the template work? If thats too much to ask, I can just spit out HTML, and have the programmer put in the dynamic parts for me. Both of these scenarios seem to be a more efficient use of time.
- Who is the target audience? If its a big organization where there are multiple designers and multiple devs, then your approach may work just fine. If its the single developer, then something like what David suggested would work even better. If its a small team (which may or may not include a full-time designer), then something like what I suggested would work best. For a web framework for haskell, I would guess that the latter two are much more likely.
- Embedding a real programming language in a template already gives you power to do what ever you need to do. What if you need to implement some logic that the template language doesnt support? In those cases, you're usually out of luck and have to move that logic into a controller, where it doesnt really belong (assuming its actual display logic, not business logic).
- It's really just a matter of taste. Any web framework thats worth using should be flexible in its support of view technologies, but come with one thats a sensible default.
Maurice
On 4/5/07, Joel Reymont
wrote: Do you see anything wrong with the approach I suggested, though?
On Apr 5, 2007, at 6:16 PM, Maurice Codik wrote:
) are extremely popular and work fairly well. They also keep the template language simple because there is already a full-powered
That's not necesarily true. Templates where there is mostly markup, but let you embed code into them using special tags (ex, <% code % programming language thats embedded into it. Good examples of this method are ERB templates in Rails, JSPs, Perl Mason templates, etc.
-- http://blog.mauricecodik.com _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
-- Ricardo Guimarães Herrmann "Any sufficiently complicated C or Fortran program contains an ad hoc, informally specified, bug-ridden, slow implementation of half of Common Lisp" "Any sufficiently complicated Lisp or Ruby program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Haskell"

That is why I prefer JSON and XSLT as template languages. The client side developer can't use them to do business logic and they are both idiomatically closer to the world in which the client side developer lives. Once we get the auto-conversion to XML/JSON working in HAppS, life gets really simple. The server app functions produce haskell datastructures. The framework auto-converts them into XML with a an XSLT PI or JSON with a script source. Then the clientside devloper gets to manipulate the data in very standard client languages. Right now, you can largely do the same thing, but you have to write the XML representations of your data structures manually. -Alex- On Thu, 5 Apr 2007, Ricardo Herrmann wrote:
The maintenance nightmare happens when someone uses the embedded language to specify business logic, and that's entirely the web-{developer,designer}'s fault. Thus, the problem is not that these languages shouldn't be powerful enough.
IMHO, a safe approach would be simply not allowing I/O inside templates (hey, sounds familiar ;-)
On 4/5/07, Maurice Codik
wrote: A few things, some of which I sort of mentioned in my previous email:
- If I'm already going to commit some time to learn a templating language, why dont I just spend that same amount of time learning the little bit of haskell I need to make the template work? If thats too much to ask, I can just spit out HTML, and have the programmer put in the dynamic parts for me. Both of these scenarios seem to be a more efficient use of time.
- Who is the target audience? If its a big organization where there are multiple designers and multiple devs, then your approach may work just fine. If its the single developer, then something like what David suggested would work even better. If its a small team (which may or may not include a full-time designer), then something like what I suggested would work best. For a web framework for haskell, I would guess that the latter two are much more likely.
- Embedding a real programming language in a template already gives you power to do what ever you need to do. What if you need to implement some logic that the template language doesnt support? In those cases, you're usually out of luck and have to move that logic into a controller, where it doesnt really belong (assuming its actual display logic, not business logic).
- It's really just a matter of taste. Any web framework thats worth using should be flexible in its support of view technologies, but come with one thats a sensible default.
Maurice
On 4/5/07, Joel Reymont
wrote: Do you see anything wrong with the approach I suggested, though?
On Apr 5, 2007, at 6:16 PM, Maurice Codik wrote:
) are extremely popular and work fairly well. They also keep the template language simple because there is already a full-powered
That's not necesarily true. Templates where there is mostly markup, but let you embed code into them using special tags (ex, <% code % programming language thats embedded into it. Good examples of this method are ERB templates in Rails, JSPs, Perl Mason templates, etc.
-- http://blog.mauricecodik.com _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
-- Ricardo Guimar�es Herrmann "Any sufficiently complicated C or Fortran program contains an ad hoc, informally specified, bug-ridden, slow implementation of half of Common Lisp" "Any sufficiently complicated Lisp or Ruby program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Haskell"

Right now, you can largely do the same thing, but you have to write the XML representations of your data structures manually.
-Alex-
I'm not sure but doesn't use HAppS kind of stripped down HaXml ? DrIft can derive HaXml instances automatically. Where is the problem doing using DrIft? Marc

DrIFT is a preproxessor so it makes the build process more complex. I'd like to find a pure-haskell solution or a TH solution that doesn't require more build complexity. -Alex- On Tue, 10 Apr 2007, Marc Weber wrote:
Right now, you can largely do the same thing, but you have to write the XML representations of your data structures manually.
-Alex-
I'm not sure but doesn't use HAppS kind of stripped down HaXml ? DrIft can derive HaXml instances automatically. Where is the problem doing using DrIft?
Marc _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Mon, Apr 16, 2007 at 07:09:10PM -0400, S. Alexander Jacobson wrote:
On Tue, 10 Apr 2007, Marc Weber wrote:
Right now, you can largely do the same thing, but you have to write the XML representations of your data structures manually.
-Alex-
I'm not sure but doesn't use HAppS kind of stripped down HaXml ? DrIft can derive HaXml instances automatically. Where is the problem doing using DrIft?
Marc _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
DrIFT is a preproxessor so it makes the build process more complex. I'd like to find a pure-haskell solution or a TH solution that doesn't require more build complexity.
You might want to look at the Data.Derive system. Basically it's a
giant library of helpers for writing TH-based derivations. It has a
few other cool features, like an automated guesser for sufficiently
regular classes. It's still in the cleanup-for-release stage, so any
questions should not be hesitated on!
http://www.cs.york.ac.uk/fp/darcs/derive
Primary maintainer: Neil Mitchell

Hi
DrIFT is a preproxessor so it makes the build process more complex. I'd like to find a pure-haskell solution or a TH solution that doesn't require more build complexity.
You might want to look at the Data.Derive system. Basically it's a giant library of helpers for writing TH-based derivations.
As Stefan says, you virtually described Data.Derive :)
It has a few other cool features, like an automated guesser for sufficiently regular classes.
A very cool feature, its touched on in the user manual, but I want to write more on this :-) Basically we don't need to specify how to write various derivations - we just write an example and it guesses at what the derivation is. Examples for which we can guess include Data, Eq, Ord, Serial, Arbitrary ....
It's still in the cleanup-for-release stage, so any questions should not be hesitated on!
Homepage: http://www-users.cs.york.ac.uk/~ndm/derive/ Manual: http://www.cs.york.ac.uk/fp/darcs/derive/derive.htm It is very much in the clean up for release stage - I'm hoping to get it released in the next few days (it requires GHC 6.6 at the mo, making it 6.4.2 compatible is one of the tasks on the list, but thats about it). If you find anything else that needs polishing, do shout! As of earlier today, Yhc uses Derive instead of DrIFT - and it made some bits quite a lot simpler. Thanks Neil
participants (5)
-
Marc Weber
-
Neil Mitchell
-
Ricardo Herrmann
-
S. Alexander Jacobson
-
Stefan O'Rear