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/CAKgW%3D6%2BLkPx8YoXZzyj3r%2BfvVEtkT8BDPp%2BQmo%2Bx4Xedc_69%2Bg%40mail.gmail.com.
