[racket] Use of map and eval to evaluate symbol in namespace

From: Henry Lenzi (henry.lenzi at gmail.com)
Date: Mon Aug 4 19:43:04 EDT 2014

Hi Neil --
Thanks for the answer.
Let's see...

* Prevents much static checking. ----> not really an issue in this
case (I don't see it).

* Likely increased difficulty debugging ---> true.

* Often executes arbitrary code with privileges, which might be
corrupted due to accident or attack, which can be very bad. --> That's
bad. But see my comment about the environment I'm in. User input
validation helps here.

* Prevents some optimization. ---> not really necessary. Prescriptions
are short, to worry about optimizations here, with today's machines,
doesn't seem a real issue.

* Crutch that prevents learning better idioms. ---> then whatever
happend to symbolic computation? Are we to program like Perl people
do?

It seems there are very good reasons to avoid eval. However, they seem
to apply to larger systems in a different environment.
I'm not out to write a large system for a large hospital service in a
secure setting.
By the way, if you guys had any idea of the buggy stuff people sell to
the health sector. The atrocious VB, MFC C++, Java... I'm not even
goint to mention security..

The use of EVAL does not seem to hamper the creation of a
syntax-validation parser, at a latter time.

Best regards,
Henry Lenzi

On Mon, Aug 4, 2014 at 3:12 AM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> Henry Lenzi wrote at 08/03/2014 11:52 PM:
>
>> What I'm sensing is that you seem to be concerned about bugs with
>> Racket Scheme's EVAL. Is that it?
>> I do not understand what the problem with EVAL is. Would you please
>> state clearly what the problems are?
>
>
> Eval is one of the issues.  Sorry I have to be very brief right now, but a
> few problems with eval in general are:
> * Prevents much static checking.
> * Likely increased difficulty debugging.
> * Often executes arbitrary code with privileges, which might be corrupted
> due to accident or attack, which can be very bad.
> * Prevents some optimization.
> * Crutch that prevents learning better idioms.
>
> Also, things like reading in a code file and looking for markers in it is
> something we sometimes do (especially in, say, Emacs editing mode, in which
> likely oopses are not so grave), but failure-prone.
>
> Also, the code I saw was not idiomatic in, say, how it uses globals.
>
> Anyway, it's good that Racket lets people experiment this way.  The concern
> I have in my mind is that newbies reading language forums often get ideas
> about idiomatic programming from examples they see, and even copy&adapt
> examples they see (maybe even evolving it into production code, or blogging
> it where other newbies pick up on it...).  People should experiment as much
> as they liked, but I think it would be good to if newbies knew when
> something they're looking at is an experiment rather than (yet) considered
> best practice.
>
> I appreciate your participation in the community, and your experimenting.
>
> Neil V.
>

Posted on the users mailing list.