Dan Sugalski wrote:
Here's the scoop:
Metadata for classes is simple. In PIR/assembly, they're noted with .things:
.class Foo .is bar .is baz .does some_thing .member x .member y .member z .ssalc
Will there be a way to specify which methods belong to the class in the metadata? Or will Method namespaces just have to match class names so that a lookup can be done?
I was planning a .method directive. I like the feel of separate .field and .method
directives. I like supporting 2 variations like C++, however this is only
an intermediate language so it really doesn't matter.
.class Foo .method InlineMeth (code) .endmeth .method NotInline ... .endclass
.method Foo.NotInLine (code) .endmethod
Using out of line definitions with inline declarations means the compiler can be single pass and simpler, however most decent compilers will do a separate semantic pass so forward declarations are easy.
On the other hand, inline method definitions makes code emitting a little simpler.
I see no real big technical problem with supporting both syntax, I think it is more proof-of-concept than anything since eventually we will pass an syntax tree form to the compiler instead.
-Melvin