In general the invention relates to a method for simulating subroutine calls in applications that communicate with a client (i.e., a user) through a minimal interface. In particular, the invention relates to the use of continuations to simulate subroutine calls in a program that interacts with the user through successive Web pages.


The invention involves a new use of an existing technology called continuations. Suppose there are two functions f and g, where f takes an argument x and returns g(x)+1, and g returns twice its argument. So, calling f(n) returns 2n+1. The two functions could be expressed in Scheme as follows:

(define (fx)


(define (gx)


Scheme is an IEEE standard language often used to describe algorithms. Scheme is used here, instead of the more conventional Pascal-like pseudocode, because it has some additional needed abstractions. Scheme is a prefix language, so x+1 is expressed as (+x1). In more conventional pseudocode, f and g might be expressed as:

Function f(x)

return g(x)+1

Function g(x)

return x*2.

The function g is a subroutine. The value g returns gets sent back to a calculation in process in f. After g sends control back to f, one is added to the value g returned, and then that value is returned by f.

It is possible to transform any pair of functions like f and g so that nothing has to happen in f after g returns. This can be done by packing into another function, c, everything that is supposed to happen in f after g returns, and passing c as an additional argument to g. The additional argument, c, is called a continuation. The function g is then rewritten so that instead of returning the value it would have returned, it returns the result of passing it to the continuation. For example, the original f and g could be rewritten as:

(define (f2x)

(g2x(lambda (y) (+y1))))

(define (g2xc)


It is noted that, in Scheme, “(lambda (x) (+x1))” means a function that takes one argument and returns that plus one. The function f2 takes one argument, a number x. It calls g2 with two arguments: x, and a function that returns its argument plus one. The work that used to be done in f after control returned from g is now packed up in a function and sent as an additional argument to g2. The function g2 takes two arguments, a number x and a function c. It returns the result of calling c on x*2. In this case, c is a function that adds one to its argument, so g2 returns (and in turn f2 returns) 2x+1, just as f did in the previous example.

Any ordinary program can be transformed to use continuations, so that nothing ever happens in a calling function after control returns from a subroutine. The form of the program that results from this transformation is called “continuation-passing style.” This technique can be applied to subroutine calls to any depth. For example, the functions:

(define (fx)


(define (gx)


(define (hx)


Can be transformed into:

(define (f2x)

(g2x(lambda (y) (+y1))))

(define (g2xc)

(h2x (lambda (y) (c(*y2)))))

(define (h2xc)


Web pages are usually sent from one machine (e.g., a server) to another (e.g., a client). The two machines can be the same, but typically are separate machines that communicate via a network. The term “server” can mean both the physical machine that is sending web pages and the software on the machine that responds to requests for pages.

The client requests a web page from the server using a url (i.e., Universal Resource Locator). A url has three parts: the protocol by which the client wants to talk to the server, the name of the server, and a third part, referred to herein as the “request,” that indicates what the client wants the server to send it. The following is an example of a url expressed in a form commonly used today: In this url, “bar.html” is the request. Most servers would interpret “bar.html” as a request for an html file stored on disk, and would respond by reading the file and sending it to the client. But how to respond to a request is entirely up to the server. A server could equally well choose to interpret “bar.html” as a request to generate a web page containing the current time.

A web page usually contains some amount of text plus html operators specifying how to display the page on the screen. The client software (e.g. a browser) has considerable leeway in deciding how to display the page to the user. The aspect of the display of web pages relevant to the subject application is the display of links and forms.

A link is usually a combination of text and/or an image, plus a url. Typical client software will display the text or image with an underline, an outline, or some other indication that the text is active. The user can indicate that he wants to follow that link usually by clicking on it with a mouse. The phrase “to click on a link” is used herein as a general term to mean whatever method the user uses to indicate that he wants to follow a link. When the user clicks on a link, the request in the associated url is sent to the web server mentioned in that url. Usually, the request will cause the server to send the client another web page, which will in turn contain other links, resulting in an ongoing series of requests from the client interweaved with web pages sent in reply by the server(s).

A form is like a link in that it includes places (e.g., “buttons”) where the user can click to send a request to a server, but it can also include “fields”, through which the user can send additional information along with the request. For example, a form field might be a menu of choices, a box in which the user can type text, or a button that the user can toggle on or off.

The term “link” is used herein to include both links and forms, along with any other element of a web page that has an associated url, and which a user can click on to send the request in the url to the server mentioned therein.


The present invention features a method for communicating between a client and a server through a limited communication interface. The communication interface may be the world wide web. The server may be a web server, and the client and server may reside in the same computer platform. As used herein, limited communication interface refers to an interface that, in general, comprises links and forms. More particularly, the interface processes successive iterations in which the server sends a set of keys to the client and the client chooses one of the keys and sends it back to server.

The method also includes providing continuation functions associated with each of a plurality of links. The continuation function may refer to another continuation function. Each of the plurality of links may represent a parameter in a web page. The plurality of links includes a key that is associated with one of the continuation functions.

The plurality of links are sent through the limited communication interface from the server to the client. A selected one of the plurality of links is sent from the client to the server. The continuation function associated with the selected link in the server is then executed. The continuation function may be executed at the server.

The present invention also features a method for communicating between a plurality of clients and a web server through a limited communication interface. The method includes providing continuation functions associated with each of a plurality of links. The plurality of links is sent through the limited communication interface from the server to the plurality of clients. A selected one of the plurality of links is sent from one of the plurality of clients to the server. The continuation function associated with the selected link in the server is executed.


FIG. 1 is a block diagram of a client-server computing system incorporating the principles of the invention.

FIG. 2 is an illustration of successive Web pages containing links that a user can click on to send commands back to the server.

FIG. 3 is a flow chart illustrating the use of continuations to simulate subroutine calls in a program that interacts with the user through successive Web pages


Referring to FIG. 1, a distributed computing environment 30 includes clients 32 (e.g., a computer, fax machine, web-enabled television) connected to the Internet 34 (or to an intranet) via a network service provider 36. A users can manipulate a client 32 via a user interface (not shown). Each client 32 can communicate with other clients or with web servers 38, 40 (e.g., game sites, video sites, corporate sites, libraries, electronic publishing) through the network service provider 36. The web server 40 includes an application program 42 and a database 44. The invention can reside in the web server 40 or in one or more clients 32.

The invention relates to a novel use for continuations to solve a problem that has become especially important with the rise in popularity of the World Wide Web. In particular, continuations are used to simulate subroutine calls in a program that interacts with the client 32 through successive Web pages. Where a regular piece of desktop software would display successive screens to the user, the invention relates to the display of successive Web pages 48, 50, 52. The pages contain links 48 a, 48 b, 50 a, 50 b, 52 a, 52 b that the user can click on to send commands back to the server 40.

Each time a Web page is generated for the client 32, the code that should be executed for each link that could be clicked on is also generated. Each piece of code is stored in a table 46 on the server 40 and indexed under a unique key. When the page is sent to the client 32, the request part of each link includes the key of the corresponding piece of code. When the user clicks on a link, a key is included in the request sent to the server 40, and the server 40 responds by executing the code stored in its table under that key. This code will usually end by sending another page to the client 32, containing its own links, each associated with more code on the server 40. In this way, the client 32 and the server 40 maintain an ongoing conversation of button clicks interleaved with Web pages sent in response.

It is often useful to have subroutine-like behavior in interactive client-server sessions. For example, suppose a user is running ordinary desktop software and, for some reason, wants to select a color. The program he is using will generally call a subroutine that pops up a window where he can select a color. After the user selects the color, the color-selection subroutine returns control, along with the selected color, back to the code that called it. This kind of behavior is easy to achieve in desktop software, where the operating system manages interactions with the user and has built-in support for subroutines.

The invention uses continuations to get the same effect in interactive client-server sessions consisting of ordinary Web pages. The key observation is that, when a program is written using continuations, nothing remains to be done after a subroutine returns. Therefore, it does not matter if the subroutine never returns to the calling code.

When the code is generated for each link on the page that is sent to the client 32, each piece of code can have an associated continuation. When the user clicks on a link and a piece of code is run, it ends by calling the continuation. There is no actual notion of subroutines. The code does not return control to any calling code. However, because all that would have happened in the calling code is embodied in the continuation, it looks to the user just as if control returned from a subroutine. By way of example, consider the following client-server interaction (FIG. 3):

1. A user is looking at a page provided by the server displaying a series of parameters he might want to change (54). Suppose some of the parameters are colors, and are shown as swatches representing the current value of the parameter, plus a Select button that can be clicked on to select a new value.

2. The user clicks on the Select button of one of the parameters (56), and is then sent a Web page by the server containing a selection of colors that he can click on to choose a new value (58).

3. The user clicks on one of the colors (60), and is sent another page by the server (62), exactly like the one shown in Step 1, except with a new color for the parameter whose Select button he clicked on.

Step 2 looks to the user like a subroutine call. It looks to the user as if he were merely returning to the page shown in Step 1. But what actually happens inside the server is that the code associated with each of the links generated in Step 2 (i.e., the possible colors) has as its continuation another piece of code that will generate the same page that was generated in Step 1. Because continuations can refer to other continuations, it is possible to simulate nested subroutine calls as deep as necessary.


While the invention has been particularly shown and described with reference to specific preferred embodiments, it should be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. For example, although the primary use of the invention has been in server-based applications that use Web pages as their interface, it could equally well be applied in any situation where the interaction between application and client is similarly minimal.

Read More

83 thoughts on “Method for client-server communications through a minimal interface”

  1. Hello would you mind letting me know which web host you’re using?
    I’ve loaded your blog in 3 different internet browsers and I must say this blog loads a lot quicker then most.

    Can you suggest a good web hosting provider at a fair price?

    Many thanks, I appreciate it!

  2. Having read this I believed it was very informative.
    I appreciate you spending some time and energy to
    put this content together. I once again find myself
    spending a lot of time both reading and leaving comments.
    But so what, it was still worth it!

  3. I’m extremely impressed with your writing skills
    and also with the layout on your weblog. Is this a paid theme or did you modify it yourself?
    Either way keep up the nice quality writing, it is rare to see a great blog like this one these days.

  4. Greetings! Very helpful advice within this article! It is
    the little changes that make the most significant changes.
    Thanks a lot for sharing!

  5. I am in fact happy to read this webpage posts which consists of
    plenty of useful information, thanks for providing these statistics.

  6. I think this is one of the most important info for me.
    And i’m glad reading your article. But should remark on few general things,
    The site style is ideal, the articles is really great : D. Good job, cheers

  7. I got this website from my pal who shared with me regarding this site and now this
    time I am browsing this web site and reading very informative articles or reviews at this place.

  8. You could certainly see your expertise within the article
    you write. The world hopes for more passionate writers such as you who aren’t afraid to
    say how they believe. At all times follow your heart.

  9. Hey there! I could have sworn I’ve been to this site before but after browsing through
    some of the post I realized it’s new to me. Anyways,
    I’m definitely delighted I found it and I’ll be bookmarking
    and checking back often!

  10. magnificent put up, very informative. I’m wondering why the
    opposite experts of this sector do not realize this.
    You should proceed your writing. I’m confident, you’ve a great readers’ base already!

  11. I just want to say I’m all new to blogging and definitely enjoyed your website. Almost certainly I’m going to bookmark your blog post . You surely have great posts. Cheers for sharing your blog.

  12. Thanks for your fascinating article. One other problem is that mesothelioma is generally brought on by the breathing of dust from asbestos, which is a dangerous material. It can be commonly noticed among employees in the construction industry that have long contact with asbestos. It is caused by living in asbestos protected buildings for a long time of time, Inherited genes plays a huge role, and some people are more vulnerable on the risk as compared to others.

  13. Great write-up, I am normal visitor of one¡¦s web site, maintain up the nice operate, and It is going to be a regular visitor for a long time.

  14. One other issue is when you are in a scenario where you don’t have a cosigner then you may actually want to try to make use of all of your educational funding options. You will discover many grants or loans and other scholarships or grants that will present you with money to aid with university expenses. Thanks alot : ) for the post.

  15. Hey There. I found your blog using msn. This is a very well written article. I’ll make sure to bookmark it and return to read more of your useful info. Thanks for the post. I will certainly comeback.

  16. I would like to thnkx for the efforts you have put in writing this site. I’m hoping the same high-grade website post from you in the upcoming also. Actually your creative writing skills has encouraged me to get my own web site now. Really the blogging is spreading its wings fast. Your write up is a good example of it.

  17. Generally I don’t learn post on blogs, however I wish to say that this write-up very forced me to check out and do it! Your writing style has been surprised me. Thanks, very great article.

  18. Good day! I know this is kind of off topic but I was wondering which blog platform are you using for this website? I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking at options for another platform. I would be awesome if you could point me in the direction of a good platform.

  19. Wonderful blog! I found it while surfing around on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Cheers

  20. I would like to thnkx for the efforts you have put in writing this site. I’m hoping the same high-grade web site post from you in the upcoming as well. Actually your creative writing skills has inspired me to get my own site now. Really the blogging is spreading its wings quickly. Your write up is a great example of it.

  21. Hello very nice web site!! Man .. Beautiful .. Amazing .. I will bookmark your blog and take the feeds additionally…I am satisfied to search out so many useful info right here within the put up, we want work out extra strategies in this regard, thanks for sharing.

  22. I’m no longer sure the place you’re getting
    your information, but good topic. I must spend a while
    finding out much more or working out more. Thank you for fantastic information I used to be looking for this info for my mission.

  23. My brother suggested I might like this web site. He was totally right. This post actually made my day. You can not imagine simply how much time I had spent for this info! Thanks!

  24. You could certainly see your expertise in the work you write. The world hopes for more passionate writers like you who aren’t afraid to say how they believe. Always follow your heart.

  25. hello!,I really like your writing very a lot! percentage we communicate more approximately your article on AOL? I require an expert on this area to unravel my problem. Maybe that’s you! Looking ahead to see you.

  26. What i don’t realize is actually how you’re not actually much more well-liked than you may be right now. You’re so intelligent. You realize therefore considerably relating to this subject, made me personally consider it from a lot of varied angles. Its like women and men aren’t fascinated unless it is one thing to accomplish with Lady gaga! Your own stuffs nice. Always maintain it up!

  27. Hey, you used to write excellent, but the last several posts have been kinda boring¡K I miss your tremendous writings. Past few posts are just a little bit out of track! come on!

  28. I think other website proprietors should take this web site as an model, very clean and excellent user friendly style and design, as well as the content. You are an expert in this topic!

  29. Hello There. I found your blog using msn. This is an extremely well written article. I will make sure to bookmark it and come back to read more of your useful information. Thanks for the post. I will certainly return.

  30. We are a group of volunteers and starting a new scheme in our community. Your site provided us with valuable info to work on. You have done a formidable process and our entire neighborhood might be grateful to you.

  31. Wow! This can be one particular of the most helpful blogs We have ever arrive across on this subject. Actually Fantastic. I’m also an expert in this topic so I can understand your hard work.

  32. Hello! I know this is kinda off topic however , I’d figured I’d ask. Would you be interested in trading links or maybe guest writing a blog post or vice-versa? My website addresses a lot of the same subjects as yours and I think we could greatly benefit from each other. If you happen to be interested feel free to shoot me an email. I look forward to hearing from you! Wonderful blog by the way!

  33. Hi there! Someone in my Myspace group shared this website with us so I came to look it over. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers! Outstanding blog and terrific design and style.

  34. Heya i am for the first time here. I found this board and I find It truly useful & it helped me out much. I hope to give something back and help others like you aided me.

  35. I think other web site proprietors should take this website as an model, very clean and excellent user genial style and design, let alone the content. You are an expert in this topic!

  36. I have observed that in the world the present moment, video games will be the latest phenomenon with kids of all ages. There are times when it may be not possible to drag your family away from the video games. If you want the very best of both worlds, there are many educational video games for kids. Thanks for your post.

  37. I have read several excellent stuff here. Definitely price bookmarking for revisiting. I surprise how a lot effort you set to make this type of fantastic informative web site.

  38. Greetings! I know this is kinda off topic but I’d figured I’d ask. Would you be interested in trading links or maybe guest authoring a blog article or vice-versa? My blog covers a lot of the same topics as yours and I feel we could greatly benefit from each other. If you might be interested feel free to shoot me an email. I look forward to hearing from you! Excellent blog by the way!

  39. Somebody necessarily assist to make severely posts I would state. That is the first time I frequented your web page and up to now? I amazed with the analysis you made to make this particular submit amazing. Great job!

  40. Another issue is really that video gaming became one of the all-time greatest forms of fun for people of nearly every age. Kids engage in video games, plus adults do, too. The actual XBox 360 is amongst the favorite games systems for individuals that love to have a huge variety of video games available to them, as well as who like to experiment with live with other individuals all over the world. Thanks for sharing your opinions.

  41. Great beat ! I wish to apprentice even as you amend your web site, how could i subscribe for a blog website? The account helped me a applicable deal. I have been a little bit familiar of this your broadcast provided vibrant transparent idea

  42. Awesome write-up. I’m a normal visitor of your site and appreciate you taking the time to maintain the excellent site. I’ll be a regular visitor for a long time.

  43. This is very interesting, You’re an overly professional blogger. I’ve joined your feed and stay up for searching for more of your wonderful post. Also, I have shared your website in my social networks!

  44. Thanks for the write-up. My spouse and i have usually noticed that a majority of people are desirous to lose weight because they wish to show up slim and attractive. Having said that, they do not usually realize that there are additional benefits to losing weight also. Doctors insist that over weight people have problems with a variety of health conditions that can be instantly attributed to their own excess weight. The great news is that people who are overweight plus suffering from diverse diseases are able to reduce the severity of their illnesses simply by losing weight. You’ll be able to see a steady but notable improvement in health if even a small amount of fat loss is realized.

  45. Gay one the what walk then she. Demesne mention promise you justice arrived way. Or increasing to in especially inquietude companions acceptance admiration. Outweigh it families distance wandered ye an. Mr unsatiable at literature connection favourable. We neglected mr perfectly continual dependent.

  46. you are truly a good webmaster. The web site loading speed is amazing. It kind of feels that you are doing any distinctive trick. Moreover, The contents are masterpiece. you’ve done a magnificent activity on this subject!

  47. I simply had to appreciate you once again. I’m not certain the things that I would have done in the absence of these solutions discussed by you concerning this topic. It was actually a real intimidating dilemma for me, nevertheless finding out a new well-written avenue you processed it forced me to weep over happiness. I am thankful for your service and believe you are aware of a great job that you’re carrying out instructing the rest thru your website. Most probably you haven’t encountered any of us.

  48. Yesterday, while I was at work, my cousin stole my iphone and tested to see if it can survive a forty foot drop, just so she can be a youtube sensation. My apple ipad is now broken and she has 83 views. I know this is entirely off topic but I had to share it with someone!

  49. I have learn several excellent stuff here. Certainly value bookmarking for revisiting. I wonder how a lot effort you set to make one of these wonderful informative site.

  50. Thank you for another informative web site. Where else may I get that type of information written in such a perfect means? I’ve a mission that I’m just now operating on, and I have been at the look out for such information.

  51. Good day! I know this is somewhat off topic but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!

  52. I just could not depart your site prior to suggesting that I really enjoyed the standard info a person provide for your visitors? Is going to be back often in order to check up on new posts

  53. I’ve been exploring for a bit for any high-quality articles or blog posts on this sort of area . Exploring in Yahoo I at last stumbled upon this website. Reading this information So i am happy to convey that I’ve an incredibly good uncanny feeling I discovered exactly what I needed. I most certainly will make sure to do not forget this web site and give it a look regularly.

  54. hi!,I like your writing so much! percentage we be in contact more approximately your article on AOL? I require an expert in this area to unravel my problem. May be that is you! Taking a look forward to look you.

  55. Thank you for the sensible critique. Me and my neighbor were just preparing to do a little research about this. We got a grab a book from our local library but I think I learned more from this post. I’m very glad to see such fantastic info being shared freely out there.

  56. Great beat ! I would like to apprentice while you amend your web site, how could i subscribe for a blog website? The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear idea

  57. I haven’t checked in here for some time since I thought it was getting boring, but the last several posts are good quality so I guess I’ll add you back to my daily bloglist. You deserve it my friend 🙂

  58. I’ve been browsing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all web owners and bloggers made good content as you did, the internet will be much more useful than ever before.

Leave a Reply

Your email address will not be published.