JavaScript Maths Abilitity

Can I ask why you need to implement it in Javascript first? Why can't you pass it via JSP or whatever Java / C++/ C / Fortran?

It's basically for a Firefox extension.

I do have the option of using XPCOM C++ components and invoking them from the JavaScript, but if I can do everything in JavaScript that would reduce the complexity and increase the portability for the project as a whole.

Is it a really bad idea trying to do it in JavaScript?
 
Looking (briefly) at what your trying to implement I think you should be able to suffice with Java scripts but it won't be pretty or fast. I'd wait for more javascript gurus as I don't use it at all for anything numerically complex. Good luck all the same :)
 
Neither are particularly complicated to implement, nor are they taxing to calculate individually (no recursion or anything nasty like that). I've gone as far as doing some basic linear algebra in javascript, then got bored writing it myself and started searching for opensource implementations of whatever I was after.

Reed-Solomon in Java: http://sourceforge.jp/projects/reed...on/RsEncode.java?view=markup&root=reedsolomon

The Lagrange wiki article goes as far as a c++ implementation which looks quite easy to convert to javascript.

:)

[edit: wishful thinking as far as multi-threading in javascript is concerned. How many of these calcs do you want to do, and what's a reasonable response time?]
 
Last edited:
Thanks, I will need to use Lagrange Interpolation on about 65000 polynomials. Then I will need to use Reed Solomon to create error correction data for about 500kb-1mb of data.

If possible my aim is to do it all without disrupting the Firefox UI responsiveness. Might be tricky with no multi threading :(
 
Thanks, I will need to use Lagrange Interpolation on about 65000 polynomials. Then I will need to use Reed Solomon to create error correction data for about 500kb-1mb of data.

If possible my aim is to do it all without disrupting the Firefox UI responsiveness. Might be tricky with no multi threading :(

hmmm, that's quite a lot. There's no way you'd be able to do that in javascript and still keep the browser responsive. Much better to write a library and/or use a RESTful service of some sort to do the calculation.
 
Back
Top Bottom