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

RE: Macros and little languages



> > It's easy to imagine systems with a stable, well-tested core that's
fully
> > typed, with newer auxiliary modules under development that aren't fully
> > typed.
>
> Actually, it isn't so easy to imagine this.  Your imagination's
> picture is probably of a world with Pascal or Fortran libraries.  We
> live in a higher-order world, whether we use ML, Python or Java.
> Think callbacks.

I managed to banish Pascal and Fortran libraries from even my most fevered
imaginings, sometime in the early '80s... ;)

Could you expand a bit on what you're saying?  Is it simply that providing
an untyped function as an argument to a typed function means that the typed
function can no longer be guaranteed to be typesafe?

I've done something close to this, most commonly in scripting environments
under the JVM: JScheme, Jython, Javascript and Beanshell are examples which
support a pretty decent interaction between statically typed Java and either
dynamically typed script code, or in the case of Beanshell, code with
optional dynamically-checked type declarations.  Callbacks are supported in
at least a few of these environments, but naturally if you provide an
invalid callback object, you'll get an exception when it's invoked.

This seems like an acceptable tradeoff for the flexibility it gives.  All
I'm saying is that a single language which supports this kind of mixing
would be useful, even though it would have limitations.  I've done
prototyping like this, and I find it works well.

Am I missing something?

Anton
P.S. ...aside from a copy of MrFlow?
P.P.S. Note I said easy to imagine, not easy to implement.  The latter is
mostly Matthew's job, as I understand it... :P