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

Create Special.jl: A package for numerics with special functions #10565

Closed
joseraulgonzalez opened this issue Mar 18, 2015 · 15 comments
Closed

Comments

@joseraulgonzalez
Copy link

I think it would be very useful to have a Julia package that standardises the special functions available for numerical computations (as opposed to having several packages for different families of functions, or no packages at all). Are there any plans for this? For an idea of which special functions to include, and what other programming languages and or systems already have please see http://dlmf.nist.gov/software/.

@jiahao
Copy link
Member

jiahao commented Mar 18, 2015

This would be an excellent package to have. We look forward to having someone like you to try implementing it!

Have a look at JuliaLang/libopenspecfun for some functions which are already implemented in Fortran and wrapped in Julia. There's also open issues about wrapping or translating the NSWC library.

@joseraulgonzalez
Copy link
Author

I am sorry but I cannot find JuliaLang/libopenspecfun. Do you mean JuliaLang/openspecfun? Also, does anyone have any idea, or pointers, on the performance of using C or Fortran functions and them calling them via a wrapper vs native Julia functions?

@joseraulgonzalez
Copy link
Author

Also, just for reference, there seems to be a discussion about including this (or not) in Base. See #8536 and #4301. Furthermore, if translating NSWC is not an option, how useful is it to do so with the GNU Scientific Library?

@jiahao
Copy link
Member

jiahao commented Mar 19, 2015

Yes, without the lib.

At this point we believe that NSWC is public domain code and the risk to translating that code is minimal. GSL has an incompatible license.

Would you be interested to attempt a translation?

@jiahao
Copy link
Member

jiahao commented Mar 19, 2015

The manual has a comprehensive chapter on wrapping external code.

@garrison
Copy link
Member

GSL has an incompatible license.

GSL is licensed under the GNU GPL. With what would this be incompatible?

@joseraulgonzalez
Copy link
Author

I am, but I am afraid I do not know enough Julia just yet.

@johnmyleswhite
Copy link
Member

GSL is licensed under the GNU GPL. With what would this be incompatible?

Most everything else in Julia. We've fought tooth and nail to keep ourselves unrestricted by the GPL.

@joseraulgonzalez
Copy link
Author

@garrison I had the same question and you beat me to it. However, since @jiahao has worked on GSL.jl I would suppose he has already had discussions with others about this.

@garrison
Copy link
Member

@johnmyleswhite The GPL is not incompatible with the license of Julia; it's simply that the developers of Julia have decided to avoid linking with any GPL code. There's a big difference. In any event, if Special.jl is an external package, it should be fine to depend on GPL code if the developer of that package wishes, just as GSL.jl currently does.

@johnmyleswhite
Copy link
Member

I think we're mostly talking at cross-purposes: the GPL is clearly legally compatible with the MIT license, but it is philosophically incompatible since the goal of the use of the MIT license in Julia is to ensure that businesses are not prohibited from doing things with Julia that they might want to do.

Having an external package under the GPL is clearly fine, but it's also clearly an issue that shouldn't be listed in this repo. But we have special functions in Base right now, where we don't want to add new GPL code.

@joseraulgonzalez
Copy link
Author

Indeed, a quick look at math.jl in base shows that there are already several special functions in Julia. However, several are missing, e.g.. orthogonal polynomials and hypergeometric functions just to name a couple. There is already a project on special functions for Julia JuliaLang/openspecfun but one of the issues is also the lack of more functions (JuliaMath/openspecfun#10). Also, the project does not seem to be very active at the moment.

Returning to the NSWC translation, the discussions in JuliaMath/openlibm#20 seems to suggest that it would be OK to do such a translation and not run into any licensing issues. Would anyone be interested in moving forward with this? (either by creating Special.jl, or by working on openspecfun) I would like to use it as an opportunity to learn Julia.

@jiahao
Copy link
Member

jiahao commented Mar 19, 2015

I typed the previous message on a plane and was slightly hypoxic. GSL is GPL, and its license doesn't make any code translated from GSL it incompatible to use with Julia. But the viral nature of GPL does limit its usefulness, and does preclude any chance of it being put into the base library.

I wouldn't consider orthogonal polynomials as special functions that would be interesting to evaluate in the monomial basis. That would defeat the purpose of using orthogonal polynomials in most use cases I know. There's also infinitely many of them...

Someone on julia-users complained about the poor quality of the hypergeometric functions in GSL, but I'm not an expert on these things so I don't know how to evaluate that claim.

We are developer time-limited here, so by far the best thing to do is try implementing something and see how far you get.

Closing, not because I think it's not worth doing, but because this is not actionable in base Julia.

@jiahao jiahao closed this as completed Mar 19, 2015
@tkelman
Copy link
Contributor

tkelman commented Mar 19, 2015

As you may have seen in one of the linked issues, the Amos code has been translated to Julia here - https://github.com/nolta/SpecialFunctions.jl

I'd need to check what the license is on the Amos functions, but it would be good to have someone with interest in this area pick up that effort and spruce up the package fully with testing, registering, documentation, etc. (Removing a Fortran dependency from base Julia would be great.) And add more functions as desired. Though anything GPL-licensed should be kept in separate repositories, no harm in doing this across several separate packages. GSL-derived code should probably start as contributions to GSL.jl.

@ViralBShah
Copy link
Member

There has been a lot of discussion on the Amos license in many places. See details here:

https://github.com/JuliaLang/openspecfun/blob/master/LICENSE.md

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

No branches or pull requests

6 participants