Building a Programming
Layer for the Internet
Phillip J. Windley, Ph.D
Founder and CTO
Kynetx
www.kynetx.com
Your book’s available here!!!
scenarios
  can be described as
expressions over events
when new book on wishlist
before visiting borders...
traditionally this has been hard
People want to
achieve a purpose,
not go somewhere
The location metaphor
       has led us to
focus attention on servers
There’s more
to the Internet
 than servers
Amazon and Your Local Library
Amazon and Your Local Library
An intelligent, adaptable browser
helps you achieve your purpose
Web Programming
Calculating Exchange Rates
READ $amount;
READ $rate;
PRINT $amount * $rate
What does the same Web
  program look like?
Amount



  Continue
Amount



  Continue




             Rate



               Continue
Amount



  Continue




             Rate



               Continue




                          Amount: X.XX
Amount



  Continue

                                amount?

             Rate



               Continue




          ...
Amount



     Continue

                                   amount?

                Rate



                  Continue


...
Amount



           Continue

                                         amount?

                      Rate



           ...
Amount



        Continue

                                      amount?

                   Rate



                    ...
Amount



        Continue

                                        amount?

                     Rate



                ...
A New Programming Model
Reactive Systems
reacting to events
  from the user
Rule Languages
Rule Languages
Rule Languages
Constraint
Rule Languages
Constraint
Deductive
Rule Languages
Constraint
Deductive
Responsive
when
event
if


condition
then
action
ECAE Rules
ECAE Rules
ECAE Rules
Event
ECAE Rules
Event
Condition
ECAE Rules
Event
Condition
Action
ECAE Rules
Event
Condition
Action
Effect
Kynetx Architecture
Kynetx Architecture
Kynetx Architecture
BX




     Kynetx Architecture
KNS




BX




      Kynetx Architecture
KNS




BX




      Kynetx Architecture
KNS




BX




      Kynetx Architecture
Web
KNS       • pageview
          • submit
          • click
          • etc

BX




      Kynetx Architecture
Events
          Web
KNS       • pageview
          • submit
          • click
          • etc

BX




      Kynetx Archit...
Events
           Web
 KNS       • pageview
           • submit
           • click
           • etc

Endpoint
  BX




   ...
Events
           Web
 KNS       • pageview
           • submit
           • click
           • etc

Endpoint
  BX




   ...
Events
           Web        Mail
 KNS       • pageview • received
           • submit   • sent
           • click    • re...
Events
           Web        Mail         Other
 KNS       • pageview • received   • RSS
           • submit   • sent     ...
Kynetx Rule Language (KRL)
Sometimes a layer of indirection helps...
Kynetx Rule Language (KRL)
Sometimes a layer of indirection helps...

   Domain specific language
Kynetx Rule Language (KRL)
Sometimes a layer of indirection helps...

   Domain specific language
   Mental leverage via a...
Kynetx Rule Language (KRL)
Sometimes a layer of indirection helps...

   Domain specific language
   Mental leverage via a...
Kynetx Rule Language (KRL)
Sometimes a layer of indirection helps...

   Domain specific language
   Mental leverage via a...
KRL Rulesets
KRL Rulesets

  Events
KRL Rulesets

  Events
   Pageview via URL class
KRL Rulesets

  Events
   Pageview via URL class
   Submit form
KRL Rulesets

  Events
   Pageview via URL class
   Submit form
   Click element
KRL Rulesets

  Events
   Pageview via URL class
   Submit form
   Click element
   Change element
KRL Rulesets

  Events
   Pageview via URL class
   Submit form
   Click element
   Change element
  Declare and access da...
KRL Rulesets

  Events
   Pageview via URL class
   Submit form
   Click element
   Change element
  Declare and access da...
KRL Rulesets

  Events
   Pageview via URL class
   Submit form
   Click element
   Change element
  Declare and access da...
Event Expressions
select when pageview “/archives/(d+)”
              setting(year)
select when pageview “/archives/(d+)”
               setting(year)
       before click “#button”
select when pageview “/archives/(d+)”
               setting(year)
       then click “#button”
select when pageview “/archives/(d+)”
               setting(year)
       and click “#button”
select when pageview “/archives/(d+)”
               setting(year)
       or click “#button”
select when click “#button”
   between(pageview “/archives/d+”,
           pageview “google.com”)
select when click “#button”
   not between(
         pageview “/archives/d+”,
         pageview “google.com”)
select when (click “#button”
   not between(
          pageview “/archives/d+”,
          pageview “google.com”))
   befor...
What about
conditions, actions,
   and effects?
Little Languages
Little Languages
   Regular expressions
Little Languages
   Regular expressions
   JSONPath
Little Languages
   Regular expressions
   JSONPath
   jQuery HTML Selectors
