I found out recently that the C preprocessor has a feature called
"Line Control" https://gcc.gnu.org/onlinedocs/cpp/Line-Control.html

If the code is generated from a python file, then this could be used to
indicate where from which line in this python file the code came from.

This is how other preprocessors including f2c handle this situation.

Christian

On 17.01.20 18:15, Aaron Meurer wrote:
I haven't thought of this before. I think one could add support for
it. It would require adding some bookkeeping to the code printers.

Another idea would be to wrap expressions with some function that
codegens into no-op backreferences.

Finally, we could codegen comments giving the str() form of an
expression above each line of code.

Aaron Meurer

On Fri, Jan 17, 2020 at 5:12 AM Christian Friedl
<[email protected]> wrote:

Hello everyone!

Introduction
===
Here is a short introduction as suggested by
https://github.com/sympy/sympy/wiki/Introduction-to-contributing

- level of familiarity with python
Somewhat, mostly for small personal projects.

- mathematical education level
Msc.

- particular expertise
Physics.

- level of familiarity with symbolic math systems
Somewhat. Tried some, got frustrated, resorted to pen and paper. Tried
again when using a lot of paper got even more frustrating.

- your familiarity with SymPy
I used it mostly to solve small examples (e.g. tedious integrals) or
calculating derivatives of complicated expressions.
===
Question about codegen

When debugging generated code it is often not immediately clear, what
part of a symbolic sympy expression is responsible for which line of
C/Fortran code. This is a problem that basically all compiled/transpiled
languages have. In compilers this is solved by annotating "debugging
symbols", in javascript transpilers there are so called "source maps"
that allow to track what part of the expression written is actually
executed. Is there a similar annotating functionality in the 'codegen'
module? Can anybody think of a way to do the annotating manually?

Kind regards,
Christian

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/a3f18892-66a2-80f5-b2aa-e1167c99ceaa%40gmx.at.


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/5d7c6fe4-71df-8740-04eb-43c8659ea3ad%40gmx.at.

Reply via email to