-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPLAN
More file actions
95 lines (71 loc) · 3.18 KB
/
PLAN
File metadata and controls
95 lines (71 loc) · 3.18 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[Unashamedly writing in first person until other people contribute to this
file. Feel free to do so in any way you want, however. -- masak]
It says in the grant proposal: "Specifying framework basics: 1 week". So that's
what I'll be doing this week, specifying. I'm eager to get coding as well,
but it's nice to see where one is going.
We have something like three layers here. Here's how I view them:
Templating MVC Comments
---------------------+------------+-----+----------------------------------
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.
I think Rack can 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 Sinatra;
get '/hi' => {
"Hello World!"
};
Currently, the things providing inspiration here are these:
<http://rack.rubyforge.org/>
<http://www.sinatrarb.com/>
You'll note from the above example that no HTML is output, only a string.
This could be solved by making an (X)HTML module along the same principles
as the SVG module:
<http://github.com/masak/svg/blob/184536dc5af1388cd095e8f02e4c1987fba3d9d0/svg-example>
Something like this:
HTML.serialize( :html[
:head[ :title('On Problems') ],
:body[
:p[ 'A grook by Piet Hein' ],
:pre[
'Our choicest plans
have fallen through,
our airiest castles
tumbled over,
because of lines
we neatly drew
and later neatly
stumbled over.'
],
]
] );
That could conceivably give us a native syntax, along with DTD validation.
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 do it.
== 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. I'm planning to be heavily inspired by Python's
Genshi:
<http://genshi.edgewall.org/wiki/GenshiTutorial>
With reasonable syntactic modifications for Perl 6, of course.
Ideally, the templating system will also work in non-HTML, non-Web environments.
== Layer three -- a full Rails/Jifty-like MVC framework
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