Subj : Re: Creating classes/namespaces on the fly from existing functions? To : netscape.public.mozilla.jseng From : Shanti Rao Date : Wed Jan 12 2005 10:41 am Bubbfree brings up the idea of a system that loads source code from a database, rather than from souce code. IBM VisualAge did something like that, and JS2's package system seems to anticipate the desire. I suspect that several people on this list are designing development environments to do just that, and that's why we see so many requests for source code validation from SpiderMonkey. One of VisualAge's features was the ability for you to edit a function, but for your changes not to affect anyone else until your code had successfully compiled and passed a few tests. Version numbers were tracked for each function, and you could compile a binary with any combination of functions of different ages. Since the SpiderMonkey APIs are so easy to use, you can do a lot of that with JS1.5, only using functions instead of directives. The import directive becomes an import function, the package directive is unnecessary, and objects are a substitute for namespaces. (A threading system isn't necessary, but it's really useful, so embedders frequently make one.) I mention this because, there's a great diversity among the JS implementations. Code written for jsolait's object model will be unlikely to run on JSDB. A Synchro.net module wouldn't load into egachine. Code written for XPCOM is tied pretty strongly to XPCOM. That's not necessarily bad, since the people who use these projects probably are unaware of each others' existance. And having many different SM embeddings is a way to apply natural selection to the language development. Consider, for example, the various networking implementations. Is it better to have bindings for socket functions or to have an abstract stream object? Or files. Would you rather have a File.open() function or a new File() object? So, all you embedders out there, what kind of source-code-management system are you hoping to add to your JS system? 1. File-based packages like Perl 2. Hierarchical file-based-packages like Java and the JS2 spec 3. Function-level versions like VisualAge 4. Files without packages 5. Files with namespaces 6. Other? Shanti .