The main benefit in kernel isn't streaming to save memory. In fact as I mentioned in my first comment here, kernel doesn't support streaming currently because I didn't find it useful enough. Where kernel shines if the fact that you no longer have to gather your data before passing instructions to the template. You can create a view object that has async functions all over it, pass that to the template, and the template will call the view functions to get the needed data in parallel for you. Or in other words, it solves "callback hell" for a large part of a web app. Also I just like the way that the language doesn't assume any logic or flow control. You get to program everything including simple conditional as helpers functions.
On Fri, Jun 1, 2012 at 7:41 AM, Gabriel Farrell <gsf...@gmail.com> wrote: > On Wed, May 30, 2012 at 11:15 AM, Tim Caswell <t...@creationix.com> wrote: > > On Wed, May 30, 2012 at 7:15 AM, Oliver Leics <oliver.le...@gmail.com> > > wrote: > >> is dustjs[1] really the only template engine that implements rt > >> streamed render output and supports asynchronous calls within > >> template-functions? > > > > I will say I'm glad you're looking for this. I've been making this kind > of > > template language for years (Grain, Corn, Kernel, etc) and it's never > seemed > > to catch on. People say it's neat and I should port it to the browser > and > > yeah, it's neat (yes I repeated that). But then the next day it's like > the > > project never existed. > > > > I don't know if the idea is too foreign for people or if there is no real > > need for it. I used it for a real project and I like it. It feels like > the > > good parts to PHP without all the ugly.. > > I think non-streaming templating is still the norm because most > templates aren't large enough to be a concern in terms of memory or > computation time. If a lot of processing happens during rendering then > one can hit some bugs that are really hard to track down. Often it's > better to handle things in the JS before passing variables to the > template. > > That said, Kernel is cool. I'll keep it in mind for my next project. > Well, kernel as it is today doesn't stream. You don't get any memory benefit from it over a traditional template language. And yes, when I had it streaming I had a hard time handling errors after I'd already sent some html to the client. It's impossible to take back anything in http. The real benifit to kernel is the fact that you don't have to gather your data before running the template. > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en