Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Virtual machine for scripting

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Polydone   Members   

453
Like
Likes
Like

Posted 11 May 2003 - 04:32 PM

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 ***

#2 Nypyren   Members   

11850
Like
Likes
Like

Posted 11 May 2003 - 04:45 PM

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]




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.