"Lego Programming" with Lorzy

  • 1,561 views
Uploaded on

 

More in: Technology , Sports
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,561
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
32
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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