0

I am required to use Mathematica for a course I am taking, but prefer to use python for everything we are doing. I am interested in writing a program to turn my python scripts into Mathematica code that I can run and submit for the class. After doing some research, it seems like I'm trying to make a source-to-source compiler, something I have no experience with. Do you guys have any suggestions for literature/tutorials I should look at? Alternatively, if such a compiler already exists I would love to know.

3
  • 2
    Unless you are accustomed to writing functional code in Python, this is unlikely to work well. Also, as a Python lover myself, let me suggest that you can learn to love Mma too (despite its TIMTOWTDI philosophy). Commented Sep 8, 2017 at 0:54
  • 1
    this is too broad. give some specific example showing where you are having trouble Commented Sep 8, 2017 at 10:06
  • 5
    Some things to think about: 1. While theoretically possible, such a source translator could never work well and would not be practically useful. Mathematica and Python are much too different. Mathematica doesn't do OOP and Python doesn't do term rewriting. 2. To create such a tool, you would need a much deeper knowledge of Mathematica than your course will require. What's the point of doing this again? To avoid learning/using Mathematica?? 3. Creating such tool would also likely take up much more of your time than your entire course. Commented Sep 8, 2017 at 10:27

1 Answer 1

1

I have written a translator that converts a small subset of Python into Mathematica. This translator also works with several other languages, such as JavaScript.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.