Menu

Stack based interpreter

2018-11-14
2019-03-23
  • Alexandre Bencz

    Alexandre Bencz - 2018-11-14

    I have noticed that the interpreter system you have implemented is stack based, have you ever thought about creating a new backend to generate MSIL code (to work in .NET)?
    I ask this, because if your p-code is stack-based, porting to generate MSIL code should not be too complicated, because the MSIL code is also stack-based

    https://www.codeproject.com/Articles/1151739/DotNetPeLib-A-library-to-read-and-generate-Net-ass

     
  • Gautier de Montmollin

    Sorry for the late answer, I did not get a notification...
    Indeed it is purely stack based. I have to say modestly that I did not implement anything myself: HAC is a translation of SmallAda (written in Pascal) which is an adaptation of Copascal which is an extension of Pascal-S written by Pr. Wirth himself. So I am discovering slowly how it works, but clearly another target than p-code would be nice. As I see it an abstracted code emitter could emit, beside p-code, MSIL (not my priority) but "real" machine code.

     

Log in to post a comment.