Re the OP I'm not going to venture any opinion about myself ;); but
there's some interesting points in the thread.
> I'm somewhat unsure about Shen's ability to turn type checking off.
Yes; people who are devoted to static typing don't like this.
But ....
...what often happens when a programmer tries working in a statically
typed language is this: he finds that he can type check (in principle)
about 95% of all his code. What remains is a recalcitrant 5% that is
very difficult to check (e.g something involving 'eval' or FFI for
instance). After struggling and getting bogged down, he then throws
his hand in and then does *all* the work in an untyped Blub whereby
all type security is lost. After that he migrates to a comp.lang.blub
and tells everybody that statically typed languages like ML/Haskell
etc. are a PITA.
Getting fundamentalist about type checking works only if the
programmer is not free to explore other languages. Fundamentalism
polarises independent minds where everything good that the
fundamentalist is trying to sell is soundly rejected. Many old
arguments about static vs. untyped languages have a religious quality.
It is more sensible to allow the programmer an environment in which he
can type check 95% of his code and smuggle in the 5%, than to insist
on 100% fidelity and lose not only the 5% but the 95% that could have
been checked and alienate the programmer from ever checking his code.
So Shen allows you to do that. In other words .....
> static typing is great as long as I'm still the boss.
Yes; quite, exactly my point. But the resources of Shen are greater
than ML/Haskell (see
http://www.lambdassociates.org/studies/study02.htm
for an example). Here is an example of the kind Kaz is talking about
where normally you might bomb out from static type checking in some
languages. Suppose he writes a Shen program that downloads a file as
a list of units (where a unit is just some unspecified object) and he
wants to return the numbers in the list. He writes
(define find-numbers-in-file
{string --> (list number)}
Filename -> (find-ns (read-file Filename)))
(define find-ns
{(list A) --> (list number)}
[] -> []
[X | Y] -> [X | (find-ns Y)] where (number? X)
[_ | Y] -> (find-ns Y))
where (say) read-file : string --> (list unit). The dialogue goes
like this.
Shen type system: "Sorry, you cannot run this code because it has a
confirmed type error in rule 2 of find-ns."
Kaz: "Thanks, the error is duly noted! Now can you step aside and let
me run it? The run-time check will be there because I'm testing for
numberhood in the guard, so I'm okay. Look you can assume this
(datatype numbers
\* assume that if N has been verified to be a number, then it is a
number *\
_____________________________________
(number? N) : verified >> N : number;)
Runs it again.
Shen type system: "On this assumption your code is type secure."
Regarding the Shen project; work on the kernel is now running in San
Francisco (porting to Javascript), Moscow (to Scheme) and here (in
Leeds UK where the maths library is being built). If you want to
correspond on it then register with qilang. I exist and correspond
largely on that group. You'll be very welcome.
Mark