Leopold Toetsch wrote:

We have basically the problem that classes are only constructed at runtime, which has 2 negative impacts: associating the vtable info with the class needs some helper storage like the props and namespaces can only be vaguely attached to the correct class at runtime too.

As a virtual machine for dynamic languages, one of the core requirements is that it has to be able to construct a class completely at runtime. We may add compile-time construction of classes at some point as an optimization, but we'll never eliminate runtime construction. That "vague attachment" is an intentional distinction between namespaces and the classes associated with those namespaces, allowing for runtime association of a class with a namespace (even an anonymous class).

To get around that the following came to my mind:

- we create a class when needed during compile time
- it get's a flag set (one of private0..7) not_yet_finished_FLAG or such
- newclass, when checking if a class exists, examines that flag and continues adding the runtime information
- the classes constructed in that way are frozen into the PBC

I can see the appeal, but unfortunately it won't give us all the features we need. This is certainly an option to consider if/when we do add compile-time construction of classes, with the understanding that only a subset of cases would be able to use it (as is true of most optimizations).

Allison

Reply via email to