[Jifty-commit] r3721 - talks/talks
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Thu Jul 26 16:56:10 EDT 2007
Author: jesse
Date: Thu Jul 26 16:56:09 2007
New Revision: 3721
Modified:
talks/talks/oscon.dsls.2007.txt
Log:
45 minutes before my talk.
Modified: talks/talks/oscon.dsls.2007.txt
==============================================================================
--- talks/talks/oscon.dsls.2007.txt (original)
+++ talks/talks/oscon.dsls.2007.txt Thu Jul 26 16:56:09 2007
@@ -34,7 +34,7 @@
---
DSLs can be implemented outside your 'host' language
---
-(External DSLs)
+("External" DSLs)
---
Everything I'm going to talk about is Pure Perl (Internal)
---
@@ -42,7 +42,7 @@
---
You can make DSLs in Perl, too
---
-(but it does take more work in Perl)
+(but you do need to know a few tricks)
---
How did I get here?
---
@@ -84,6 +84,18 @@
---
Never say that to a Perl Hacker
---
+As it turns out...
+---
+We were building a web framework (Jifty)
+---
+(It's more like Seaside than Rails)
+---
+But Rails looked beautiful
+---
+So I started thinking about making Jifty beautiful
+---
+I got the DSL religion
+---
#title Agenda
We've made some DSLs
---
@@ -103,6 +115,8 @@
---
One for dispatching HTTP requests
---
+(I'm told it's "routes"esque)
+---
One for making web testing easier
---
(It's VERY beta)
@@ -138,16 +152,7 @@
type => 'int(11)',
default => ''
},
- Name => {
- read => 1,
- write => 1,
- sql_type => 12,
- length => 200,
- is_blob => 0,
- is_numeric => 0,
- type => 'varchar(200)',
- default => ''
- },
+ ...
}
}
@@ -174,9 +179,12 @@
has_default 'frank'
};
---
-<chmrr> (by the way, i'm pretty sure we don't get to do the sub-at-the-end thing either... I tried lots of hacky ways to get it working and failed.)
+<chmrr> (by the way, i'm pretty sure we don't get to do the
+sub at the end thing either... I tried lots of hacky ways to
+get it working and failed.)
-<glasser> yeah, I think we're going to end up having a pseudo-sub that's really a hash behind the scenes
+<glasser> yeah, I think we're going to end up having a
+pseudo-sub that's really a hash behind the scenes
---
#mode perl
{
@@ -241,17 +249,23 @@
refers_to_many RT::Tickets by 'owner';
-<Robrt> hmm. i thought about this before. we can do like simon and
+<Robrt> hmm. i thought about this before. we can do like simon and:
- refers_to_many "RT::Tickets by owner";
+ refers_to_many "RT::Tickets by owner";
<Robrt> but I don't really like that. parsing is lame.
<Robrt> I'm *pretty* sure that we can't get the line you've written to compile.
---
-<obra> I've got a bad perl5 idea for you. Robert claims it's impossible
+<obra> I've got a bad perl5 idea for you.
-<obra> I'm trying to make the syntax "refers_to_many 'BTDT::Model::Tasks' by 'owner';" valid perl5 syntax.
+<obra> Robert claims it's impossible.
+
+<obra> I'm trying to make the syntax
+
+<obra> "refers_to_many 'BTDT::Model::Tasks' by 'owner';"
+
+<obra> valid perl5 syntax.
---
<audreyt> well, that may be true but you don't want that.
---
@@ -497,7 +511,11 @@
<jedi><knights>
---
-What it looks like
+I'm Just Another Perl Hacker
+---
+I needed something more Perlish
+---
+What Template::Declare looks like
---
#mode perl
template '/pages/mypage.html' => sub {
@@ -633,6 +651,7 @@
# perldoc UNIVERSAL
---
CLASS->can( METHOD )
+
"can" checks if the object or class has a method called "METHOD".
If it does then a reference to the sub is returned.
---
@@ -679,7 +698,9 @@
---
We install methods for every HTML tag
---
-(Except 'tr'. Anybody know why?)
+Except 'tr'
+---
+Anybody know why?
---
#mode perl
use CGI ();
@@ -731,7 +752,7 @@
---
My partner, CL, is from Taiwan.
---
-You should know something about Taiwanese Perl Hackers
+Something to know about Taiwanese Perl Hackers
---
They're scary
---
@@ -743,23 +764,29 @@
---
He wanted offline apps with Jifty
---
-That means a Javascript Templating Engine
+Now we need a Javascript Templating Engine
---
-Actually, no.
+Actually, no
---
We can introspect compiled templates...
---
-...using an improved B::Deparse.
+...using an improved B::Deparse
---
That gets us an OP tree...
---
...which we can use to generate Javascript
---
-We can already do T::D tags, map, grep and for
+We can already do T::D tags
+---
+for
+---
+map
+---
+grep
---
We're rolling improvements back to the Perl core
---
-Ping me afterward if you want to help out.
+Ping me afterward if you want to help out
---
#title
Jifty::Dispatcher
@@ -879,11 +906,15 @@
sub before ($$@) { ... }
sub on ($$@) { ... }
sub after ($$@) { ... }
-sub run (&) { return shift }
+---
+#mode perl
sub HTTPS ($) { return protocol => 'HTTPS', @_ }
sub HTTP ($) { return protocol => 'HTTP', @_ }
sub GET ($) { return method => 'GET', @_ }
---
+#mode perl
+sub run (&) { return shift }
+---
The rest is just building up a list of rules and running it
---
#title
@@ -999,6 +1030,8 @@
#title Test::WWW::Declare - end
That's Test::WWW::Declare
---
+Want a commit bit? Ping me afterward.
+---
#title Conclusion
Creating DSLs is lots of fun
---
More information about the Jifty-commit
mailing list