Am 03.10.2013 19:40, schrieb F. B.:
On Thursday, October 3, 2013 9:50:05 AM UTC+2, Joachim Durchholz wrote:
... that's giving me a thought though: Maybe it's a good idea to make a
Sympy-to-whatever-language translation. On Jython, a C++ library just
doesn't make sense, but it would allow experimentation with different
languages.
That would be an enormous amount of time. It's just hard to make a Python
to C++ translator, I wouldn't imagine a translator to any language.
Ondrej said he'd have to rewrite the algorithm in C++, so the way he
envisions doing it won't work that way anyway.
But then if an automated translation does give a useful amount of
speed-up without incurring the cost of a manual rewrite, it would still
be a net win.
Besides, it is a very annoying task, you have to parse AST and define a
generic format, maybe even some translation stages.
In essence, it would be a translator from Python to other languages.
If the classes do not have their lists of attributes modified at
runtime, this is actually not too hard to do. Sympy isn't there, but
it's heading that way, so this might be an option.
It would be a considerable amount of up-front work, with no guarantees
of the outcome; Ondrej's approach is more incremental, he can
cherry-pick those cases that work best; I suspect in the end, his
approach will work better for some specialized cases and the generalized
approach will work better for speeding up Sympy in general (and on
platforms where C++ isn't really accessible).
The two approaches aren't mutually exclusive and could be combined.
> Unless you mean to try
some artificial intelligence approaches, such as translating some example
files and make the translator learn how to do it on the remainder of the
code.
Nah, AI is too unpredictable in when it will work and when not.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.