Home > Archive > Scheme > March 2008 > Warnings in Stalin
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Warnings in Stalin
|
|
| phi500ac@yahoo.ca 2008-03-11, 7:28 pm |
| As I said often enough in this group, Stalin if very friendly in the
sense that it issues error message or a warning at compile time. Its
static analysis is really a great productivity tool. However, Stalin
sometimes exagerates in its warnings. For instance, what can go wrong
with the following code?
(display `(,(* 4 10) 30))
Stalin issues a quite long list of cryptic warnings! 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 suppress the warnings, but it also suppress dynamic type
checking, if I understood the manual. In any case, I think that if
the compiler accepts programs like the ones given as examples, it will
not be less safe. It would be even better if it had a safe way to read
primitive types, like integers. Something like this:
(let ((x (read)))
(when (integer? x) (display (+ x 2))))
A solution like ML/Clean/Haskell Maybe would be great. A soft solution
would be fine too. By soft solution, I mean the compiler --- that
seems to be so smart --- could try to discover that a piece of code is
bullet proof; if it fails, if could issue a warning, like Clean.
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.
| |
| Jens Axel Soegaard 2008-03-12, 7:38 pm |
| phi500ac@yahoo.ca skrev:
> As I said often enough in this group, Stalin if very friendly in the
> sense that it issues error message or a warning at compile time. Its
> static analysis is really a great productivity tool. However, Stalin
> sometimes exagerates in its warnings. For instance, what can go wrong
> with the following code?
>
> (display `(,(* 4 10) 30))
>
> Stalin issues a quite long list of cryptic warnings!
Can you quote the warnings?
--
Jens Axel Søgaard
| |
| renycury@gmail.com 2008-03-13, 4:35 am |
| On 12 mar, 13:02, Jens Axel Soegaard <inva...@soegaard.net> wrote:
> phi50...@yahoo.ca skrev:
>
>
>
>
> Can you quote the warnings?
>
> --
> Jens Axel S=F8gaard
Hi, Axel.
I will answer your question in lieu of Philip. Here is the output of
the compiler, running under Windows XP/mingw:
D:\stalin-tests>stalin -On test.sc
In loop[1431]
Argument to STRUCTURE-REF might not be a structure of the correct type
In [inside loop 1432]
Argument to STRUCTURE-REF might not be a structure of the correct type
In loop[1431]
Argument to STRUCTURE-REF might not be a structure of the correct type
In [inside loop 1434]
Argument to STRUCTURE-REF might not be a structure of the correct type
In [inside loop 1435]
Argument to STRUCTURE-REF might not be a structure of the correct type
In [inside loop 1436]
Argument to STRUCTURE-REF might not be a structure of the correct type
In [inside loop 1436]
Argument to STRUCTURE-REF might not be a structure of the correct type
Except for the error messages, the compiler behaves well. The
generated code works. By the way, Philip, Junia, Jorlano, Obarbosa,
and other people are writing:
1 --- A tutorial for Stalin. I mean, a better tutorial, since the one
written by Martin Rodgers seems to contain only the index
(literally).
2 --- We are also writing a GUI for the beast (smile :-). Our GUI has
3D resources, etc. etc. It is based on a paper by Merten Joost and Udo
Backhaus. Jorlano, however, improved a lot on the original Bigloo
version; for instance, it added a 3D canvas.
3 --- Finally, we are solving a lot of assignments, exercises, and
homeworks using Stalin. For instance, Junia is using Stalin to write
her honors in Numerical Analysis. She is supposed to solve a partial
differencial equation, and plot the results. Of course, Jorlano/Joost/
Backhaus' gui will be quite handy for the task.
Check the address code.google.com/p/stalingui for news from our
project. For the time being, you will find stalin binaries for
Windows, the 15 initial pages of the tutorial, and a few commands for
the gui. BTW, we are distributing everything as binary files, ready to
deploy. To run Stalin under Windows, all you need to do is to
download MinGW, download stalin binaries for MinGW, set the path, and
start compiling. We intend to explain how to install Stalin for
Windows step by step. In Linux, somebody else created a very good
binary distribution (two button clicks on the Synaptic Package Manager
separate you from having Stalin on Ubuntu or Linspire), thus we did
not bother about a Linux binary distrib.
You are most welcome, if you want to participate. Send an email to
Junia, and she will put your name in the list of the project owners.
|
|
|
|
|