Re: Rubi, mathics, python and jnil.
Dan Stanger <[email protected]> Tue, 2 Jun 2026 19:48:18 -0400
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <CAFyhtT5PfHpbJ3hpct0evjkGxqtKmuW3oqTwX4Uj7-jvm1D6+w@mail.gmail.com> |
It turns out that it was easier to modify my existing java maple translation code instead of jnil. I contacted the matics rubi developers who pointed me to their pattern matching code. I wrote a python script to produce an ast from it, and an antlr parser which parses it. I am now modifying my visitor class and templates to produce lisp. There are 2 issues so far. First, the ast conversion process changes the doc strings so they are just regular strings, which makes identifying them more difficult. Second, the conversion turns else if statements into nested if statements which means using cond is a challenge. If anyone is interested, I can send a tar of the current project. BTW, this project can also be used in conjunction with the java to python translation application to convert java to lisp. Dan Stanger On Sun, May 3, 2026 at 3:00 PM Dan Stanger <[email protected]> wrote: > Hello All, > About 22 years ago, there was a project jnil, which translated java into > lisp. It worked by loading java code into Eclipse and using JLinker, an ACL > tool to communicate with a lisp program which did the translation by > retrieving information about the java code to perform the translation. > Python has an abstract syntax tree (AST) module which provides similar > functionality to the Eclipse usage but can provide text output. Mathics is > a mathematica clone written in Python which has advanced enough to load > rubi. Using Antlr, an existing python grammar can produce a s expression > output of a concrete syntax tree. I am writing a grammar file for the > Python AST output which should enable a modified jnil to convert the > mathics pattern matching code into lisp, which should provide an easier > integration with Maxima. > Dan Stanger > _______________________________________________ Maxima-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maxima-discuss