Well, most languages have better support for libraries than C or C++. But there are things that even C has and JS<2 doesn't: * #include * a linker * a somewhat standard manner of distributing these libraries (.a or .so) * arguably, a [not necessarily hacker-proof] mechanism for sharing symbols between several components without exposing them to the client.
Note that I'm not attempting to advocate the merits of #include, which I find rather ugly. I also have no idea whether the linker is part of the spec or not -- but then, I wasn't discussing specs, more developer experience, and linkers have been part of the standard package for as long as I've been programming. Now, with JS<2, to get something linke #include + linking (or Java's import), you need to use somewhat more convoluted methods. In addition, all the techniques I have seen require some hard-wiring inside the document, which may be good for small webpages, but looks like a rather bad practice when you're talking about whole applications: essentially, this is equivalent to putting all your #includes inside the UI code. Finally, while the methods may work in a webpage, not all of them apply well to non-web JS -- I'm thinking about off-line extensions, XPCOM or server-side JS. This strikes me as a good reason to improve library management in JS. Which was the case last time I looked at ES4, although I may have missed a few developments on that front. Cheers, David On Thu, 2008-03-27 at 10:30 -0400, Mike Shaver wrote: > I don't quite understand this -- could you give an example of a > language that has better support for libraries as part of its language > specification? I don't think the C specification includes linking (or > even the ABI, though C++ grew an ABI specification later), so it seems > to be about at the same point of "get your code into scope somehow". > Browsers use <script> for that, and many an AJAX toolkit has added new > capabilities to the environment through just that means. > > Mike > -- David Teller Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller Angry researcher: French Universities need reforms, but the LRU act brings liquidations. _______________________________________________ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss