JuliaInterop/MathLink.jl

Symbolics to MathLink translation of expressions

Closed this issue · 4 comments

Is interoperability between Symbolics and MathLink an idea? The usecase is exploratory work in a jupyter or Pluto notebook. Even when the algebra isn't that difficult, I appreciate the comfort of a CAS checking my work. If I want to do something beyond the capabilities of Symbolics.jl, an easy translation from a Symbolics expression to a MathLink expression, and back, would be perfect.

Variables, matrices, basic math (+-*/^), trigonometry, and a flexible way of defining adhoc mapping between functions?

(Why do something manually in 15 minutes that you can spend 15 hours to automate?)

I agree, a separate package makes sense. I have briefly looked into it, and i believe recursively applying a mapping function to the tree structures would work. The purpose shouldn't be to attempt to map everything, but to create something that can easily be extended when corner cases show up.

When going roundtrip from Symbolics to MathLink and back, one might need to maintain a datastructure that tracks maps Wolfram symbols back into Symbolics variables, but that won't be a problem (?)

What might be needed in terms of changes in MathLink is to expose some of the functionality now only in the W_cmd macro as normal functions. Is the MathLink.Symbol function intended for external use?

Hi. I do not see a problem with using the MathLink.WSymbol externally. It the long version of the W"<var>" construct,

julia> W"a"==MathLink.WSymbol("a")
true

@ahjulstad: I'm closing this ticket for now as this will be a new package if/when it is created.