Skip to content

Commit

Permalink
initial dump of Matrixy repo from code.google.com/p/matrixy
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Oct 13, 2009
0 parents commit 84916b5
Show file tree
Hide file tree
Showing 141 changed files with 8,823 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Configure.pl
@@ -0,0 +1,33 @@
use strict;
use warnings;
use 5.008;

use lib "../../lib";
use Parrot::Configure;
use Parrot::Configure::Options qw( process_options );

$| = 1; # $OUTPUT_AUTOFLUSH = 1;

my $args = process_options(
{
step => 'gen::makefiles',
mode => 'reconfigure',
conditioned_lines => 1,
replace_slashes => 1,
}
);
exit(1) unless ( defined $args );

my $conf = Parrot::Configure->new;
$conf->options->set( %{$args} );
$conf->data()->get_PConfig(); #load configuration data

my @builtins = glob("src/builtins/*.pir");
$conf->data()->set('builtins_pir', join(' ', @builtins));

my @internals = glob("src/internals/*.pir");
$conf->data()->set('internals_pir', join(' ', @internals));

$conf->genfile( 'config/makefiles/root.in' => 'Makefile');

exit(0);
12 changes: 12 additions & 0 deletions PAST-Compiler.patch
@@ -0,0 +1,12 @@
Index: compilers/pct/src/PAST/Compiler.pir
===================================================================
--- compilers/pct/src/PAST/Compiler.pir (revision 37388)
+++ compilers/pct/src/PAST/Compiler.pir (working copy)
@@ -90,6 +90,7 @@
valflags['String'] = 's~*:e'
valflags['Integer'] = 'i+*:'
valflags['Float'] = 'n+*:'
+ valflags['Complex'] = 's~*:e'
set_global '%valflags', valflags

## %!controltypes holds the list of exception types for each
80 changes: 80 additions & 0 deletions README.NCI.pod
@@ -0,0 +1,80 @@
=head1 DESCRIPTION

