Thread Subject: Matlab is a closed environment

Subject: Matlab is a closed environment

From: Bob

Date: 22 Dec, 2008 20:18:30

Message: 1 of 7

There is a discussion on the Image Processing group that I think is
relevant to all matlab users:
http://tinyurl.com/7pn37v
A user was interested in the Image Processing toolbox function
bwtraceboundary and wondered about the algorithm.

I wrote:
> This is a real problem with Matlab. It is essentially a closed
> environment. Heaven help you if you want to port your code to
> distribute it.

ImageAnalyst replied:
--------------------------------------------------------------------
Why "heaven help you"? If it works fine for you then why does it
matter that you can't see every source code line. The Mathworks
usually gives references for papers if they're following a published
algorithm. I don't know about you but I've used many libraries over
the past 30 years and if the library routine does it's job then I
don't feel any urge to dig into it further. Why waste my time? I bet
lots of us use libraries all the time without concern as to what's in
them. Even if you're using open source code libraries, how many of us
actually dig into them to see how they do an erosion, or a histogram,
or whatever? If it works for you, then you just use it without
worry. If you want to distribute your code, then MATLAB lets you
distribute it royalty free and it's pretty easy - just two files the
run-time installer, and your executable. So easy that I don't need
any help from heaven to do it.
ImageAnalyst
--------------------
And I responded:
Well, it looks like you have never tried to make a shippable i.e.
salable product based on your work. You need to port the code to
another language since the matlab compiler is a joke. It requires an
~100 Mbyte dll, the dll changes every time they release a new version
and the different versions are incompatible, and the execution time is
no faster than the matlab code.

Even if you are an academic, some researchers want their code to be
open and reproducible. After all, that is the purpose of all
publications, to show others what you did and how you did it so they
can reproduce it and see for themselves. As the OP noted, you cannot
reproduce a black box no matter how satisfied YOU are with it.

And as to references, most publications, in the words of Jon Claerbout
of Stanford, are 'advertisements' and not sufficient to reproduce the
results. The scholarship in software research (and I include image
processing in this topic) is the code itself. It is almost impossible
to reproduce results based on the description in a paper. Suppose 200
years from now, someone wants to reproduce an algorithm that you
documented as matlab code. Mathworks has gone the way of all companies
and is defunct and gone with it is matlab. Your results are
essentially useless.
--------------------
Steve Eddins pointed out:
> We ship the C and C++ source code for almost all of the MEX-files in the Image Processing Toolbox.

Thanks. I had not noticed that. Do you provide source for other
functions such as rand? I have not followed up the references but see
my comments above about reproducible research.

Subject: Matlab is a closed environment

From: Steve Eddins

Date: 29 Dec, 2008 12:51:19

Message: 2 of 7

Bob wrote:
> [snip]
> Even if you are an academic, some researchers want their code to be
> open and reproducible. After all, that is the purpose of all
> publications, to show others what you did and how you did it so they
> can reproduce it and see for themselves. As the OP noted, you cannot
> reproduce a black box no matter how satisfied YOU are with it.
>
> And as to references, most publications, in the words of Jon Claerbout
> of Stanford, are 'advertisements' and not sufficient to reproduce the
> results. The scholarship in software research (and I include image
> processing in this topic) is the code itself. It is almost impossible
> to reproduce results based on the description in a paper. Suppose 200
> years from now, someone wants to reproduce an algorithm that you
> documented as matlab code. Mathworks has gone the way of all companies
> and is defunct and gone with it is matlab. Your results are
> essentially useless.
> --------------------
> Steve Eddins pointed out:
>> We ship the C and C++ source code for almost all of the MEX-files in the Image Processing Toolbox.
>
> Thanks. I had not noticed that. Do you provide source for other
> functions such as rand? I have not followed up the references but see
> my comments above about reproducible research.

No, we do not provide source code for built-in functions in MATLAB.

Much of my work at MathWorks has been to implement image processing
algorithms from descriptions in the literature, so I quite agree with
you about the lack of reproducibility of many references.

I generally try not to get drawn into discussions of the relative merits
of different working environments and languages, because I think it's
really up to the user to make that kind of assessment. However, I can't
resist challenging your hypothetical question and its 200-year time
horizon. From what I have seen in my comparatively brief quarter
century of programming computers, I would guess that 200 years from now
you'd have a hard time reproducing results using any source code written
today, no matter what the language or environment. Also, almost
everyone relies on library routines without having access to source
code. Can you get the source code for your C++ compiler vendor's
implementation of rand?

---
Steve Eddins
http://blogs.mathworks.com/steve/

Subject: Matlab is a closed environment

From: David

Date: 29 Dec, 2008 13:03:03

Message: 3 of 7

Steve Eddins <Steve.Eddins@mathworks.com> wrote in message <gjah47$gge$1@fred.mathworks.com>...
> code. Can you get the source code for your C++ compiler vendor's
> implementation of rand?
>
> ---
> Steve Eddins
> http://blogs.mathworks.com/steve/

yes, it is supplied with the standard installation of visual studio.

Subject: Matlab is a closed environment

From: Steve Eddins

Date: 29 Dec, 2008 13:19:28

Message: 4 of 7

