From: Alessio Stalla
Subject: Re: why are Macros special? & Protection of codes.
Date: 
Message-ID: <61b683cb-b3d9-4bec-adbf-a221eb3c5121@d45g2000hsc.googlegroups.com>
On May 21, 8:09 pm, Francogrex <······@grex.org> wrote:
> Hi, I would like to ask two simple questions to you guys who have much
> more expertise in lisp than I do.
> 1) I'm new to Lisp and at work I was explaining that what I find
> beautiful in Lisp (all lisp is beautiful but what I find especially
> beautiful) is the concept of macros that make of lisp a programmable
> programming language. But then some guys from the stats department who
> are SAS addicts (those who don't know how to programm but use only
> canned procedures) said: "yeah, that's nothing new or special, you
> have macros in SAS also"... I was annoyed because I knew that somehow
> the concept of macros is SAS (or other real programming languages) is
> quite different from the macros in lisp but couldn't explain really
> how, didn't have enough knowledge of other languages. Can someone tell
> me how macros in Lisp are different?

I don't know about SAS, but usually macro systems for non-Lisp
languages work by simple text substitution (more or less). Lisp macros
work on Lisp data, which incidentally is also used to represent Lisp
code. You write Lisp code in text form only because text is the
preferred way for humans to read and write code, but code in Lisp is
really made up of Lisp data (mainly symbols and cons cells). Of course
for a non-programmer this makes little sense and will probably only
make Lisp macros look more complicated. But this is really a
fundamental difference - as a (silly) example think about how's
different to do arithmetic with numbers compared with doing arithmetic
with strings representing numbers!

> 2) I have written programs in Lisp that I would want collegues to use
> them, but I don't want them to alter the source codes (actually my
> boss asked me to do that, not that he or I are against open source
> codes, not at all, but for regulatory reasons we are afraid that some
> "smarties" might start modifying and misusing the codes (those are
> stat procedures). So I was thinking that my options are either compile
> in bytecode or compile in C code or actually make executables by using
> something like Clicc or ECL. Can anyone advise me on the best way to
> (at least temporarily) protect those codes? is compiled C code more
> difficult to decipher and mess with than the compiled bytecode? Does
> anyone have experience in making executable? Thanks

I think you're facing the problem the wrong way. Ask yourself: how can
users run modified code? If your users have access to the Lisp REPL,
there's little you can do, whether the code is compiled or not,
"smarties" can redefine pretty much anything they want. If they
haven't access to the REPL, they probably can't run code, and you are
safe :) in either case, compilation has little to do with the problem.
Compilation is "only" an optimization. (ok, it's true that modifying
compiled code isn't the best way of writing software :), but if you're
determined, you can cause damage even if you only have compiled code,
provided you can modify and run it!)

hth,
Alessio Stalla