Serving the Quantitative Finance Community

 
User avatar
attesaarela
Topic Author
Posts: 0
Joined: November 10th, 2006, 6:06 pm

Curious about Javascript

September 11th, 2008, 11:58 am

Has anybody tried how fast the new Javascript can run quant code? Before I get laughed out of the door, let me just remark, that Javascript is actually pretty close to Matlab as a language, and using Matlab isn't considered ridiculous. So the reason you'd see the first sentence as ridiculous is really that the primary application domain of Javascript is web coding at the moment. But back to the topic. What I'm really curious about is whether the new Javascript interpreter might actually run some scripts faster than Matlab right now if you just translated them into it.. I think I need to just try it myself.
 
User avatar
ArifJaffer
Posts: 0
Joined: June 24th, 2008, 9:45 pm

Curious about Javascript

September 11th, 2008, 2:00 pm

JavaScript itself is probably not going to be super-fast as it is wholly dependent on the browser being efficient, as well as which browser you use. If you are looking at Java script one piece of advice I can give having learnt the hard way is that you should definitely look at Ajax as it allows your code to be more efficient. Also you need to tie yourself to a browser early one as different browsers implement JS different ways.
 
User avatar
farmer
Posts: 63
Joined: December 16th, 2002, 7:09 am

Curious about Javascript

September 12th, 2008, 10:27 pm

QuoteOriginally posted by: attesaarelaJavascript is actually pretty close to Matlab as a languageECMA script is very easy to convert to all the C-like languages. You can get 99.5% of the way with a few clever search-replaces.
Antonin Scalia Library http://antoninscalia.com
 
User avatar
yuryr
Posts: 0
Joined: November 5th, 2007, 12:47 pm

Curious about Javascript

September 13th, 2008, 12:39 pm

You have plenty of algorithms implemented in mathlab. Now you want to run calculations in JS? What support does it have for matrices, Monte-Carlo etc...?
 
User avatar
attesaarela
Topic Author
Posts: 0
Joined: November 10th, 2006, 6:06 pm

Curious about Javascript

September 13th, 2008, 1:09 pm

QuoteOriginally posted by: yuryrYou have plenty of algorithms implemented in mathlab. Now you want to run calculations in JS? What support does it have for matrices, Monte-Carlo etc...?All the new JIT compiler research that has now been applied to Javascript is very interesting, I was just curious about the current performance of that..
Last edited by attesaarela on September 12th, 2008, 10:00 pm, edited 1 time in total.
 
User avatar
spmacdonald
Posts: 0
Joined: February 18th, 2008, 5:42 pm

Curious about Javascript

September 15th, 2008, 1:54 am

You may be interested in Steve Yegge's blog:http://steve-yegge.blogspot.com/I know some fairly prominent googlers are into JavaScript... Norvig included.What do you think about F#?
 
User avatar
attesaarela
Topic Author
Posts: 0
Joined: November 10th, 2006, 6:06 pm

Curious about Javascript

September 15th, 2008, 6:33 pm

QuoteOriginally posted by: spmacdonaldYou may be interested in Steve Yegge's blog:http://steve-yegge.blogspot.com/Yes, brilliant stuffQuoteI know some fairly prominent googlers are into JavaScript... Norvig included.What do you think about F#?I'm really interested in dynamically typed languages at the moment, like Matlab, which make it really easy to develop small applications quickly..F# is a great language, but it is statically typed which means it may not be quite as convenient as eg Matlab for some things.. It really is possible that, like Steve Yegge says, many dynamically typed languages are going to get a lot faster soon when the new optimization techniques become more widely known..
 
User avatar
spmacdonald
Posts: 0
Joined: February 18th, 2008, 5:42 pm

Curious about Javascript

September 15th, 2008, 7:25 pm

While you are correct in saying F# is statically typed, that is not the whole story (note, I do not pretend to know the whole story either... from the faq:One of the striking features of F# is its combination of dynamic and static features. For example, F# Interactive provides a strikingly powerful dynamic compilation environment, where dynamically entered code is executed using the full performance power of high-quality native code. I have played with this a bit, and it really is _very_ useful. Essentially you now have a REPL environment to write .NET code in... amazing stuffI have used matlab for years, and still do daily... but the more I learn about C#/F#/Python the less I like using matlab... just my 2 cents