I now have lexical and dynamic scopes fully implemented in my runtime support, and I know how I will be using them once I have code generation completed. Package scope seems like it shouldn’t be to difficult to figure out, now that I have lexical’s working. (more…)
Archive for April, 2010
Runtime Support for nq-nqp
Monday, April 5th, 2010So, I have a fairly complete parser and AST for my compiler. I think its an appropriate time to start looking at runtime support and how some of the runtime properties of the language will work.
Here is a rough diagram of the relation between objects instances, their containers, and their lexical values:

For garbage collection for now I am simply going to use Boehm GC [1], it should do for now, till I can look into GC a bit more.
The meta model seems pretty solid, granted its from the perl 6 spec. The current nqp-rx doesn’t have its own meta model. It uses parrot’s meta model directly. So, this has lead me to an issue, since I can’t be consistant with nqp, since I don’t want to implement all of parrot. So, instead I am going to steal the MOP (Meta Object Protocol) from perl 6.
Dispatch is going to be interesting. I’d like to implement multi-dispatch, but maybe not just yet. I have been thinking about it, for now I will probably start with single dispatch, and build up to multi-dispatch later.
Here is a sequence diagram of how I think I could accomplish multi-dispatch, sorta. I still need to flush out some of my ideas for how to do this right.
Foot Notes:
1# http://www.hpl.hp.com/personal/Hans_Boehm/gc/
