• Advertisement

Archived

This topic is now archived and is closed to further replies.

Virtual machine for scripting

This topic is 5365 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m creating a scripting language to control virtual robots. It will be compiled for a virtual machine, and at the moment I have a prototype, a stack machine: It has one stack, one array for variables (only static allocation), one array for instructions(and literal values) and a program counter. I''m wondering if a register based approach would be more efficient, do any of you have any experience with that? *** For Java games and Java related resources, go to http://www.javaengines.dk ***

Share this post


Link to post
Share on other sites
Advertisement
I wrote a C Compiler/VM with a stack, variable array and instruction linked list. Worked great.

I wouldn't try using registers... what's the point if it's a virtual machine? Plus you've gotta write the compiler to decide when to load registers/etc. I just loaded onto the stack with mine.


Right now I'm using the built-in C# compiler with the .NET framework as a "scripting" language (really it's just runtime compilable pluggable source)... it actually compiles just like normal (but without optimizations).

[edited by - Nypyren on May 11, 2003 11:47:11 PM]

Share this post


Link to post
Share on other sites

  • Advertisement