Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite all AMOS code in julia #461

Open
inkydragon opened this issue Jan 18, 2024 · 5 comments
Open

Rewrite all AMOS code in julia #461

inkydragon opened this issue Jan 18, 2024 · 5 comments

Comments

@inkydragon
Copy link
Member

Recently, the SciPy community rewrote AMOS's F77 code in C. scipy/scipy#19587

I wonder if it's worth rewriting with julia.
Maybe we can rewrite a function in julia first to see if there is a performance improvement.

@ararslan
Copy link
Member

Very, very early on (think Julia 0.5 or so), the AMOS Fortran code was auto-translated to Julia. That work is preserved on the f-jl-translated branch. I think at this point, scipy's C translation is probably a better place to start, since they went through the heroic work of unrolling the gotos, whereas the auto-translated Julia code used @label and @goto everywhere the Fortran code did.

@ViralBShah
Copy link
Member

How about just BB'ing the new C code and using that as a starting point? I assume it will be better maintained.

@inkydragon
Copy link
Member Author

inkydragon commented Feb 3, 2024

new C code

Where are we going to put the new C code?
In JuliaMath/openspecfun or in a new project.

Are we replacing existing fortran code?

In the long run, we should replace all the old code that has been rewritten.
However, the new C code has not been well tested yet, and I have found some bugs in it.

So my suggestion would be to export the prefixed functions first.
Maybe start with scipy_ / cimpl_

@ViralBShah
Copy link
Member

The new C code could just be an Yggdrasil recipe, where it pulls it in from upstream. Agree that we should use it only when we feel it is ready and we can prefix it or namespace it or something.

@ViralBShah
Copy link
Member

I also see your native Julia PR, which would also be really cool to use, and it would be more maintainable than the auto-translated version with gotos and what not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants