Sorry Attila, I forgot I still owe you an answer... On Feb 3, 6:39 pm, Attila Szegedi <[email protected]> wrote: > On 2010.02.03., at 17:52, Hannes Wallnoefer wrote: > > > Other than that, I really like your implementation. Helma NG does a > > few things differently, so it's not likely we'll replace our > > implementation anytime soon, but I think I'll take some inspiration > > from your code for things it does better than ours. > > :-) > > Is there a way to reconcile the differences? I tried to follow Modules/1.1 to > the letter... Also, maybe your implementation is doing something better than > mine does, in which case it wouldn't be bad if I'd get some inspiration the > other way :-) >
I put a lot of work and thought into the design of Helma NG (which we're currently relaunching as RingoJS). As a result, it is a bit farther away from the "classical" JS shell, but there are some very tangible benefits. For example, module scopes are top level scopes in HNG/RingoJS. This gives as complete module isolation even with a shared "classical" global scope. Also, the require() function in Helma NG is shared among multiple contexts and threads, and we're using a threadlocal to keep maps of loaded modules per cx/thread. This gives us a lot of flexibility. For example, while modules are instantiated per context/thread by default, modules can opt to have one instance shared among all threads simply by setting a flag in their module meta-object, giving us optionally multithreaded modules. There's also completely transparent reloading of modules that takes care of module dependencies for shared modules. To sum it up, HNG/RingoJS aims a bit farther away from the typical JS shell/runtime. That's why I think it should remain a dedicated project (I've also thought about proposing our module loader for inclusion in Rhino at certain times). But I also think your implementation makes perfect sense to be included in Rhino for more "conservative" CommonJS runtimes. Hannes _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
