Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stalin warnings...

0 views
Skip to first unread message

phi5...@yahoo.ca

unread,
Mar 11, 2008, 10:22:56 PM3/11/08
to
As I said often enough in this group, Stalin is very friendly in the
sense that it issues error messages or warnings at compile time, not
when it is running in the machine of the teaching assistant who is
reviewing your assignments. Its static analysis is really a great
productivity tool. However, Stalin sometimes exaggerates in issuing
warnings. For instance, what can go wrong with the following code?

(display `(,(* 4 10) 30))

Stalin issues a quite long list of cryptic warnings when fed with the
above line! Another example:

(display (read))

The list of warnings is even longer. Is there a way to compile
programs like these, without warnings? Of course, I want the compiler
to generate safe code; therefore I do not want to compile with the -Ot
option:

stalin -On -Ot teste.sc

This suppresses the warnings, but it also suppresses dynamic type
checking, if I understood the manual. In any case, I think that the
compiler should accept programs like the ones given as examples
without reporting an error, or issuing a warning. It would be even
better if it had a safe way to read primitive types, like integers. It
should detect that a piece of code like this:

(let ((x (read))
(when (integer? x) (display (+ x 2))))

has no way to go astray. A solution like ML/Clean/Haskell Maybe-
exceptions would be great. A soft solution would be fine too. By soft
solution, I mean that the compiler --- that seems to be so smart ---
could try to discover when a piece of code is bullet proof; if it
fails, it could issue a warning, like Clean does. However, It should
be able to discover that

(let ((x (read)))
(when (integer? x) (display (+ x 2))))

is bullet proof; at least I think it is. Perhaps the problem is
undecidable, but what is the function of Artificial Intelligence other
than solving undecidable problems? smile :-)

0 new messages