Data
Data

   Geo-location
   Weather
   General (JSON/XML)
   Twitter
   Acxiom (pilot)
   GData (Google)
   Amazon
   OData (...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
ruleset library {
      global {
          datasource library_search
                 <- "http://www.example.com/bookdata/...
Demo
early binding
      vs
late binding
Sign up for a
free developer account
at http://www.kynetx.com
Building a Programing
Layer for the Internet
     Contact info:
    pjw@kynetx.com
    www.windley.com
       @windley
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
A Programming Layer for the Internet from Kynetx Impact 2010
Upcoming SlideShare
Loading in...5
×

A Programming Layer for the Internet from Kynetx Impact 2010

956

Published on

Programming on the Internet requires a different mental model than programming other types of applications. At the same time, most Web programming frameworks do a poor job of supporting this model. This presentation introduces events in KRL and discusses the language's design. Evented languages like KRL close this gap by supporting programming constructs that make creating applications that work across multiples protocols and APIs easy.

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

  • Be the first to like this

No Downloads
Views
Total Views
956
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

  • book on wishlist or maybe you just looked at it.
  • book on wishlist or maybe you just looked at it.





  • Indeed location has been one of the primary metaphors we&amp;#x2019;ve used to describe the web. After all, a URL is a Uniform Resource LOCATOR. We use verbs like &amp;#x201C;browse,&amp;#x201D; &amp;#x201C;go,&amp;#x201D; &amp;#x201C;locate,&amp;#x201D; &amp;#x201C;property,&amp;#x201D; and even &amp;#x201C;history&amp;#x201D; that all have a property theme.


  • In a &amp;#x201C;world of ends&amp;#x201D; everything is a peer, but architecturally, the Web is composed of different kinds of ends.
  • The most important feature for this discussion is that each Web site is a silo. The location metaphor works fine when what you want to do is confined to that silo. But what happens when you need information from multiple places to accomplish your task?







  • Sure clients have gotten flashier and faster over the years, but they&amp;#x2019;ve largely stayed the same: their job is to (a) go to a Web site, (b) retrieve content from a server and (c) properly render the content.
  • The browser can see all of the silos that a person interacts with.
  • With the right framework, the browser can bridge those individual contexts and provide a richer, cross-site context to develop.

  • We&amp;#x2019;re going to talk about how to do this, but we&amp;#x2019;ll make a little detour into a discussion about Web programming first.











  • Typically these are done in an ad hoc fashion. Some programming libraries and frameworks provide more help for this than others. In particular, managing data has gotten much easier due to standard library implementations for session data, but that&amp;#x2019;s the easy part.








  • Complex event expressions allow reaction to event patterns over time
  • Complex event expressions allow reaction to event patterns over time
  • Complex event expressions allow reaction to event patterns over time
  • Complex event expressions allow reaction to event patterns over time
  • Complex event expressions allow reaction to event patterns over time
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • Endpoints raise events
    KNS responds to events by running rules
  • No one&amp;#x2019;s ever surprised me with a GUI
  • No one&amp;#x2019;s ever surprised me with a GUI
  • No one&amp;#x2019;s ever surprised me with a GUI
  • No one&amp;#x2019;s ever surprised me with a GUI

















  • Pause here to talk about the expansiveness of each in KRL







































  • A Programming Layer for the Internet from Kynetx Impact 2010

    1. 1. Building a Programming Layer for the Internet Phillip J. Windley, Ph.D Founder and CTO Kynetx www.kynetx.com
    2. 2. Your book’s available here!!!
    3. 3. scenarios can be described as expressions over events
    4. 4. when new book on wishlist before visiting borders...
    5. 5. traditionally this has been hard
    6. 6. People want to achieve a purpose, not go somewhere
    7. 7. The location metaphor has led us to focus attention on servers
    8. 8. There’s more to the Internet than servers
    9. 9. Amazon and Your Local Library
    10. 10. Amazon and Your Local Library
    11. 11. An intelligent, adaptable browser helps you achieve your purpose
    12. 12. Web Programming
    13. 13. Calculating Exchange Rates
    14. 14. READ $amount; READ $rate; PRINT $amount * $rate
    15. 15. What does the same Web program look like?
    16. 16. Amount Continue
    17. 17. Amount Continue Rate Continue
    18. 18. Amount Continue Rate Continue Amount: X.XX
    19. 19. Amount Continue amount? Rate Continue Amount: X.XX
    20. 20. Amount Continue amount? Rate Continue sequence? Amount: X.XX
    21. 21. Amount Continue amount? Rate Continue sequence? Amount: X.XX • data
    22. 22. Amount Continue amount? Rate Continue sequence? Amount: X.XX • data • control flow
    23. 23. Amount Continue amount? Rate Continue sequence? Amount: X.XX • data • control flow ...and this is just one server
    24. 24. A New Programming Model
    25. 25. Reactive Systems
    26. 26. reacting to events from the user
    27. 27. Rule Languages
    28. 28. Rule Languages
    29. 29. Rule Languages Constraint
    30. 30. Rule Languages Constraint Deductive
    31. 31. Rule Languages Constraint Deductive Responsive
    32. 32. when
event if


condition then
action
    33. 33. ECAE Rules
    34. 34. ECAE Rules
    35. 35. ECAE Rules Event
    36. 36. ECAE Rules Event Condition
    37. 37. ECAE Rules Event Condition Action
    38. 38. ECAE Rules Event Condition Action Effect
    39. 39. Kynetx Architecture
    40. 40. Kynetx Architecture
    41. 41. Kynetx Architecture
    42. 42. BX Kynetx Architecture
    43. 43. KNS BX Kynetx Architecture
    44. 44. KNS BX Kynetx Architecture
    45. 45. KNS BX Kynetx Architecture
    46. 46. Web KNS • pageview • submit • click • etc BX Kynetx Architecture
    47. 47. Events Web KNS • pageview • submit • click • etc BX Kynetx Architecture
    48. 48. Events Web KNS • pageview • submit • click • etc Endpoint BX Kynetx Architecture
    49. 49. Events Web KNS • pageview • submit • click • etc Endpoint BX Kynetx Architecture
    50. 50. Events Web Mail KNS • pageview • received • submit • sent • click • refiled • etc • etc Endpoint BX Kynetx Architecture
    51. 51. Events Web Mail Other KNS • pageview • received • RSS • submit • sent • Facebook • click • refiled • Mobile • etc • etc • etc Endpoint BX Kynetx Architecture
    52. 52. Kynetx Rule Language (KRL) Sometimes a layer of indirection helps...
    53. 53. Kynetx Rule Language (KRL) Sometimes a layer of indirection helps... Domain specific language
    54. 54. Kynetx Rule Language (KRL) Sometimes a layer of indirection helps... Domain specific language Mental leverage via abstractions
    55. 55. Kynetx Rule Language (KRL) Sometimes a layer of indirection helps... Domain specific language Mental leverage via abstractions Designed for programming the Internet
    56. 56. Kynetx Rule Language (KRL) Sometimes a layer of indirection helps... Domain specific language Mental leverage via abstractions Designed for programming the Internet Browser and platform independent
    57. 57. KRL Rulesets
    58. 58. KRL Rulesets Events
    59. 59. KRL Rulesets Events Pageview via URL class
    60. 60. KRL Rulesets Events Pageview via URL class Submit form
    61. 61. KRL Rulesets Events Pageview via URL class Submit form Click element
    62. 62. KRL Rulesets Events Pageview via URL class Submit form Click element Change element
    63. 63. KRL Rulesets Events Pageview via URL class Submit form Click element Change element Declare and access data sources
    64. 64. KRL Rulesets Events Pageview via URL class Submit form Click element Change element Declare and access data sources Conditionally fire action
    65. 65. KRL Rulesets Events Pageview via URL class Submit form Click element Change element Declare and access data sources Conditionally fire action Effects
    66. 66. Event Expressions
    67. 67. select when pageview “/archives/(d+)” setting(year)
    68. 68. select when pageview “/archives/(d+)” setting(year) before click “#button”
    69. 69. select when pageview “/archives/(d+)” setting(year) then click “#button”
    70. 70. select when pageview “/archives/(d+)” setting(year) and click “#button”
    71. 71. select when pageview “/archives/(d+)” setting(year) or click “#button”
    72. 72. select when click “#button” between(pageview “/archives/d+”, pageview “google.com”)
    73. 73. select when click “#button” not between( pageview “/archives/d+”, pageview “google.com”)
    74. 74. select when (click “#button” not between( pageview “/archives/d+”, pageview “google.com”)) before click “#link_1”
    75. 75. What about conditions, actions, and effects?
    76. 76. Little Languages
    77. 77. Little Languages Regular expressions
    78. 78. Little Languages Regular expressions JSONPath
    79. 79. Little Languages Regular expressions JSONPath jQuery HTML Selectors
    80. 80. Data
    81. 81. Data Geo-location Weather General (JSON/XML) Twitter Acxiom (pilot) GData (Google) Amazon OData (Microsoft)
    82. 82. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    83. 83. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    84. 84. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    85. 85. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    86. 86. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    87. 87. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    88. 88. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    89. 89. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    90. 90. ruleset library { global { datasource library_search <- "http://www.example.com/bookdata/?wt=json" cachable; } rule book_notfication is active { select when pageview "www.amazon.com/gp/product/(d+)/" setting(isbn) pre { book_data = datasource:library_search("q="+isbn); url = book_data.pick("$..docs[0].url"); title = book_data.pick("$..docs[0].title"); msg = << This book's available the library. <a id="MLN_link" href="#{url}">#{title}</a> >>; } if(book_data.pick("$..numFound") > 0) then { notify("Local Library", msg) } callbacks { success { click id="MLN_link" } }}} KRL for Library Lookup
    91. 91. Demo
    92. 92. early binding vs late binding
    93. 93. Sign up for a free developer account at http://www.kynetx.com
    94. 94. Building a Programing Layer for the Internet Contact info: pjw@kynetx.com www.windley.com @windley
    1. A particular slide catching your eye?

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

    ×