Jump to content
Sign in to follow this  
  • entries
    557
  • comments
    1237
  • views
    423439

Untitled

Sign in to follow this  
Evil Steve

78 views

Time for a random update to bump my journal [smile]

DruinkScript's VM is coming along nicely. The assembler is complete, but could do with a few more opcodes - I'll add those later on.
DruinkScript's string class is working nicely too, it makes a linked list of char[32] buffers so string operations don't have to screw about with a huge string.
There's a bunch of documented preprocessor #defines in DruinkScript.h that you can define or comment out when building the source code to do several things. At the moment there is:

  • DRUINKSCRIPT_NO_STDIO - Removes the DruinkScript::VM::LoadScriptFromFile() function, meaning the lib doesn't link with any file IO functions. Might save a few K of the exe size I suppose, and might be handy on other platforms.

  • DRUINKSCRIPT_PARANOID - Validate a lot more stuff than usual. For instance, there's 10 registers available. With DRUINKSCRIPT_PARANOID defined, and an opcode involving a register is read, the register number is checked to make sure it's 0..9. If you're compiling all the scripts yourself, and it's unlikely or impossible that the compiled script will become corrupt, you can comment this define out.

  • Another one that I can't remember just now.


And I'll need one to switch to std::string from my own string implementation.

So far I can run about a third of my test script. The mov, mul, div, add, sub and neg instructions are complete, one version for reg<-reg, reg<-int, reg<-float and reg<-string.

Well, end of ramble - back to work.
Sign in to follow this  


2 Comments


Recommended Comments

That's cool. With regards to the DRUINKSCRIPT_PARANOID switch... could you not mark scripts as trusted or not - the first time they are run, they are meticulously checked, but once verified a hash of the code is stored as "trusted" and they no longer need to be checked again? (Or is that just too much effort?)

Share this comment


Link to comment
Quote:
Original post by benryves
That's cool. With regards to the DRUINKSCRIPT_PARANOID switch... could you not mark scripts as trusted or not - the first time they are run, they are meticulously checked, but once verified a hash of the code is stored as "trusted" and they no longer need to be checked again? (Or is that just too much effort?)
I suppose I could, but then what's to stop someone just marking the script as trusted? I intend to release the source code for the whole lot anyway.
If I could manage some crazy authentication system, it'd probably be too much effort for a simple scripting language like this.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!