On Wed, Mar 2, 2016 at 1:25 AM, Tanu Hari Dixit <[email protected]> wrote: > Hello all, > > I am a GSoC aspirant and I want to work on the Code Generation module as a > project this year. > > I had a few questions in mind and needed help regarding them. > > 1) It is mentioned on the ideas page that the codegen module needs an > overhaul. What kind of an overhaul would that be? Is the change needed in > the API or friendly functions: codegen and make_routine? > > 2) I read this discussion and construed that we need to make efforts to > include CSE in the codegen module and we are aiming at making an optimizing > compiler. > This optimizing compiler should be domain unspecific and work for most > general cases. Bjorn Dahlgren suggested that we should be using a templating > engine. Is this the work that is needed to be done in this project?
The end goal is to get people to write computational mathematical code in a high level way so that it's readable, reproducible, maintainable, and avoids unnecessary bugs from things like typos, dropped signs, and so on. The way this is achieved is through code generation. The details are not set in stone. Some people feel that templating is the best way to do this. Others feel that templating leads to spaghetti code that is unreadable and difficult to refactor. Code generation is a tough problem because there are broad use cases and each use case has its own needs, which are often not really important for others. For instance, for one use case it may be essential to generate code with matrices; for another, matrices may not be used at all. I suggest reading through the code generation notes page on the wiki (most of it was written by me), and looking at some of the example projects that use code generation (with or without SymPy), to get a feel for what the use cases are and what works and what doesn't work (I wrote some of my own opinions on the wiki, but you're allowed to disagree with me). In other words, you should figure out what is needed and the best way to do it, and write that in your proposal. You should know that I am working on code generation in SymPy, but I think there is room for more than one person. > > 3) I read this blog post by Jason K. Moore where he talked about compiler > optimizations like loop unrolling. Is this project is about finding balance > between what the code generator should do and what the compiler should do? > This blog post is a year old. Has this already been implemented? That is right. There are many kinds of optimizations that compilers won't do, but SymPy can (for example, trig simplification). There are other optimizations that it can do, but which may need to be disabled for very large code generated expressions (in other words, sometimes you have to compile code with -O0 or else the compiler takes too long). Aaron Meurer > > 4) What is the magnitude and nature of work that is incorporated in this > idea? Is there some ongoing work that I should be aware of? > > 5) Please suggest some reading sources, so that I am able to take this up. > > Thank you, > Tanu Hari Dixit. > > -- > 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 https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/256b3c22-fcee-41c9-8cf4-f545a0e92dbb%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JwjcwBLSsa9%2BkVWHQCecS8k2TLD97yKp1FYCCrUfSd%2BQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