David wrote:
> Steve Eddins <Steve.Eddins@mathworks.com> wrote in message <gjah47$gge$1@fred.mathworks.com>...
>> code. Can you get the source code for your C++ compiler vendor's
>> implementation of rand?
>>
>> ---
>> Steve Eddins
>> http://blogs.mathworks.com/steve/
>
> yes, it is supplied with the standard installation of visual studio.

Cool. But will the reader of your code 200 years from now have today's
standard installation of Visual Studio?

Subject: Matlab is a closed environment

From: David

Date: 29 Dec, 2008 14:00:04

Message: 5 of 7

Steve Eddins <Steve.Eddins@mathworks.com> wrote in message <gjaip0$4er$1@fred.mathworks.com>...
> David wrote:
> > Steve Eddins <Steve.Eddins@mathworks.com> wrote in message <gjah47$gge$1@fred.mathworks.com>...
> >> code. Can you get the source code for your C++ compiler vendor's
> >> implementation of rand?
> >>
> >> ---
> >> Steve Eddins
> >> http://blogs.mathworks.com/steve/
> >
> > yes, it is supplied with the standard installation of visual studio.
>
> Cool. But will the reader of your code 200 years from now have today's
> standard installation of Visual Studio?

if anyone is looking at MY code in 200 years i pity them.

Subject: Matlab is a closed environment

From: John D'Errico

Date: 29 Dec, 2008 14:17:02

Message: 6 of 7

"David" <dave@bigcompany.com> wrote in message <gjal54$k9v$1@fred.mathworks.com>...
> Steve Eddins <Steve.Eddins@mathworks.com> wrote in message <gjaip0$4er$1@fred.mathworks.com>...
> > David wrote:
> > > Steve Eddins <Steve.Eddins@mathworks.com> wrote in message <gjah47$gge$1@fred.mathworks.com>...
> > >> code. Can you get the source code for your C++ compiler vendor's
> > >> implementation of rand?
> > >>
> > >> ---
> > >> Steve Eddins
> > >> http://blogs.mathworks.com/steve/
> > >
> > > yes, it is supplied with the standard installation of visual studio.
> >
> > Cool. But will the reader of your code 200 years from now have today's
> > standard installation of Visual Studio?
>
> if anyone is looking at MY code in 200 years i pity them.

We can swap. I've got some 40 year old dreck I wrote
in Basic, stored on paper tape that I'd be willing to
trade. Of course a paper tape reader for it can probably
only be found in an exhibit at the Smithsonian.

John

Subject: Matlab is a closed environment

From: Rune Allnor

Date: 29 Dec, 2008 17:34:06

Message: 7 of 7

On 29 Des, 13:51, Steve Eddins <Steve.Edd...@mathworks.com> wrote:
> Bob wrote:
> > [snip]
> > Even if you are an academic, some researchers want their code to be
> > open and reproducible. After all, that is the purpose of all
> > publications, to show others what you did and how you did it so they
> > can reproduce it and see for themselves. As the OP noted, you cannot
> > reproduce a black box no matter how satisfied YOU are with it.
...
> Much of my work at MathWorks has been to implement image processing
> algorithms from descriptions in the literature, so I quite agree with
> you about the lack of reproducibility of many references.
>
> I generally try not to get drawn into discussions of the relative merits
> of different working environments and languages, because I think it's
> really up to the user to make that kind of assessment. =A0However, I can'=
t
> resist challenging your hypothetical question and its 200-year time
> horizon. =A0From what I have seen in my comparatively brief quarter
> century of programming computers, I would guess that 200 years from now
> you'd have a hard time reproducing results using any source code written
> today, no matter what the language or environment. =A0Also, almost
> everyone relies on library routines without having access to source
> code. =A0Can you get the source code for your C++ compiler vendor's
> implementation of rand?

These are several questions:

1) The quality of pulished literature on algorithms
2) The availability of source code
3) The usefulness of available source code

To start with the latter, C++ is a standardized language in the sense
that there exists a governing document that specifies what type of
program behaviour a complying C++ compiler will produce in response
to source code. The user doesn't need access to the source for the
C++ compiler, but only to *a* standard-comlying C++ compiler. It's
up to the compiler vendor to ensure that the compilers comly to
the standard. It is also in the vendor's commercial interest
to make sure that their products do comply to the standards, as
this is what C++ users expet from their compilers.

Ideally, a standard-complying C++ compiler will produce the same
output to standard-complying code in 200 years as it does today.

As for publishing algorithms in terms of source code, this is
a big problem. In my experience, this is one of *the* hurdles
of teaching and learning algorithms. First of all - what langage
to choose? One can make a case for either choise, and one will
get fierce opposition no matter. In my field of work there has
been a tradition to publish fortran code. Now, decoding fortran
code of 40 or 50 years ago takes about as long as it would take
to derive the algorithms from scratch. The programs were designed
under different constraints than today, and the programming
style was different. Not to mention the practical impact of
implicit data typing and maximum 6 character variable names.

Which brings me to the conclusion: The published literature
should contain algorithm pseudo code. Not matlab, fortran
or any other source code.

In an ideal world, the programmer takes the article, gets
'under the hood' of the pseudo code and implements it in
the language of his own choise. Of course, this world is far
from ideal, so it is far from likely that this state of
affairs will ever materialize.

Rune

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com