We are doing a project which needs differential and integral calculus.

* *The only scripting language we have worked with is PHP.*
* We are on a shared host with *no shell access*
* The UI is made in PHP / Javascript.

We want to call from php to another script (different language) which than will return an array with the results.

Now the questions:

1. **Which language is easiest to connect to PHP in a non-shell environment?** (is it really only perl)
2. Which language (considering the filter of question 1) has best support of math libraries or frameworks to easily our work?
3. Which language (C is not an option, as per above) has good performance in doing heavy calculations?

Thanks for your suggestions

**UPDATE:**

RUBY ON RAILS has such a library
<http://rubyforge.org/projects/integral/>

*Rails is on some shared hosts included (like mine) to use.*

For Perl exists a book Higher-order Perl: A Guide To Program Transformation,