On Wed, Nov 18, 2009 at 10:28 AM, David Mertens <[email protected]> wrote: > Use Matrixy to parse Matlab/Octave code into some sort of abstract tree, > with which we could generate PDL code. This would allow folks with legacy > Matlab code to hit the ground running with PDL. > #1 sounds like a pain but would help a lot with PDL evangelism. I suspect > you are not much interested in doing this yourself.
This is definitely an interesting idea, and working towards this would help encapsulate Matrixy's parser from it's code generator, which is always a plus. On the bright side, the Matrixy parser and code generator are both written in the Perl6 subset "NQP", so the perl heads on this list shouldn't be entirely uncomfortable looking at it. > Interface Matrixy and PDL so that (1) data type conversion for matrices is > fast and cheap and (2) calling functions from one language that are written > in the other is easy. > #2 is probably the most plausible option. You would likely get some > interest if you could explain to us the data structures used in Matrixy, or > tell us where to read more. Matrixy uses datatypes provided by the Parrot-Linear-Algebra project: http://github.com/Whiteknight/parrot-linear-algebra That project is still young and easy to influence. It should be easy to improve those data types to be either (a) easy to translate to the PDL internal storage types or (b) to use the PDL storage formats directly. Much of the data types are very naive (simple "double *" buffers in C with x/y sizes cached and some simple macros for accessing into it). I would definitely be interested in seeing the level of sophistication improve. So long as parrot-linear-algebra still works in a language-neutral way so other programming languages on Parrot can utilize it, I am happy to entertain any proposed changes. Commit bits for this project are freely available to anybody who is interested. > Implement PDL::PP in in Parrot. > #3 is the Proper Parrot solution to interfacing these two languages. I know > of no language that interfaces multidimensional data better than PDL::PP. > (Take that with a grain of salt: I'm not a very multilingual programmer.) > An implementation would most likely involve a C-compiler on the backend, > though I know that's somewhat against the philosophy of Parrot. Anyway, if > we could find a way to port PDL::PP to Parrot, then Parrot would be able to > provide an incredibly powerful infrastructure for numerical processing to > any language written using Parrot. If PDL::PP were properly implemented, > Matrixy would be able to compete with Matlab in terms of speed. I am > interested in this, but it is a huge undertaking and I hope to write my > thesis and graduate some time in the next two years.... I'm not familiar enough with PDL::PP to know how easy or hard this would be. Parrot has a native interface for connecting to libraries, so if enough of the PDL::PP functionality were encapsulated as a pure-C library (No XS) it would be trivial to write a binding. Parrot-Linear-Algebra aims to provide bindings to the CBLAS and CLAPACK libraries, and actually provides a small number of CBLAS bindings right now. So speed of matrix calculations should be comparable to MATLAB and Octave eventually (because BLAS is what those programs use too). Where we suffer right now is parsing speed, the parser currently aims to be more complete then performant (once we get more syntax supported and tests written we can go back to make it run faster). > From your end, I presume your energy is directed at Matrixy, > not at interfacing Matrixy with PDL. Nonetheless, cross-talk could be very > fruitful. Do you think you could give us some information per #2? I really don't know a lot about PDL, so even with all the energy in the world my ability to play with it is currently limited. You are right though that I am focusing on getting Matrixy syntax-complete first, and getting parrot-linear-algebra more mature and capable. Cross-talk with PDL might help to drive both those things. --Andrew Whitworth _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
