Dan Sugalski wrote:
At 8:27 PM +0000 1/14/03, Leopold Toetsch (via RT) wrote:
Yow, Cool! We *have* to get IMCC built into parrot now.
You do get this wrong - always ;-)
imcc = parrot + assemble.pl - pre-processor + PIR-assembler +
optimizer/10 #yet & now & already
With the help of assemble.pl -E (preprocess only, spitting out PASM) imcc runs *all* parrot tests.
- Should the B<compreg> opcode also have a form with a label to build PASM compilers, ook?
I think you've confused me here. (No, I'm wrong--you've definitely confused me here) More explanation?
I was thinking of assembler/compilers implemented in PASM, as languages/ook/ook.pasm is a "ook" compiler. It could register a compreg with type "Ook", which uses the registered "PASM" compiler to run ook code ;-)
- is using the NCI interface ok for evals purpose?
Sure. We can rejig it later if we need to, but I expect most compilers will involve a trip into C code, so that's fine.
Ok, then this needs some twigging. I did use signature 'I' for pushing a Parrot_Interp. The return value needs still work.
- how should a byte code segment (PMC) look like?
Ah, the big question. I'm not quite sure yet--let's try and work that out while I'm churning over objects.
I did have a closer look at struct PackFile. I think we have some possiblities to actually eval()/invoke() the code, depending on the HL:
- new interpreter, nothing shared (unlikely)
- new interpreter, context shared - meaning also constants
- same interpreter, everything shared
So it seems, that for multiple code segments, we'll have to take the PackFile_ConstTable out of the structure and include file/line/debug/whatever information. This would look like:
packfile aka interpreter->code:
- constants
- code_segment[]
- byte_code
- byte_code_size
- [ more of current packfile ]
- filename
- lines[]
- [ more aditional stuff ]
- prederefed_code
- jit_info (jitted code)
- fixups
The return value of B<compile> would then be a pointer to such a code_segment.
BTW a PackFile_Constant should be a union IMHO, currently each type has its own storage.
leo