User Tools

Site Tools


ischeme:ischeme

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ischeme:ischeme [2010/07/28 13:08]
ebainomu
ischeme:ischeme [2011/03/23 00:19] (current)
ebainomu
Line 1: Line 1:
 ====== iScheme ======  ====== iScheme ====== 
-iScheme is a prototype implementation of [[http://soft.vub.ac.be/amop/|ambient-oriented programming]] concepts that runs on iPhone devices. It provides developers with a convenient Scheme environment for constructing iPhone applications that exploit mobile platform capabilities such as sensors (accelerometer, and GPS), and Wi-Fi connectivity.  +[[http://soft.vub.ac.be/~ebainomu|Engineer Bainomugisha]]\\ 
 +\\ 
 + 
 +{{:ischeme:ischemelogo2.png?60  |:ischeme:ischemelogo2.png}}iScheme is a prototype implementation of [[http://soft.vub.ac.be/amop/|ambient-oriented programming]] concepts that runs on iPhone devices. It provides developers with a convenient Scheme environment for constructing iPhone applications that exploit mobile platform capabilities such as sensors (accelerometer, and GPS), and Wi-Fi connectivity.  
  
 iScheme is built on top of an R5RS [[http://soft.vub.ac.be/soft/skem|Scheme]] implementation that is developed at our lab. It supports Scheme and Objective-C interaction, thus enabling access to iPhone APIs (e.g., GPS, SMS, phone) from Scheme while bringing Scheme's well-known benefits (higher-order functions, structural macros, automatic garbage collection, etc.) to the iPhone development. iScheme provides a distribution layer that employs an event-driven style for peer-to-peer service discovery, asynchronous remote messaging, and timeout-based failure handling.  iScheme is built on top of an R5RS [[http://soft.vub.ac.be/soft/skem|Scheme]] implementation that is developed at our lab. It supports Scheme and Objective-C interaction, thus enabling access to iPhone APIs (e.g., GPS, SMS, phone) from Scheme while bringing Scheme's well-known benefits (higher-order functions, structural macros, automatic garbage collection, etc.) to the iPhone development. iScheme provides a distribution layer that employs an event-driven style for peer-to-peer service discovery, asynchronous remote messaging, and timeout-based failure handling. 
Line 9: Line 12:
 iScheme provides developers with an event-driven programming style for accessing iPhone capabilities as well as interacting with native applications, with higher-order functions being employed as event handlers. For example, retrieving location coordinates is achieved by way of the ''CURRENT-LOCATION'' abstraction as follows: iScheme provides developers with an event-driven programming style for accessing iPhone capabilities as well as interacting with native applications, with higher-order functions being employed as event handlers. For example, retrieving location coordinates is achieved by way of the ''CURRENT-LOCATION'' abstraction as follows:
  
-<code lisp>+<code scheme>
 (begin  (begin 
   (CURRENT-LOCATION   (CURRENT-LOCATION
Line 21: Line 24:
  
 Scheme programs are directly executed on the iPhone and it is possible to write scripts that interact with native applications e.g., making a phone call by simply evaluating ''(make-call *phone-string*)'' expression. The [[http://soft.vub.ac.be/soft/ipop:scheme|video here ]]showcases the interactive Scheme environment on the iPhone.  Scheme programs are directly executed on the iPhone and it is possible to write scripts that interact with native applications e.g., making a phone call by simply evaluating ''(make-call *phone-string*)'' expression. The [[http://soft.vub.ac.be/soft/ipop:scheme|video here ]]showcases the interactive Scheme environment on the iPhone. 
 +
 +
  
  
Line 27: Line 32:
 When writing distributed iPhone applications in iScheme, the developer does not need to deal with low-level distribution concerns in Objective-C such as dealing with the Bonjour framework for service discovery, and socket APIs for remote communication. iScheme provides distribution constructs that abstract away these low-level distribution issues.  When writing distributed iPhone applications in iScheme, the developer does not need to deal with low-level distribution concerns in Objective-C such as dealing with the Bonjour framework for service discovery, and socket APIs for remote communication. iScheme provides distribution constructs that abstract away these low-level distribution issues. 
  
-Let us demonstrate these constructs with an example: Assume a simple news service that allows news editors to submit news articles to news publishers in the surroundings as they move about. Then, the news publisher broadcasts the news to nearby iPhone devices of potential customers that have announced their interest in the current news trends.+Let us demonstrate these constructs with an example: Consider a simple news service iPhone app that allows news editors to submit news articles to news publishers in the surroundings as they move about. Then, the news publisher broadcasts the news to nearby iPhone devices of potential customers that have announced their interest in the current news trends.
  
 So, how do we realise such an application in iScheme? Read on... So, how do we realise such an application in iScheme? Read on...
 +
  
 ==== Exporting functions as services ==== ==== Exporting functions as services ====
Line 37: Line 43:
 In the example of the news service application, the news publishers need to make available their publishing service to other devices. The code snippet below shows how a programmer can explicitly export the ''news-publisher'' function representing the news publisher service. In the example of the news service application, the news publishers need to make available their publishing service to other devices. The code snippet below shows how a programmer can explicitly export the ''news-publisher'' function representing the news publisher service.
  
-<code lisp>+<code scheme>
 (define news-service (service-type iPhone-news)) (define news-service (service-type iPhone-news))
 (export-service news-publisher news-service) (export-service news-publisher news-service)
Line 49: Line 55:
 Service discovery in iScheme is by way of registering an event handler on a service type, which is triggered whenever a function exported under that type is encountered in the network.  In the news service application, an editor can be notified whenever a news publisher is discovered as follows: Service discovery in iScheme is by way of registering an event handler on a service type, which is triggered whenever a function exported under that type is encountered in the network.  In the news service application, an editor can be notified whenever a news publisher is discovered as follows:
  
-<code lisp>+<code scheme>
 (when-discovered news-service (when-discovered news-service
   (lambda (publisher-ref)   (lambda (publisher-ref)
Line 62: Line 68:
 Once a reference to the remote function is obtained, remote function invocations can be performed by means of the ''remote-send!'' function as follows: Once a reference to the remote function is obtained, remote function invocations can be performed by means of the ''remote-send!'' function as follows:
  
-<code lisp>+<code scheme>
 (define (submit-news publisher-ref) (define (submit-news publisher-ref)
   (for-each   (for-each
    (lambda (article)    (lambda (article)
      (remote-send! publisher-ref receive-article article))      (remote-send! publisher-ref receive-article article))
-        list-of-articles))+   list-of-articles))
 </code> </code>
 The ''remote-send!'' function takes as argument a remote reference, a function name, and optional variable number of arguments. In this example, the ''submit-news'' function iterates over a list containing news articles to be published, and invokes the ''receive-article'' function on the ''publish-ref'' reference corresponding to the newly discovered news publisher.  The ''remote-send!'' function takes as argument a remote reference, a function name, and optional variable number of arguments. In this example, the ''submit-news'' function iterates over a list containing news articles to be published, and invokes the ''receive-article'' function on the ''publish-ref'' reference corresponding to the newly discovered news publisher. 
Line 73: Line 79:
  
 In order to get the return value of a remote invocation, iScheme provides ''when-resolved'' function which registers an event handler that is invoked when the return value of the remote function invocation becomes available. In our running example, this is used to acknowledge the reception of articles sent to the news publisher. In order to get the return value of a remote invocation, iScheme provides ''when-resolved'' function which registers an event handler that is invoked when the return value of the remote function invocation becomes available. In our running example, this is used to acknowledge the reception of articles sent to the news publisher.
-<code lisp>+<code scheme>
 (define (submit-news publisher-ref) (define (submit-news publisher-ref)
  .... ;;iterator over news articles  .... ;;iterator over news articles
Line 84: Line 90:
 </code> </code>
 The ''remote-send'' function works similar to the ''remote-send!'' function but it returns a //future// instead. The ''when-resolved'' function registers an event-handler which is executed when the future is resolved. The ''remote-send'' function works similar to the ''remote-send!'' function but it returns a //future// instead. The ''when-resolved'' function registers an event-handler which is executed when the future is resolved.
 +
 +
  
  
Line 90: Line 98:
 ===== Example Applications ===== ===== Example Applications =====
 iScheme has been used to develop a couple of non-trivial iPhone applications.  iScheme has been used to develop a couple of non-trivial iPhone applications. 
-  * [[example_applications|AmbiScrabble: A distributed peer-to-peer scrabble-like game]]+  * [[example_applications#AmbiScrabble_Game_for_the_iPhone|AmbiScrabble: A distributed peer-to-peer scrabble-like game]]
  
 +
 +  * [[example_applications#PolyGlot_Chat_Application|PolyGlot chat: A distributed peer-to-peer polyglot chat]]
 +
 +===== Publications =====
 +
 +  * Engineer Bainomugisha, Jorge Vallejos, Elisa Gonzalez Boix, Pascal Costanza, Theo D'Hondt, Wolfgang De Meuter. **Bringing Scheme Programming to the iPhone --- Experience**. Journal of Software: Practice and Experience, 2011.
  
 ===== What about Apple's License Issues? ===== ===== What about Apple's License Issues? =====
-iPhone apps developed in iScheme do not require any modifications to the iPhone OS, therefore, they can be deployed to the iPhone like any other third party apps. So far we have used Apple's iPhone Development Certificate to deploy applications to real devices. Even more good news is that, as of June 7th, 2010 the Apple iPhone Developer Program License Agreement stipulates that applications may embed interpreters, which means that iPhone applications developed in iScheme can be submitted to the App Store.   
  
 +<note>
 +iPhone apps developed in iScheme do not require any modifications to the iPhone OS, therefore, they can be deployed to the iPhone like any other third party apps. So far we have used Apple's iPhone Development Certificate to deploy applications to real devices. Even more good news is that, as of June 7th, 2010 the Apple iPhone Developer Program License Agreement stipulates that applications may embed interpreters, which means that iPhone applications developed in iScheme can be submitted to the App Store.  </note>
 +
 +<note>
 +[[http://itunes.apple.com/us/app/ischeme-for-the-ipad/id422628070?mt=8|iScheme for iPad]] is now available for download on the App Store. 
 +</note>
ischeme/ischeme.1280315313.txt.gz · Last modified: 2010/07/28 13:14 (external edit)