News for hackers. Stuff that matters.
Re:Javascript: A Language in Search of a Standard Library an... by btilly on Thursday February 25, 2010 @02:08AM (#1150196)
I don't care about the lack of a standard library. I care about the lack of an equivalent to CPAN.

For instance a couple of years ago I ported Statistics::Distributions from Perl to JavaScript. I looked for a place to put it. Nobody could suggest any place for a random piece of code like that. Eventually I stuck it on http://code.google.com/p/statistics-distributions-js/. I doubt that anyone has ever looked for it there or found it. And the need is so specialized that it doesn't make sense to try to get a user base.

I doubt anyone has ever found it there. If they did it is probably because Ohloh picked it up.

Re:Javascript: A Language in Search of a Standard Library an... by wvenable on Thursday February 25, 2010 @02:15AM (#1150200)
Isn't that putting the cart before the house. JavaScript has no standard way of importing/using libraries -- that seems like a prerequisite for something like CPAN. Otherwise instead of an organized repository of libraries, you just have a bunch of code.
Re:Javascript: A Language in Search of a Standard Library an... by btilly on Thursday February 25, 2010 @02:21AM (#1150209)
JavaScript has no standard way for one library to include another. But it is very easy to insert a library into a web page.

The code I ported is a standalone library that can be imported into a web page and then its functions can be called. There is a lot of useful code that looks like that. It is a shame that there is no standard bit bucket that you can put it in.

Re:Javascript: A Language in Search of a Standard Library an... by demallien on Thursday February 25, 2010 @04:02AM (#1150319)
Yes, but here's the problem. I am using JavaScript outside of the browser on a project at the moment. I want to use your library, but your library directly loads a dependency, by trying to load a webpage. My JavaScript motor doesn't know how to load webpages, so now I can't use your library. On the other hand, if we had a standard call for loading libraries, each implementation could do as it needs - web browsers could try to load the code from a known repository on the current page's server. Embedded JavaScript and server-side JavaScript could load from a known repository, or from a repository specified at the launch of the JavaScript session. And we could all specify our dependencies in a clean manner that would be transportable.
Re:Javascript: A Language in Search of a Standard Library an... by btilly on Thursday February 25, 2010 @07:39AM (#1150540)
I feel like you are not responding to what I wrote.

My statement is that having a widely known repository is still useful for random libraries which are simple enough to not have dependencies. I completely agree that having a standard way of loading dependencies would make such a thing much more useful still, but it still has utility without that.

Seriously, if you need to be able to calculate several standard probability distributions to 5 digits of precision in JavaScript, you can do it today with the library that I ported. Either embedded or server side. Doesn't matter. Go ahead and use it. (If GPL/Artistic doesn't work for you then I'm sorry. I can't grant a more generous license than the Perl version I started with.)

Re:Javascript: A Language in Search of a Standard Library an... by Zef on Thursday February 25, 2010 @03:29AM (#1150286)
In my post I link to JSAN, which is exactly that: http://openjsan.org

It has its own module system.

Re:Javascript: A Language in Search of a Standard Library an... by btilly on Thursday February 25, 2010 @07:28AM (#1150526)
At the time I created that library, JSAN was a dead site. There were rumors that it would be revived some day, but it hadn't happened.