[EMAIL PROTECTED] wrote:

The subject says it all.

As parrot is designed to be targetted by many langauges, how will it handle 'eval' opcodes for those different languages?

Shell out to a seperate process?


As far as Perl6 (which will be written in Perl6) goes, an easy solution is to design the compiler so that compilition to imcc can be done with a generalized function call, and then link in the perl6 compiler as a module. Eval can then just be a simple wrapper around that, something like:

.pcc_sub _eval non_prototyped

   .param String code_to_eval
   .param PerlHash options

   .pcc_begin prototyped
   .arg code_to_eval
   .arg options
   .pcc_call _compile_perl6_code
   .local string IMCC
   .result IMCC
   .pcc_end

   .local Sub _current_eval
   .local PerlUndef result
   compile _current_eval, "IMCC", IMCC
   invokecc _current_eval
   restore result

  .pcc_begin_return
  .return result
  .pcc_end_return

.end


Something similar could be done with a C-based compiler and NCI.


- Joe

Reply via email to