[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bytecode unification for scripting (and other!) languages

> I don't believe that scripting languages should not be typed.  I just
> don't think their programs should be typed *in totality*.  There needs
> to be a useful way of saying "this stuff I know is of this type (and
> tell me if I'm wrong) whereas for that stuff I have no idea of its
> type".  In particular, this requires a simple yet powerful way of
> typing the myriad of data streams -- whether from files or from
> network sockets -- that scripts must process.  (If you think about it,
> that type information is implicitly there in your program -- it's in
> the regexps that you write!)  I had a PhD student working on this
> using a kind of dependent constraint analysis, but he's taken a leave
> of absence, so the project is on the back-burner awaiting someone to
> resume it.
> Hope that helps.
> Shriram

Well, if you can do that I'll be the first to use it :-)  I agree with just
about everything you said.  The problem with type systems are,

-- they require too much typing (pun intended) i.e. they're too verbose
   (witness Java with "Foo a = new Foo();"
-- they tend to be inflexible

I've been doing some programming with ocaml lately, and I've been pleased
at the way type inferencing and the enriched ML type system attacks both of
these problems, even though I prefer scheme syntax.  Another big win is
typed modules.  What you're describing above is more reminiscent of common
lisp or Curl, but still appealing.  

Also, I think the opposition to explicitly-declared types is a bit
overblown.  Personally, I like to declare types at the point of definition
of a function, but leave it to a type-inferencer to handle stuff inside the
function.  I've wasted far more time trying to track down type errors than
I've ever spent declaring types.  I realize this is a religious issue for
many people, however.