From: Frank K on
On Jul 10, 4:00 am, Roman <rschm...(a)gmail.com> wrote:
> Dear group members,
> I have written a package (as a *.m) file and wish to publish it
> without giving everybody access to the source code. Is there a way to
> do this? I have tried using DumpSave, which goes part of the way by
> removing the comments from the source code. But I'd prefer total code
> obfuscation or compilation.
> Thanks!
> Roman

Take a look at the function Encode in the documentation.

From: Albert Retey on
Hi,

> I have written a package (as a *.m) file and wish to publish it
> without giving everybody access to the source code. Is there a way to
> do this? I have tried using DumpSave, which goes part of the way by
> removing the comments from the source code. But I'd prefer total code
> obfuscation or compilation.

Using DumpSave will only let users with the same operating system /
architecture load the package. I think the recommended way to do what
you want is to use Encode together with the attributes Protected,
ReadProtected, Locked for your symbols.

You should still be warned that an experienced user will probably be
able to uncover your code with some effort. And of course WRI will be
able to decode the encoded package. Note that this is no restriction of
Mathematica, it has been argued that for whatever way you deliver code
written in whatever language, it is always possible to uncover it for
experienced hackers with time and effort to spend: After all, the
processor needs to have ways to uncover what it is supposed to do...

hth,

albert

From: Roman on
Thanks to all! Indeed a combination of Locked, ReadProtected, and
Encode do the job.
Now the question is: as I work in academic scientific research, would
I get more bug reports and patch suggestions if I published my package
under the GPL instead of encoded?
Thanks for any advice you have on this topic!
Roman.

From: Bill Rowe on
On 7/12/10 at 7:21 AM, rschmied(a)gmail.com (Roman) wrote:

>Thanks to all! Indeed a combination of Locked, ReadProtected, and
>Encode do the job. Now the question is: as I work in academic
>scientific research, would I get more bug reports and patch
>suggestions if I published my package under the GPL instead of
>encoded?

My guess is the rate at which you get bug reports isn't very
dependent on whether the package is published under GPL or
encoded. I would think it would depend more on how easy it is to
submit bug reports and whether your users expect to benefit from
submitting bug reports.


From: magma on
On Jul 12, 1:21 pm, Roman <rschm...(a)gmail.com> wrote:
> Thanks to all! Indeed a combination of Locked, ReadProtected, and
> Encode do the job.
> Now the question is: as I work in academic scientific research, would
> I get more bug reports and patch suggestions if I published my package
> under the GPL instead of encoded?
> Thanks for any advice you have on this topic!
> Roman.

Almost certainly! If your users can read your code they can:
1- make suggestions for improvement of your code or for new features
2- learn from you how to program in Mathematica and/or how to do something in
your specific field/application
3- be inspired by your code and develop it further without you making
much extra effort.

By the way, what is your package all about?