Introspection is useful in order to do "funny" things such as TopLevel
console. It also have a lot of cases where you want to "bind" some data
to a database, or generate polymorphicaly XML from any value.... In
general, everytime you want to interact with the outside dynamicly typed
world.
The problem is, the introspection data is never enough for
any particular application ;(
As you point out below, the NekoML compiler forgets the
NekoML data type -- and the ML user isn't really interested
in introspection on the Neko data type.
What I think will be interesting to look at is how to
build *user defined* introspection data. This can be done now,
for any system, by writing all by hand: make your own
keyed data tables, and glue the key to them into the data.
The question becomes, how can the compiler support this,
and reduce the difficulty of the task? And, at the same
time, make it less expensive in performance, whilst also
providing some assurance you haven't missed any cases.
Well Neko doesn't provide a compiler but a language. I think that the
different data structures available are enough to express any type
structure. For exemple while we're not interested in runtime NekoML type
info we still want to be able to print any value with it's tagged
constructors so there is actually a field in the NekoML data that is
used to store a printer. This field could be extended in order to store
any useful informations such as a NekoML data structure representing the
type itself. One other way is to have a "gettype" operation in NekoML
that build the type only when requested, but it cannot be polymorphic
since we need to generate this from a fully known type.
Nicolas
---
Neko : One VM to run them all