2

Is it ok to ask for some help in converting code from another programming language into Mathematica code? I can't find anywhere on the internet to get such help, and perhaps seeing code snippets converted would be beneficial to others looking to do the same. They'd be able to follow how each line was revised for Mathematica, and better understand both languages similarities and differences. I realize there's some selfishness in this request, but I'm unsure where to get help, and don't want to have to learn a complete other programming language, when I'm still trying to get the finer points of Mathematica.

7
  • 1
    Closely related May 22, 2016 at 8:14
  • 5
    In my opinion code in other languages should never be more than additional information for those familiar with that language. If the question is not answerable without reading and understanding that code, I consider it to be off-topic.
    – Karsten7
    May 22, 2016 at 11:08
  • 3
    "They'd be able to follow how each line was revised for Mathematica" For most programs a line by line conversion is the worst approach. Although that's how language comparison benchmarks seem to be coded.
    – Karsten7
    May 22, 2016 at 11:14
  • JLink makes the Java conversion rather simple, but Sage could certainly be tricky.
    – William
    May 23, 2016 at 2:39
  • 1
    @William JLink doesn't convert the code tho, right? It just allows Java code to be run within Mathematica. I'm looking for actual Mathematica code that I can manipulate. May 23, 2016 at 4:20
  • @Karsten7. I agree to some extent, but I personally asked for help with a math related problem both on Math.SE and Mathematica.SE. An answer on Math.SE included code in Java and Sage as those were all he knew. All I know is Mathematica. Mathematica.SE gave answers with code that works, but are much more memory and processor intensive as the math knowledge used to build the Java and Sage programs was much better. Thus, I'm looking for Mathematica code that doesn't just get me the same answer, but is based off the same math, thus knowledge of the Java/Sage code is necessary. May 23, 2016 at 4:30
  • I've gone ahead and asked my question here: mathematica.stackexchange.com/questions/115726/code-conforming-to-math-in-java-sage-code . Perhaps use this as an example for further discussion of what's on- or off-topic for the site. I'm more than willing to go by what others agree to, just want to get an example of the type of question this meta post is about so a decision can be made. May 23, 2016 at 4:56

1 Answer 1

10

Personally, I don't like such questions and would prefer that they not be asked on this site. However, my impression is that I am very much in the minority -- perhaps a minority of one.

So I'll say that is OK to ask such questions if they are well focused. The foreign code should not be too long. Dumping a complete Java program onto the site and asking for a translation will probably not be popular.

2
  • 1
    Perhaps a tag dedicated to this? That way those who aren't interested can avoid these questions, and a description of what's acceptable and what's not can be put into the tag summary? May 23, 2016 at 4:22
  • 2
    I can't imagine you're in the minority about this.
    – Searke
    May 23, 2016 at 18:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .