in reply to Re^6: What will scientific computing in Perl 6 look like?
in thread What will scientific computing in Perl 6 look like?

Exactly.

If you limit yourself to a few numeric types, the problem won't seem to be that big a deal. If you know the long list of numeric types that mathematicians have (including many number of parametrized families of numeric types), it starts to become harder. Particularly when the answer has to be a different type than either operand (eg a Gaussian integer plus a rational number is generally a Gaussian rational).

  • Comment on Re^7: What will scientific computing in Perl 6 look like?

Replies are listed 'Best First'.
Re^8: What will scientific computing in Perl 6 look like?
by moritz (Cardinal) on Jul 16, 2008 at 06:59 UTC
    I think that's a problem with mathematics, not with programming languages. When you define a new type of number, and you want to be able to use it in arithmetic operations with other numbers, you have to define what the outcome will be.

    Mathematicians are a bit sloppy about this sometimes because they except you to know what the right thing is, but if they aren't sloppy have to go through the same motions as somebody who writes a class for a new numeric type in Perl 6.

    So of course you are right in the sense that Perl 6 doesn't solve a problem that's not yet solved in mathematics, but I think it might be a bit too optimistic to really expect that ;-)

Re^8: What will scientific computing in Perl 6 look like?
by Anonymous Monk on Jul 16, 2008 at 07:16 UTC

    Of all the Perl programs written, how many will use Gaussian numbers?

    Or look at it another way. How many Perl programs will make use of all that "long list of numeric types that mathematicians have"?

    The vast majority of Perl programs will use nothing more than the basics, and the few that do will each probably only use one or two of those exotics. So long as whatever packages are used to provide the required conversions between the exotic types they implement and one of the built in basic types, where applicable, everyone is happy.

    Conclusion: The theoretical problem of a combinatorial explosion of type conversions never arises.

      There is a chicken and an egg problem here. It is difficult to write a good package in Perl to manipulate various numerical types. Nobody has written such a package in Perl. You don't see people trying to use such a package. These all feed back on each other.

      If we had a good package for manipulating different numerical types in Perl, who can say who would come out of the woodwork to use it? If it was easy to write it, do you think that someone would have put it on CPAN? Have you seen how many Math:: modules there are? Many for things that you'd never expect to see people use in Perl?