The computational power of lift templates and snippets

59 views
Skip to first unread message

altmattr

unread,
Sep 17, 2012, 1:28:59 AM9/17/12
to lif...@googlegroups.com
Hi folks,

I think lift's templates and snippets are a brilliantly general solution to a problem which seems to breed ad-hoc, specific solutions.  Plus, I have a weakness for simple computing systems and a curious nature.  It has been remarked already (https://groups.google.com/forum/#!msg/liftweb/sWPC9SE23e8/A1gf8d6jYoIJ) that snippets in lift are lisp-like and that one can think of them as functions.  However, I wanted to see if one can show that _just the built-in snippets_ and lift's tempting are enough for general computation.

I know this is a fool's errand, but curiosity got the better of me.  It turns out that lift's tempting and built-in snippets are not enough for general computation, but that you only need to reconsider the notation to get turing-complete templates using just the embed snippet!

I have written up what I learned in a blog post and put an example implementation on bitbucket

http://mattr.net.au/articles/turing_templates/

This highlights one of the things I love about lift, the solutions in lift to the problems of web application development tend to be simple and powerful.  This example shows off just how powerful the tempting mechanism is.

Thanks,

Matt

Ben Phelan

unread,
Sep 17, 2012, 7:23:24 AM9/17/12
to lif...@googlegroups.com
Nice!

David Pollak

unread,
Sep 17, 2012, 11:55:52 AM9/17/12
to lif...@googlegroups.com
Dude,

This is awesome!!

Thanks,

David

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 



--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net


Diego Medina

unread,
Sep 17, 2012, 2:22:15 PM9/17/12
to lif...@googlegroups.com
very cool!
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com
Reply all
Reply to author
Forward
0 new messages