JUL
Why JavaScript?
One of the interesting and different things about 10gen is that its first supported language is JavaScript. Most of our libraries are in JavaScript, and a lot of the system itself is in JavaScript. So, why did we decide to use JavaScript instead of one of the other popular server side languages (Ruby or Python)?
- One of the big reasons I like using JavaScript on the server is that you already have to use JavaScript on the client. You can now write a class once, use it for the client, server, and even with our database. No having to marshal between python/ruby and JavaScript, and then into sql. Just one representation for all of your objects from front to back.
- JavaScript is dynamically typed, has lambda expressions, and many of the other features that people are getting excited about in the scripting world. The biggest difference between JavaScript and the other languages is that its prototype based. (a good inheritance example) Using prototypes for inheritance is a bit different than people are used to, but is actually quite powerful. JavaScript 2, which should be out this year, will also support more standard classes.
- An assumption about JavaScript is that it is slow. We saw no reason why javascript should be slow, so set out to create a really fast JavaScript system. What we did to solve it was to write a JavaScript to java compiler, which then is able to leverage javac and java's jit engine. Our JavaScript system is about 3-4 times faster than rhino or spider monkey.
While JavaScript is the first language that 10gen supports, we will be adding other languages shortly. Ruby will be available this year, and python should follow that. We're also going to let you include java code in your applications when we get to it or demand is high.
Since JavaScript is only our first language and we will be supporting others, and I wouldn't want you to think that I don't think JavaScript has faults, stay tuned for the next article on problems with JavaScript.

Comments
synodinos
10 reasons why Javascript is the ultimate scripting language:
http://synodinos.net/2007/06/18/10-reasons-why-javascript-is-the-ultimate-scripting-language/
Aaron Iba
Though I suppose 10gen would be classified as a competitor to my company (AppJet), I have to wholeheartedly agree that server-side JavaScript is the right language to choose in this case.
Joshua Paine
I do much of my coding in server-side JavaScript these days as well, via Helma. Are you building on top of Rhino? How much of JavaScript do you support?
dwight
@Aaron -- One thing to keep in mind is that 10gen is open source: if you want to reuse any pieces, that is possible, subject to the license details of course. We want as much collaboration occurring as possible among the startups in the space, please contact us if there are things we can work together on.
Eliot Horowitz
@Joshua - We are using the Rhino parser, but have written our own javascript to java converter, and then using javac to compile the java source. We've found our JavaScript implementation to be 3-4 times faster than Rhino. We fully support JavaScript except what is listed here: http://www.10gen.com/wiki/unimplemented We'll be working on finishing everything in the near future as well.
Joshua Paine
Eliot, thanks for the info. What about E4X? I know it's not core JS, but it's awfully handy for web apps and I've gotten quite attached to it.
Arek
Why not adding support for Java now if you compile JS into Java bytecode anyway?
dwight
@Arek - This is under consideration. One question is, do people want to build websites in Java today, or do that want more of a rapid prototyping style language? What are your thoughts?
At a minimum, support for Java libraries makes lots of sense.
Eliot Horowitz
@joshua - ex4 is interesting, hadn't looked at it too much. very easy for us to add since we're using the rhino parser. will add it to the list.
barspi
I think Groovy would be just as good a choice for a language (modulo your point about using the same language for server and client).
In fact, making your platform (especially the mongo db) integrate with Grails would be awesome :-)