Jump to content
  • Advertisement
Sign in to follow this  
Nightition

Libraries with a scripting language?

This topic is 4201 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

Hi, I'm currently designing a scripting language, mostly for learning purposes, which will run under a virtual machine. Now, there is one thing I don't know how to solve - standard library (and other libraries, for that matter). I could implement various functions as 'keywords', that is, make the vm aware of them, and probably provide direct assembler instructions for each of them(since it's a custom-made assembler, used only by vm). But that doesn't really provide much flexibility - each time I want to add a function to the language, I need to change the asm and vm, and the language keyword list grows unacceptably large... Is there a standard way of doing this? Perhaps providing some mechanism of connecting .dll/.so to to the scripting language, so that new libraries can be written in a 'standard' language, and then simply imported to the script? Or can this be done in a simpler way? Thanks, -Ivan

Share this post


Link to post
Share on other sites
Advertisement
I think VM modification is not that bad. If you will provide VM sources, as well as tool for generating this additional code out of some kind of formal description, this will be ok for most of usages.

I'm going to use this approach in my VM.

If you want the possibility to add libraries(DLL) without recompilation of VM, you will be stick with perticular compiller(for VM) and particular OS (windows). Also, you will have some headache while passing parameters of different type, getting return value. There will be a danger of stack corruption (if you pass something wrong).

Share this post


Link to post
Share on other sites
I guessed it won't be that easy to implement the system
with dlls, but I thought it would be better than having
a monstrous scripting system with hundreds or thousands
of functions... It's possible (albeit not easy in the
second case) to achieve portability across platforms.

Thanks for suggestions!

Regards,
-Ivan

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!