Lorzy:
“Lego Programming”
       in Perl
  Chia-liang Kao <clkao@clkao.org>
        YAPC::Asia 2009, Tokyo
自己
介紹
id:clkao
高
嘉良
台湾
 人
日本語
日本語
不會
Takesako
   Inline::x86
Just In Time
Just In Time
   Slides
Just In Time
 Software!
no translation
RT:
Request Tracker
In Perl!
We   Perl
$normal_user
   ☠ Perl
Lorzy:
Lazy, Lispy, Orz
• Scheme-like interpreter in Perl
• Typeful
• uses Moose & Moose type system
Example
Defining
Rules, Actions
(Think gmail filters)
(lambda (ticket transaction) <HERE>) :: Bool
sub { my ($ticket, $transaction) = @_; <HERE> }
                 # returns Bool
If ticket’s queue matches “Foo”
$ticket->queue->name eq “Foo”
S-Expression
(Str.Eq (RT::Model::Queue.name
         (RT::Model::Ticket.queue ticket))
 “Foo”)
Strongly Typed
(Types are Good)
Problem
$ticket->queue->name eq “Foo”
$ticket->queue->name eq “Foo”
$ticket->queue->name eq “Foo”
$ticket->queue->name eq “Foo”
???!!!
Type mismatch!
Any function that takes
 Str and returns Bool
Any function that takes
   a and returns b
RT::Model::Ticket   Bool
RT::Model::Ticket   Bool
Any function that takes
   a and returns a
Bool   Bool
Bool   Bool
Backend:
 lcore
We want a sandbox
Dump database password, etc...
In Perl Environment
First attempt: ~2003
   Audrey & Jesse
Type mismatch!
Second attempt: ~2008
lcore:
~600 lines
TODO
iTunes
iTunes

not?
iTunes
iTunes

and/or?
iTunes
iTunes




ArrayRef[Bool]
MooseX::Types::Applicative
map
   isa => “CodeRef[CodeRef[a,b],
                    ArrayRef[a],
                   ArrayRef[b]]”
should be (a → Bool)
Load existing rules
   into the UI
Conclusion
Visual
Programming
Environment
Sandbox for
  providing
    user
 extensions
All about Types!
Live Demo!
http://github.com/bestpractical/rt/tree/lcore

   http://github.com/bestpractical/lcore
clkao@clkao.org
Hackathon on weekend!
Questions?
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
Upcoming SlideShare
Loading in...5
×

"Lego Programming" with Lorzy

1,661

Published on

Published in: Technology, Sports
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,661
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
33
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of ""Lego Programming" with Lorzy"

  1. 1. Lorzy: “Lego Programming” in Perl Chia-liang Kao <clkao@clkao.org> YAPC::Asia 2009, Tokyo
  2. 2. 自己 介紹
  3. 3. id:clkao
  4. 4. 高 嘉良
  5. 5. 台湾 人
  6. 6. 日本語
  7. 7. 日本語 不會
  8. 8. Takesako Inline::x86
  9. 9. Just In Time
  10. 10. Just In Time Slides
  11. 11. Just In Time Software!
  12. 12. no translation
  13. 13. RT: Request Tracker
  14. 14. In Perl!
  15. 15. We Perl
  16. 16. $normal_user ☠ Perl
  17. 17. Lorzy: Lazy, Lispy, Orz
  18. 18. • Scheme-like interpreter in Perl • Typeful • uses Moose & Moose type system
  19. 19. Example
  20. 20. Defining Rules, Actions
  21. 21. (Think gmail filters)
  22. 22. (lambda (ticket transaction) <HERE>) :: Bool
  23. 23. sub { my ($ticket, $transaction) = @_; <HERE> } # returns Bool
  24. 24. If ticket’s queue matches “Foo”
  25. 25. $ticket->queue->name eq “Foo”
  26. 26. S-Expression
  27. 27. (Str.Eq (RT::Model::Queue.name (RT::Model::Ticket.queue ticket)) “Foo”)
  28. 28. Strongly Typed
  29. 29. (Types are Good)
  30. 30. Problem
  31. 31. $ticket->queue->name eq “Foo”
  32. 32. $ticket->queue->name eq “Foo”
  33. 33. $ticket->queue->name eq “Foo”
  34. 34. $ticket->queue->name eq “Foo”
  35. 35. ???!!!
  36. 36. Type mismatch!
  37. 37. Any function that takes Str and returns Bool
  38. 38. Any function that takes a and returns b
  39. 39. RT::Model::Ticket Bool
  40. 40. RT::Model::Ticket Bool
  41. 41. Any function that takes a and returns a
  42. 42. Bool Bool
  43. 43. Bool Bool
  44. 44. Backend: lcore
  45. 45. We want a sandbox
  46. 46. Dump database password, etc...
  47. 47. In Perl Environment
  48. 48. First attempt: ~2003 Audrey & Jesse
  49. 49. Type mismatch!
  50. 50. Second attempt: ~2008
  51. 51. lcore: ~600 lines
  52. 52. TODO
  53. 53. iTunes
  54. 54. iTunes not?
  55. 55. iTunes
  56. 56. iTunes and/or?
  57. 57. iTunes
  58. 58. iTunes ArrayRef[Bool]
  59. 59. MooseX::Types::Applicative
  60. 60. map isa => “CodeRef[CodeRef[a,b], ArrayRef[a], ArrayRef[b]]”
  61. 61. should be (a → Bool)
  62. 62. Load existing rules into the UI
  63. 63. Conclusion
  64. 64. Visual Programming Environment
  65. 65. Sandbox for providing user extensions
  66. 66. All about Types!
  67. 67. Live Demo!
  68. 68. http://github.com/bestpractical/rt/tree/lcore http://github.com/bestpractical/lcore
  69. 69. clkao@clkao.org Hackathon on weekend!
  70. 70. Questions?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×