Giter Club home page Giter Club logo

Comments (10)

simonbyrne avatar simonbyrne commented on June 11, 2024

I was originally trying to keep this as a backend package, closely mirroring WSTP/MathLink itself, and build another package as the frontend, but never got around to that.

This would also result in eager evaluation, which would give different semantics from the underlying Wolfram language.

from mathlink.jl.

fremling avatar fremling commented on June 11, 2024

I see. I'm not an expert of the inner workings of mathematica, but I guess the , the weval could easily be dropped to avoid eager evaluation.

For new users of the package however, having the most basic operations +, -, *, / overloaded would still be quite useful and pedagogic.

from mathlink.jl.

fremling avatar fremling commented on June 11, 2024

After playing around with your package now for a while i have collected quite a bunch of auxiliary functions that make sense to me.
I'm attaching the files here since i'm not very familiar with the pull request architecture (and I'm also not sure where you would want the functions).

The files contain overloading of functions +,-,*,/,^ as well as a switch MLGreedyEval (default is false) to toggle greedy or delayed evluation.
There are also functions that augment the put function to handle julia fractions as well as complex numbers.

Further is there a function `W2Mstr that can translate the ML representation to a string that can be pasted directly into the mathematica editor (quite useful)

Further there is workaround that allows put to handle Int128 by performing a prime factorization (since it's currently not suported).

The functions also comes with some basic tests (see attachments in zip file).

I'd love to make this parts of the package, so if there is anything i can do to help please let me know.

MathLinkHeaders.zip

from mathlink.jl.

simonbyrne avatar simonbyrne commented on June 11, 2024

to be honest, my time is limited so that I really only have time to do bug fixes. Your best option might be to just create a new package (which is fairly simple in Julia), and add this as a dependency.

from mathlink.jl.

simonbyrne avatar simonbyrne commented on June 11, 2024

Unless of course someone wants to take over maintenance.

from mathlink.jl.

fremling avatar fremling commented on June 11, 2024

I think you are correct that my wished would better fit a new package. Let me therefore present MathLinkExtras, where this is all implemented. Hopefully it can make it al the way to be a full fledged julia package.

from mathlink.jl.

simonbyrne avatar simonbyrne commented on June 11, 2024

Thanks: I'm sure there are others that would find that useful!

Further there is workaround that allows put to handle Int128 by performing a prime factorization (since it's currently not suported).

It should be possible to handle this by passing it as a string, as we do for BigInt:

function put(link::Link, x::BigInt)
put(link, WInteger(string(x)))
end
function get(link::Link, ::Type{BigInt})
parse(BigInt, get(link, WInteger).value)
end

I'd be happy to add that, if you want to open a PR?

from mathlink.jl.

fremling avatar fremling commented on June 11, 2024

Hi, if it's that easy to mend that would be great.

I'd love to open a PR for it but I can't seem to install the package from the repository source.
If i try i get an error that "deps/deps.jl" is missing.

julia> using MathLink
[ Info: Precompiling MathLink [18c93696-a329-5786-9845-8443133fa0b4]
ERROR: LoadError: could not open file /home/fremling/...../MathLink.jl/deps/deps.jl
Stacktrace:
[1] include at ./boot.jl:317 [inlined]

from mathlink.jl.

simonbyrne avatar simonbyrne commented on June 11, 2024

Yeah, you have to Pkg.build() it manually when using the source.

from mathlink.jl.

fremling avatar fremling commented on June 11, 2024

Ah, silly me. Now it works :)
I also created a PR for the update. I think we can close this issue now :)

from mathlink.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.