Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] OCaml related article
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] OCaml related article
> 	His conclusion though is that it is practically impossible
> 	to introduce any kind of static typing to Perl.

Dominus' claim is that if it could be done, it would still be largely
useless: since Perl has so many context-dependent automatic coercions,
nearly all programs would be correct, and the type system wouldn't
help much finding programming errors.

Actually, I believe one could do a soft typing system for Perl along
the lines of Mr. Spidey for Scheme
(http://www.cs.rice.edu/CS/PLT/packages/mrspidey/), using
constraint-based flow analysis.  Of course, uses of "eval" would not
be checked at all.  But Dominus' point that it would be largely
useless is probably true.

>       Contrast it
> 	with http://www.cc.gatech.edu/~lex/ti/ti.html
> 	where Lex Spoon attempts to deliver a type inference engine to
> 	Smalltalk (sic!).

Why not?  Constraint-based flow analysis can be applied to Smalltalk
(at least without the reflection features -- if you change the
behavior of method invocation, all bets are off), and since Smalltalk
has cleaner, more restrictive dynamic semantics than Perl, it could
actually be useful in finding errors.

- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr