public
Description: A Perl 6 web framework
Homepage:
Clone URL: git://github.com/masak/web.git
web / doc / PLAN
100644 80 lines (58 sloc) 3.025 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
This plan was drawn up in week 1 of the grant. It was later refined with
more details in week 10 of the grant.
 
We have something like three layers here. Here's how I view them:
 
                         Templating MVC Description
  ---------------------+------------+-----+----------------------------------
  LAYER ONE (ALEPH) | | | q&d get-out-of-my-way programming
                       | | |
  LAYER TWO (BET) | X | | medium-large projects w/o a db
                       | | |
  LAYER THREE (GIMEL) | X | X | large full-stack projects
  ---------------------+------------+-----+----------------------------------
 
== Layer one -- quick and dirty web programming with basically no framework
 
This is slated to be the Perl 6 equivalent of programming on top of CGI in Perl
5.
 
Rack will be ported more or less directly over to Perl 6-land. Then,
we'll be able to write very small Perl 6 web applications like this:
 
    use v6;
    use Astaire;
    get '/hi' => {
      "Hello World!"
    };
 
Currently, the things providing inspiration here are these:
 
  <http://rack.rubyforge.org/>
  <http://www.sinatrarb.com/>
 
On top of that, the Tags module gives us HTML syntax. It would still be
nice to have static validation also, but the state-of-the-art of Perl 6
self-parsing is not yet ready for something like that.
 
I need to think up more examples that do CGI-like stuff; particularly forms
and sticky fields and all that.
 
User Authentication will go here too, as soon as wayland gets time to write
about it.
 
We'll have a templating system at this layer, which does templating without
any assumptions about HTML or structure. That is, the templating system will
also work in non-HTML contexts.
 
== Layer two -- template programming without a full MVC framework
 
In this layer, we're already quite a bit above CPAN's HTML::Template. The
templates are all XML-based, but that is only a statement of the internal
processing; both input and output can still be HTML. We're porting Genshi
to Perl 6, and calling the port Hitomi.
 
  <http://genshi.edgewall.org/wiki/GenshiTutorial>
 
While not high-priority, it would be nice to port something like Hpricot,
an HTML document query and manipulation engine, supporting both CSS and
XPath queries.
 
 <http://wiki.github.com/why/hpricot/hpricot-challenge>
 
== Layer three -- a full Rails/Jifty-like MVC framework
 
I (masak) am currently going through different MVC frameworks to gain some
experience, and blogging about the progress.
 
These points were things I noticed and liked in Jifty.
 
* database versions (including DWIMmy upgrades)
* simple declarative built-in dispatcher ('before', 'on', 'after')
* sticky form fields
* form field validation (built-in and custom)
* degrading js/AJAX for everything (including URLs)
* model-side parameter validation
* free autogenerated REST, almost as a side effect
* autogenerated class hierarchy
* continuations (fake ones, but still)
* full stack