Posts

Showing posts from July, 2007

lab 79 - acme javascript

Image
NAME lab 79 - acme javascript NOTES I'm excited about today's lab. I hope others pick up on this and experiment with it because I think some cool acme clients would come of it. The idea behind this lab is to mix together acme, javascript and json web services. I've been poking around at inferno's javascript, hoping to improve it. The best way of doing that is to start using it more heavily. In earlier labs I created a tool called js that ran javascript scripts outside of charon. But without knowing what set of host objects to build it has languished. Looking to use javascript more, I've been taking another look at web services APIs, and noticing that JSON is getting strong support, especially from Google and Yahoo. I'm pleased about this, since the SOAP stuff looked so horrid. So I really want to pull JSON web services into inferno using javascript. But web services don't work too well when text is just output to the command line, they need more ...

lab 78 - dynamic dispatch

NAME lab 78 - dynamic dispatch NOTES While experimenting with creating my own alphabet-like interfaces I found this technique, which I think is fascinating, and I hope to use it soon in further experiments with persistent mounts, something I'll blog about in the future. Here's a definition of a pick ADT that has some primitive types (I've left out the complete set to keep it short), and some helper functions to get the value from the pick. Value: adt { getfd: fn(v: self ref Value): ref Sys->FD; gets: fn(v: self ref Value): string; send: fn(v: self ref Value, r: ref Value); pick { S => i: string; F => i: ref Sys->FD; O => i: chan of ref Value; } }; The thing to notice here is the recursive definition of the ADT. We don't need to define chan of string or chan of FD. The Value.O type is a channel that can handle anything of ref Value, all our primitive types including ... chan of ref Value. So given a v : ref Value, we'd get, sa...