Labels as values and threaded-code interpretation

Alex Rønne Petersen alex at lycus.org
Sat Jun 1 19:32:15 PDT 2013


On 01-06-2013 15:17, Diggory wrote:
> On Saturday, 1 June 2013 at 11:50:23 UTC, bearophile wrote:
>> As example the very small but fast virtual machine written in GNU C++
>> from the International Contest on Functional Programming 2006:
>>
>> http://codepad.org/iibBeWKw
>>
>> It's faster than the same code without computed gotos.
>>
>> Bye,
>> bearophile
>
> Would be cool if there was a platform independent way in D to construct
> a sequence of "call" instructions in memory. Then it would be possible
> to write a JIT compiler in the exact same style as that example.

At that point, you just want a simple in-memory assembler. Think asmjit.

>
> It would be relatively easy to add to phobos although you'd have to be
> careful about DEP. Hmm, perhaps I will try writing something like this...

Probably a bit too domain-specific (not to say it isn't useful).

-- 
Alex Rønne Petersen
alex at alexrp.com / alex at lycus.org
http://alexrp.com / http://lycus.org


More information about the Digitalmars-d mailing list