This page is no longer maintained — Please continue to the home page at www.scala-lang.org

the future of Numeric (specialization, reorganization, etc.)

1 reply
d_m
Joined: 2010-11-11,
User offline. Last seen 35 weeks 2 days ago.

Greetings,

At work [1] I've been given some time to create a specialized Numeric
trait to allow generic math operations to be fast; at work we'd use
this when processing large raster grids. We'd like to be able to write
code like Raster[Int] but currently it is far too slow to do this and
we have to do things like IntRaster. Ideally the work I do could be
submitted back to the Scala project to benefit everyone.

There has been some discussion of this already [2]. Andreas Flierl
provided a small demo and Iulian Dragos mentioned that he had been
working on it [3], and also that it would require some reorganization of
Numeric.

I'd like to have a dialogue about what needs to be done, but I'm not
sure where the appropriate place is (or who is interested in
participating). There are some problems with the current Numeric
hierarchy and also some questions about the scope of specialization
(e.g. would Ordering be specialized as well?).

I haven't submitted any code to Scala before, so I want to make sure
that I follow the correct procedure, and also that I don't spend a
bunch of time creating a patch that no one wants! If anyone has any
opinions or ideas about what should (or shouldn't) happen please feel
free to email me.

Thanks,

iulian dragos 3
Joined: 2011-02-21,
User offline. Last seen 42 years 45 weeks ago.
Re: the future of Numeric (specialization, reorganization, etc.

On Thu, Feb 17, 2011 at 6:05 PM, Erik Osheim wrote:
> Greetings,
>
> At work [1] I've been given some time to create a specialized Numeric
> trait to allow generic math operations to be fast; at work we'd use
> this when processing large raster grids. We'd like to be able to write
> code like Raster[Int] but currently it is far too slow to do this and
> we have to do things like IntRaster. Ideally the work I do could be
> submitted back to the Scala project to benefit everyone.

That would be great!

>
> There has been some discussion of this already [2]. Andreas Flierl
> provided a small demo and Iulian Dragos mentioned that he had been
> working on it [3], and also that it would require some reorganization of
> Numeric.

I added Aleksander on the Cc, as he is taking over the maintenance of
specialization.

> I'd like to have a dialogue about what needs to be done, but I'm not
> sure where the appropriate place is (or who is interested in
> participating). There are some problems with the current Numeric
> hierarchy and also some questions about the scope of specialization
> (e.g. would Ordering be specialized as well?).

We can move the discussion to Scala incubator, which is the default
place for future additions to the standard library. For the moment, we
can have a separate library/project, where we test our ideas. OTOH, it
makes sense to specialized Ordering as well, but we have to see how
things turn out in practice. I doubt many people use Numeric in its
current form (given its performance), so we have some freedom to
change the interface.

>
> I haven't submitted any code to Scala before, so I want to make sure
> that I follow the correct procedure, and also that I don't spend a
> bunch of time creating a patch that no one wants! If anyone has any
> opinions or ideas about what should (or shouldn't) happen please feel
> free to email me.

We're definitely interested in making Numeric useable! We require all
committers to sign a contributor license agreement.

iulian

>
> Thanks,
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland