Tim Lahey wrote:
> On Jul 2, 2009, at 11:12 PM, Andy Ray Terrel wrote:
>> * I don't like the repeating of many of functions that ccode has as well.
>> It seems that we could have a low level code generator that is general
>> enough to abstract many things, such as printing the implicit functions and
>> constant values.  For example print pow, some special functions and
>> constants. This is probably a whole new issue though not something to stop
>> the code from being pushed.

I'm all in favor of a LowLevelCodePrinter. I just did fcode first to have an
empty playground. I would also suggest a BasicStrPrinter between Printer and
StrPrinter, which does no more than +, -, *, /, ** and brackets. Such a
BasicStrPrinter would also serve as a good base class the LowLevelCodePrinter.

> Maple's code generator converts to an intermediate format and then is
> converted to the final form. That may be an idea if multiple languages are
> going to be supported. That way, some common procedures can be done and then
> the language specific forms/optimizations can be done after.

With the intermediate format, do you mean a string format, or a full blown data
structure? The latter approach is followed in sympy/utilities/codegen.py, but
I'm not sure if it is also good for the individual expressions? Such a data
structure would overlap a lot with the data structure for sympy expressions.

> Like Andy says, it's not a reason to stop the code, but it's a possibility 
> since things like MATLAB/Octave or Scilab could be other possible outputs.

Thanks for the suggestion. It's on the idea list.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

begin:vcard
fn:Toon Verstraelen
n:Verstraelen;Toon
org:Ghent University;Center for Molecular Modeling
adr:;;Proeftuinstraat 86;Ghent;;9000;Belgium
email;internet:[email protected]
title:ir.
tel;work:+32 (0) 9 264 65 56
tel;home:+32 (0) 9 351 56 05
x-mozilla-html:FALSE
url:http://molmod.ugent.be
version:2.1
end:vcard

Reply via email to