We got a bunch of invaluable feedback by releasing msjs under open source and showing it to a few people. A lot of people simply don’t get it. It’s very different from how people are currently thinking about building AJAX apps, so I understand that to make it broadly useful, we’d have to do more to explain why msjs works the way it does.
But after taking a closer look at the awesome node.js project, I also realized that we made a big mistake in the design of msjs. I think we took a wrong turn when we based our design on the servlet model that treats each server request as a separate process running in its own thread. Node has this dead right, and everyone else gets it wrong: the default should be to have a single thread of execution and to model individual requests as data passing through that single program. I have some ideas about how to adapt a few of the ideas in msjs to this kind of architecture.
I was also surprised and disappointed to find that V8, and the JS community in general, has abandoned the idea of E4X. While I agree that a lot of the E4X syntax is awful, I found it really useful to embed XML literals in my code, and to invert the usual relationships between code and templates. A more compatible version of msjs would have to use separate templates for its HTML, as sad as I’d be to lose that feature.
The final bit of feedback we got was around our use of closures. A big part of what msjs does is about preserving function environments and moving them from the server to the client, and I got mixed reactions to this. The Java programmers really liked the simplicity and elegance. The JS folks, who are struggling with these issues, didn’t like our reliance on a non-standard MOP call to gather that info. The consensus among the JS web frameworks appears to be that even though the server code and the client code are written in the same language, they don’t really overlap, or even touch. Functions get moved from the server to the client essentially as strings.
I just can’t accept that. We need to be able to think of these client-server apps as a single program with multiple entry points. I have some thoughts on how to do this, but I’m taking a break for the moment. I’m working on a business deal that I hope to be able to announce soon.