Hi all!
I propose the following because the current IMCC reimplementation seems to
make no progress.
## first part ##
Create a (bytecode) class "PIR" that can be used (by compilers written in
bytecode) as an standardized interface to IMCC.
A first implementation of that class can just create a textfile that will be
compiled to bytecode using the current IMCC.
Such a PIR class will be usable with no extra work on IMCC.
An improved version could use the "dlopen the running parrot"-trick to access
parrot's IMCC functions directly without having to create a source file.
## second part ##
Write a PIR lexer/parser in a language targeting parrot (in PIR code, or maybe
better using my EBNF parser). This parser should use the PIR class to emit
the underlying code.
## third part ##
Write an PIR to PASM translator in bytecode. Maybe it is even possible to emit
bytecode directly.
## fourth part ##
Chain the PIR lexer/parser and the bytecode generator together.
A possible usage scenario of the PIR class:
find_type I0, "PIR"
new PIR, I0
# .sub _main
sub = PIR."sub"( "_main" )
# .local string test
var = sub."local"( "string", "test" )
# set test, "hello, "
sub."set"( var, "hello, " )
# print test
sub."print"( var )
# print "world!\n"
sub."print"( "world!\n" )
# end
sub."end"()
# the ".end" will be emitted automatically
# save the program as hello.imc
PIR."saveAs"( "hello.imc" )
I'am willing to implement the PIR class and the PIR parser, but I do not have
any clue how much work the rest is.
(I already started to implement the PIR class because I it for the EBNF
parser...)
Comments welcome!
jens