Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Mata vs C

From   Kit Baum <BAUM@BC.EDU>
Subject   st: Mata vs C
Date   Wed, 17 Aug 2005 10:19:47 -0400

James said

Just on plugins and Mata and such, Mata also has one major advantage
over C. Compiling via Stata means that the source code can be
practically distributed rather that the binary code, which means not
only cross-platform stability, but security through transparency (not
that everybody will read the code, but just because they can).

Actually there are some additional advantages of Mata. One can distribute an .mo file (or a .mlib library file) which although binary is interpretable on all platforms, like a binary .dta file. As Bill Gould said on this list last week, if you had > 2000 lines of Mata code, you probably would not want it in-line in an ado-file. If you have a routine (such as a 3-D graphics package--anyone interested in porting one of those?!?) that is composed of many, many Mata functions, you probably want to distribute an .mlib. That does not prevent you from transparently distributing the source code as well, but it would not need to be compiled on the fly as in-line code would.

Another advantage---which goes rather against the open-source spirit of Statalist and SSC---is that Mata (like C) makes it *possible* to distribute binary-only code for a routine. That makes it feasible for someone to sell that code. (Indeed, that is the case for StataCorp- authored commands like xtmixed). Personally I hope that practice will not be widespread among the user community, but if someone had put immense effort into developing something, they might not want to give it away (e.g., James Davidson's TSMOD package, which recently went from free to a modest charge; the flip side, of course, is that if you pay for it you are paying for support).

Kit Baum, Boston College Economics

* For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index