languages (was: a compiler for perl)

Francois-Rene Rideau fare@tunes.org
Thu, 25 May 2000 01:22:42 +0200


>: Jecel
>>: Fare

>   label
>         "Answer the string that appears in the receiver's label."
>         labelText isNil
>                 ifTrue: [^ 'Untitled' copy]
>                 ifFalse: [^ labelText asString]
> 
> If you eliminate the "copy" and then edit the label of a newly created
> window, you might have a nasty surprise the next time you create
> another window...

That's a problem with literal strings being mutable by default,
which I think is a bad choice for any high-level language,
especially since converting from immutable to mutable is quick and safe,
while the other way round is unsafe. Lower-level languages from time when
memory was scarce (and/or targetted to small embedded platforms) may want
to avoid any copying for space-efficiency reasons, but even these reasons
are moot on today's generic architecture with lots of RAM and COW MMU).


> http://www.merlintec.com/pegasus2000/e_neologo.html
Interesting.

>>> Just "grep eval source.lisp" and if the result is empty you know you
>>> won't have to include the interpreter ;-)
>> (funcall (symbol-function (intern (concatenate 'string "EVA" "L")))
>>      '(wreak-havoc))
> Ok. In practice, though, I don't think this kind of code would ever be
> used except to prove that my rule is wrong in theory....

Your rule is wrong in both theory and practice.
Even if it works in many simple cases,
that's precisely what differentiates an ugly hack from a nice design.
What if the program has interactive features, that may invoke EVAL ?
What if the programmer would have specifically liked to disable EVAL ?
What if EVAL is actually called through COMPILE ? Etc.

LISP's lack of expressiveness in negative assertions and module interfaces
is a cruel misdesign. It's precisely what limits its ability
to be used as a framework for many people to develop modules
that interact nicely, by requiring a lot of manual, non-automatable
communication and synchronization between programmers
(ultimately, centralized control).

[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
[  TUNES project for a Free Reflective Computing System  | http://tunes.org  ]
Every program has at least one bug and can be shortened by at least one
instruction -- from which, by induction, one can deduce that every
program can be reduced to one instruction which doesn't work.