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 runner (and all the tests, for that matter), and lambdify.py (which probably won't be useful to you). This mainly leaves the parser, which you'll probably want. I think you could replicate the above code using __import__ (I'm not sure what the exact code would look like at the moment). Also, is eval() supported? I'm assuming not, since it's basically the same as exec. This is a little harder to find by grepping, since we have a lot of methods called eval, but I think there aren't really any important ones (i.e., ones that you can't just remove file for). By the way, could you perhaps push your refactoring up to a branch at GitHub? It likely won't be merged (unless there are no side effects from it), but I think it would still be interesting for people to see what you needed to do, and perhaps it would help others who may want to get it to run in pyjamas. Aaron Meurer On Fri, Sep 23, 2011 at 11:16 AM, dennis <[email protected]> wrote: > I have refactored some sympy code which has caused errors when > converting with pyjamas but it seems that i need to refactor all exec > calls. Pyjamas does not support exec calls. > > Can someone of the dev team say how much effort it would need to > refactor all exec statements? > > > On 22 Sep., 21:40, dennis <[email protected]> wrote: >> Hi, >> >> Is there a way to compile sympy to javascript using pyjamas or another py/js >> compiler? >> >> Pyjamas states that it could compile pure python projects, but I get an >> error when I try compiling sympy with it. >> (Translating: core/facts.py [...] AttributeError:AssTuple instance has no >> attribute 'name') >> >> Any ideas? > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