Parrot must be recompiled with signatures produced in files in extern/pir/*.nci. These
need to be appended to <parrot source>\config\gen\call_list, then Parrot needs to be
recompiled.

The relevant dynamic library for a platform must be dropped into extern/lib/. The Windows
DLLs should be already there and one version for Linux (libc.so.6).

=head1 BUILD INSTRUCTIONS

=head2 WINDOWS

Either download the specific static library from

http://www.netlib.org/clapack/LIB_WINDOWS/prebuilt_libraries_windows.html

or build them yourself using the VS solution provided at

http://www.netlib.org/clapack/

Then run

./tools/nci/lib_to_dll.pl --libdir "C:\CLAPACK-3.1.1-VisualStudio\LIB\Win32" --name clapack
--olib libf2c.lib --olib BLAS.lib --outdir "extern\lib"

./tools/nci/lib_to_dll.pl --libdir "C:\CLAPACK-3.1.1-VisualStudio\LIB\Win32" --name cblas
--olib libf2c.lib --outdir "extern\lib"

=head2 LINUX

Download clapack.tgz from

http://www.netlib.org/clapack/

and unpack somewhere on your filesystem.

tar zxvf clapack.tgz
cd CLAPACK-3.1.1.1
copy make.inc.example make.inc

Edit make.inc, add -fPIC option to NOOPT, i.e.

NOOPT = -O0 -fPIC

and add the following lines to the end: -

BLASLIBSO = ../../cblas.so
LAPACKLIBSO = clapack.so

Edit SRC/Makefile and add the following lines: -

../$(LAPACKLIBSO): $(ALLOBJ) ../F2CLIBS/libf2c.a ../blas_LINUX.a
$(LOADER) $(LOADOPTS) -shared -Wl,-soname,clapack.so -o $@ $(ALLOBJ) ../F2CLIBS/libf2c.a ../blas_LINUX.a

Also, change

all: ../$(LAPACKLIB)

to

all: ../$(LAPACKLIB) ../$(LAPACKLIBSO)


Edit BLAS/SRC/Makefile and add the following lines: -

$(BLASLIBSO): $(ALLOBJ) ../../F2CLIBS/libf2c.a
$(LOADER) $(LOADOPTS) -z muldefs -shared -Wl,-soname,cblas.so -o $@ $(ALLOBJ) ../../F2CLIBS/libf2c.a

Also, change

all: $(BLASLIB)

to

all: $(BLASLIB) $(BLASLIBSO)

Finally run make and copy the cblas.so and clapack.so files to extern/lib/.

=cut
73 changes: 73 additions & 0 deletions README.pod
@@ -0,0 +1,73 @@
=head1 Matrixy

=head2 INTRODUCTION

This is a port of the MATLAB/Octave programming language to
Parrot. See the ROADMAP file for more information on the
status of this project, and what else needs to be done.

=head2 ABOUT

Primary goals are:

=over 4

=item* Create a working compiler that understands the
majority of the MATLAB/Octave programming language.

=item* Create a series of PMCs and library files, especially
those involving matrices, that can be used by other
programming languages which target Parrot.

=back

=head2 IMPLEMENTATION

This project is broken into three primary components:

=over 4

=item* The first is the parser, located in the
C<src/parser/> directory. The parser is composed of two
source files, F<grammar.pg> which is a Perl6Grammar file,
and F<actions.pm> which is the associated actions file
written in NQP.

=item* The second component is the library of builtin
functions in the C<src/builtins/> directory. These
functions are, currently, written primarily in PIR.
Function names prefixed with an underscore are "private"
functions for use with the parser. Other functions should
have names which are the same as names for regular MATLAB
or Octave functions, since they will be available to the
HLL.

=item* the final component is the set of various PMC classes
that make up the data objects in Matrixy. The "master" super
class is the "MatrixyData" class. This class represents an
instantiation of a generic data object. From here, data can
be subclassed into "Matrix", "Cell Array", or other types
of values, as necessary.

=back

=head2 BUILDING

perl Configure.pl
nmake test

=head2 TODO

* Parser
* Standard Builtins
* Test against Octave Test Suite.

=head2 BUGS

Lots!

=head2 CONTACT

Contact Project Owners at http://code.google.com/p/matrixy/.

=end
106 changes: 106 additions & 0 deletions ROADMAP.pod
@@ -0,0 +1,106 @@
=head1 ROADMAP

=head2 INTRODUCTION

There is a long way to go between the current implementation
and a final robust one. The final version should be able to
emulate the vast majority of MATLAB/Octave language syntax,
and should also try to emulate some of the basic library
functions thereof. Notice that some "standard" features of
MATLAB/Octave won't be available here, at least not
immediately: Plots and graphs, user interfaces, toolboxes,
etc.

=head2 Future Versions

Version 1.0 will support most of the basic language syntax,
and hopefully many of the core library functions. Here,
abbreviated and horribly inaccurate, is a general roadmap
for this project:

Version 0.1: (current) We have basic support for single-
value subroutines, basic control structures, basic scalar
variables. Also some ideosyncratic features like using ';'
to suppress printing line results, using '!' to make a
system call, etc. Implemented basic functions like 'disp',
'error', 'exit', and 'feval', all for scalar arguments only.

Version 0.2: Implement matrices, and improved support for
functions with multiple return values.

Version 0.3: Write some of the standard matrix manipulation
functions, or basic versions thereof. Transpose, determinant,
size, addition, multiplication, etc.

Version 0.4: Implement function/file look-up. Searching for
function "foo", look in file "foo.m", etc.

Version 0.5: Implement cell arrays

Version 0.6: Write more-advanced function features: nargin,
nargout, varargin, varargout, return. Implement matrix-
ready functions that iterate over matrix values

Version 0.7: Implement matrix and cell array slicing:
'x(1:)', and similar. implement matrix and cell array
concatination '[[1 2 3], [4 5 6]] = [1 2 3 4 5 6]'. Treat
all scalars as matrices.

Version 0.8: Implement basic MATLAB classes and data
structures. Implement a dedicated matrix PMC (probably in C)
implement sparse matrices (may be part of the same pmc).

Version 0.9: Implement most of the standard library of
functions, including error-stubs for common functions which
cannot be implemented (graphics, etc). Core builtins should be
written in PIR, and the rest should be written in M.

Version 1.0: All the basic stuff should be working, including
a proper test suite. Enough of the language should be implemented
in order to run the Octave test suite (or portions of it that
we haven't explicitly excluded). Matrixy won't have all the
features of MATLAB or Octave, but the features it does have
should match them syntactically. Everything should be documented

=head2 Wishlist

The roadmap above should produce a 1.0 which is a stable clone
of a core subset of MATLAB/Octave. From that base, there are a
large number of standard features (extensions/libraries, larger
subsets of the language) that could be implemented. Plus, there
are a number of non-standard wishlist features that could be added
to extend the language. Such non-standard features might be made
available through a command-line switch, an in-code pragma or in
a separate executable. Here is a list of such features, in no
particular order:

=over 4

=item* Better, more robust support for OO, classes, namespaces.

Notice that OO was added to MATLAB in R2008A. This wishlist item
means better support for this including some of the more advanced
features that Parrot enables.

=item* Better Multithreading

Notice that MATLAB supplies a Parallel Computing Toolbox which gives
the user some explicit support for multithreading and support for
multicore computing. Matrixy may attempt to reproduce this toolbox
or may attempt to add a more generic threading system.

=item* disambiguous matrix/function syntax.

Should be able to use '[]' for matrix indices, use '()' for function
arguments, if desired. This will help ease human readability in some
cases, and is more natural for some programmers.

=item* Allow inlining code from other languages.

Matrixy will likely contain subroutines very early on to compile code
strings from other programming languages. An inlineable interface will
be more robust and natural.

=back

=end

0 comments on commit 84916b5

Please sign in to comment.