|
I have some _javascript_ data structures (i.e. JSON) that I’d like a Laszlo program to be able to efficiently download. Essentially I’d like to do the same kind of thing as what happens when you fetch a SWF encoded XML file, except that it’s JSON instead of XML. Is there a simple way to wrap a JSON object up so the Laszlo compiler will make it into a SWF file that you can dynamically download into a running Laszlo app, and execute to get the raw _javascript_ data (instead of cooked _javascript_ data representing XML)?
The reason I don’t want to simply represent the data as XML and then load it into Laszlo the normal way (having the server compile the XML into SWF), is that there’s a whole lot of data and it would fluff up a lot of it were represented as XML represented as _javascript_ objects, so I just want to send the raw simple _javascript_ objects instead. Plus I want this to be compatible with web browser _javascript_ interpreters that can read and process JSON much more efficiently than XML.
The application: I’m working on a Relax NG engine in _javascript_, for validation and data binding, and I’d like to be able to run the core _javascript_ Relax NG engine code in Laszlo as well as the web browser.
So that the code running in the browser can be as simple and efficient as possible, the server will compile the Relax NG schema into a normalized optimized JSON representation. I’m using a James Clark’s “jing” for compiling the Relax NG schema, and writing out its internal optimized data structures.
Relax NG is wicked cool! I love the way the Laszlo compiler uses a Relax NG schema with annotations to define the syntax and some semantics of the programming language.
I’d be interested to hear more about what the Laszlo compiler developers (and other people) think of Relax NG, how they’re using it, and what tools are used to process it!
Relax NG Compact Syntax: no to operator precedence, yes to annotations! http://www.donhopkins.com/drupal/node/115
Relax NG: Design-by-Inspired-Individuals vs. Design-by-Committee http://www.donhopkins.com/drupal/node/116
Maximizing Composability and Relax NG Trivia http://www.donhopkins.com/drupal/node/117
-Don
|
_______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
