Re: [sympy] Re: Convert sympy to javascript

2014-01-11 Thread F. B.
On Saturday, January 11, 2014 2:13:38 AM UTC+1, Aaron Meurer wrote: In Chrome, I get 0.55566757; in Firefox I get 2.4737711. I also tried Safai 7.0.1 (I get 4.6381144) and Opera because you mentioned it (version 12.16, I get 4.4440572). So maybe Chrome beta already has

Re: [sympy] Re: Convert sympy to javascript

2014-01-11 Thread F. B.
On Saturday, January 11, 2014 2:49:16 AM UTC+1, David Li wrote: @F.B. have you managed to compile Python using Emscripten? I tried but could not get the interpreter working, it just hung/crashed if I tried to bundle the standard library and complained about site.py otherwise. No, I

Re: [sympy] Re: Convert sympy to javascript

2014-01-10 Thread F. B.
On Sunday, November 17, 2013 8:04:49 PM UTC+1, David Li wrote: There's also the more speculative ideas of using Emscripten (example: http://repl.it/M4whttp://www.google.com/url?q=http%3A%2F%2Frepl.it%2FM4wsa=Dsntz=1usg=AFQjCNEx9nyndaK2q6euf6S3HplhrWmtSQ) or Portable Native Client to

Re: [sympy] Re: Convert sympy to javascript

2014-01-10 Thread Aaron Meurer
On Fri, Jan 10, 2014 at 2:57 PM, F. B. franz.bona...@gmail.com wrote: On Sunday, November 17, 2013 8:04:49 PM UTC+1, David Li wrote: There's also the more speculative ideas of using Emscripten (example: http://repl.it/M4w) or Portable Native Client to compile the Python interpreter to

Re: [sympy] Re: Convert sympy to javascript

2014-01-10 Thread David Li
I think the asm.js optimizations do make a difference when used; see a benchmark of a physics engine ported with Emscripten: http://josephg.com/blog/chipmunkjs-and-emscripten (though it's a bit outdated). Regardless, if Emscripten is too slow in Chrome we can fall back on Native Client (and

Re: [sympy] Re: Convert sympy to javascript

2013-11-17 Thread David Li
There's also the more speculative ideas of using Emscripten (example: http://repl.it/M4w) or Portable Native Client to compile the Python interpreter to JavaScript, then using that to run SymPy. David On Wednesday, November 13, 2013 11:45:04 AM UTC-7, Aaron Meurer wrote: Unless there is a

Re: [sympy] Re: Convert sympy to javascript

2013-11-14 Thread Vinzent Steinberg
I don't know of anyone trying to get SymPy to run there, but there are Skulpt [1] and Brython [2], which implement Python on top of Javascript. Pyjs [3] translates Python to Javascript. There are also approaches using PyPy, see for instance [4]. I have no Idea how much work it is to run SymPy

[sympy] Re: Convert sympy to javascript

2013-11-13 Thread Buck Shlegeris
So how much effort and time do you think it would take to make this conversion work? I'd really like to use SymPy for a JS project -- currently, there's no Javascript CAS worth the name. If a few hours would possibly be able to get this to work, my team would have a go. Buck On Monday, May

Re: [sympy] Re: Convert sympy to javascript

2013-11-13 Thread Aaron Meurer
Unless there is a *complete* Python to Javascript converter, or a *full* Python interpreter in JS (I know of neither, but I don't do much with Javascript), I wouldn't hold out much hope. I put complete and full in stars, because SymPy really uses every corner of the Python language. Anything that

[sympy] Re: Convert sympy to javascript

2013-05-13 Thread Antony Shaleynikov
Dennis, is it possible to take a look at the result you get? I'm pretty interested in SymPy running at browser as well. Antony воскресенье, 12 мая 2013 г., 19:21:12 UTC+3 пользователь dennis написал: Hi James I did succeed in converting sympy to javascript. I ended up having some of the

[sympy] Re: Convert sympy to javascript

2013-05-13 Thread dennis
I am sorry, I do not have the original / converted source code anymore. On Monday, May 13, 2013 1:55:35 PM UTC+2, Antony Shaleynikov wrote: Dennis, is it possible to take a look at the result you get? I'm pretty interested in SymPy running at browser as well. Antony воскресенье, 12 мая

[sympy] Re: Convert sympy to javascript

2013-05-12 Thread dennis
Hi James I did succeed in converting sympy to javascript. I ended up having some of the sympy core converted and loaded in the browser without syntax errors, but it did not work properly. On Friday, May 10, 2013 11:05:51 AM UTC+2, James wrote: Hi Dennis Sorry to revive an old thread, but I

[sympy] Re: Convert sympy to javascript

2013-05-10 Thread James
Hi Dennis Sorry to revive an old thread, but I am also looking into compiling sympy to javascript (also only the basic math) - did you have success? On Saturday, September 24, 2011 4:48:57 PM UTC+3, dennis wrote: You are right, I don't need to convert the whole project. What I need for my

Re: [sympy] Re: Convert sympy to javascript

2013-05-10 Thread Aaron Meurer
SymPy now has a javascript code printer. It's called jscode() In [39]: jscode(sin(x) + sqrt(2) - x**2) Out[39]: -Math.pow(x, 2) + Math.sin(x) + Math.sqrt(2) Aaron Meurer On Fri, May 10, 2013 at 3:05 AM, James ift...@gmail.com wrote: Hi Dennis Sorry to revive an old thread, but I am also

Re: [sympy] Re: Convert sympy to javascript

2013-05-10 Thread Matthew Rocklin
Great! On Fri, May 10, 2013 at 1:42 PM, Aaron Meurer asmeu...@gmail.com wrote: SymPy now has a javascript code printer. It's called jscode() In [39]: jscode(sin(x) + sqrt(2) - x**2) Out[39]: -Math.pow(x, 2) + Math.sin(x) + Math.sqrt(2) Aaron Meurer On Fri, May 10, 2013 at 3:05 AM,

[sympy] Re: Convert sympy to javascript

2011-09-24 Thread dennis
You are right, I don't need to convert the whole project. What I need for my current project is some school math (deriving/integrating/solving functions like x^2, x^3-3x+2, sin(x), log(x) etc.). I don't need most of the other code e.g. plotting. So before refactoring the code I should probably

Re: [sympy] Re: Convert sympy to javascript

2011-09-24 Thread Aaron Meurer
You will probably need the core, functions, solvers (or at least the parts of solvers that you want to support), and integration. You'll aslo probably want the parsing module, as I noted. You will actually find that the modules are more interlinked than you might expect. For example, the

Re: [sympy] Re: Convert sympy to javascript

2011-09-23 Thread Aaron Meurer
Are you trying to convert all of SymPy, or just a reduced version (e.g., just the core)? I used git grep 'exec ' on the repo to find all the statements. It looks like your main problems are lines like exec from sympy import * in global_dict You may want to just skip some files, such as the test