Ok. Re-reading my original post on "JS context serialization" I believe it may have been too rambling. Let me try to be more concise.
In a web browser, Javascript runs interactively. When you first reach a page, javascript starts up and js files get loaded, functions get defined, etc. You create an environment. Next, the user interacts with that environment. They click a button, they type in some text. The environment records what they do and it reacts to the user. The environment slowly changes over time. In theory, using JavaScript.pm we should be able to do this server side too. We should be able to re-use a majority of our client side javascript code and pretend the server is a very slow part of the client. This is faboo for handicapped web browsers like Konquerer. But there is one major hurdle. When the client accesses a server side page, JavaScript.pm starts up. Js files get loaded, functions get defined. We have a new environment, just like in client side. Except.... Once we pass control back to the client we are in trouble. When the client presses a button or enters some text it emits a brand new page request to the server, and there is no way we can still have the "environment" we created the first time around ready to handle the user's request. The environment cannot survive from one page load to the next. It cannot be stateful. What we need is a way to "serialize" an environment. That is just a fancy way of saying we freeze dry the entire Javascript universe we created into a string so it can be stored into a database for future retrieval. Then, we "unserialize" or thaw out the data on the next page request from the same user. Does Javascript.pm have a way to serialize and unserialize an entire context, for this and similar uses? Thanks. :) - - Jesse Thompson http://www.webformix.com/
