GSoC Project Idea 17: Maxima to Python translator

lisp
python
#1

Context: Maxima is a system for the manipulation of symbolic and numerical expressions with more than 40-year history. The system is maintained by an active community of users and developers and is incorporated in systems, such as Sage. Maxima is an open source and its functionality is on par with commercial systems, such as Maple and Mathematica. The main applications of the system are calculus, dynamical systems and matrix algebra, which are used for example in the context of biophysical modelling.

Python is gaining more and more ground in neuroinformatics [1]. However, development of numerical functionality is limited only to wrapped C libraries.

The project idea: Maxima is represented internally by expression trees. This can be the basis for a system to translate Maxima into other languages. The goal of the project will be to implement a Maxima to Python translator.

Tasks

  1. Implement a framework for transforming Maxima expression trees
  2. Implement Python-specific output functions to print expressions, possibly transformed in some way, in Python syntax. The output will be a Python program which is, as nearly as

possible, equivalent to the original Maxima program.

Minimal set of deliverables

  • Requirement specification - Prepared by the candidate after understanding the functionality.
  • System Design - Detailed plan for development of the translator and test cases.
  • Implementation and testing - Details of the implementation and testing of the translator.

Desired skills: experience with Python or Lisp

Mentors: Dimiter Prodanov (dimiterpp@gmail.com), INCF Belgian Node; (backup) Rober Dodier, Maxima project, (robert.dodier@gmail.com)

References

[1] https://www.frontiersin.org/research-topics/8/python-in-neuroscience

#2
  1. What did you get done this week?

Set up the codebase, developer environment. Discussion of proposal with Mentors and community. Reading relevant codebase for initial work.

  1. What do you plan on doing next week?

Continue discussion and prioritisation of work. Start work on initial plan according to proposal.

  1. Are you blocked on anything?

No

#GSoc_2019

#3

hello Lakshya,

and thanks for the report. Could you please tag it with ‘GSoC_2019’, that should help it be shown in the mentors and students group?

Thanks,
Malin

#4
  1. What did you get done this week?
    Started Work on the code. Modified the sample code written before proposal submission.
  2. What do you plan on doing next week?
    Continue working on the code, and as suggested by the mentor, prioritise the forms to be tackled.
  3. Are you blocked on anything?
    No
    #GSoC_2019
#5

Hello Lakshya,

and thanks for updating us! You will need to tag your post another way to end up in the GSoC_2019 category, and it appears not even admins can do that for you… (we tried!) If you open ‘edit mode’ on your post, you have three boxes for title (upper), category (left) and tags (right). In the tags box, please select ‘GSoc_2019’, then re-save your post.

Have a nice weekend!
Malin

#6
  1. What did you get done this week?
    Completed work on conversion to IR for the following forms: logical and relational operators, array references and definition, functions definitions, assignment, and standard mathematical operators(+, -, *, /, !, ^).
  2. What do you plan on doing next week?
    Continue work based on descriptive.mac(as discussed with Mentor). Immediately, to work on progn(block) statements.
  3. Are you blocked on anything?
    Temporarily blocked on going about block statements. Hope to get it fixed soon, as I have some ideas to test out.

#GSoC_2019

#7
  1. What did you get done this week?
    Added support for conversion of all IR forms defined till now to Python Source. Added support for variable number of arguments to functions. Added support for conversion of 'block() and '() forms, but it is not a perfect solution. Added support for if statements.
  2. What do you plan on doing next week?
    Continue working on conversion of forms to ir and then python. Look for better solution for conversion of block() form. Look into descriptive.mac
  3. Are you blocked on anything?
    Deciding on how to proceed with internal Maxima functions.
    #GSoC_2019
#8
  1. What did you get done this week?
    discussion with community regarding feedback on current implementation, fixing of translation of (-) and (/) operator, code-refactoring for hash-table and use of appropriate functions(typecase instead of cond), appropriate conversion of symbol names, lambda forms, and added a test file.
  2. What do you plan on doing next week?
    Continue to convert forms(descriptive.mac), like for loops, lambda, etc.
  3. Are you blocked on anything?
    No
    #GSoC_2019