Jump to content
  • Advertisement
Sign in to follow this  
_orm_

Retrieving Bytecode From Script Section In Module

This topic is 2636 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 had already brought this up in another thread, but I thought I would make a thread for the idea on its own. We can already retrieve bytecode from script modules easy enough, but some engine designs, such as mine, require that all script be in one single module. However, the problem with this is that when it comes time to deploy, one typically wants to distribute the scripts in bytecode form, not in source form. To do this with single modules would require the distribution of redundant bytecode. My proposal is to alloy the saving of bytecode from not only entire modules, but from individual sections of these modules. In this way, if one had a bytecode file for each source file, the game's bytecode could be put back together at runtime like the C linker links together object code at compile time.

Share this post


Link to post
Share on other sites
Advertisement
I've been thinking about this suggestion since the first time you mentioned it.

In order to implement this, it would be necessary to implement forward declaration for functions and classes too, so a script section can include the definition of all the external functions/classes it will work with for later linking.

It might be interesting too to allow the script engine to load the partial bytecode into a module just as an ordinary script section, except that is already in binary form. This might actually make it easier to provide platform independent bytecode.

Share this post


Link to post
Share on other sites
Instead of forward declarations, why not let the application handle inter-bytecode dependencies? I myself already have a stream class that can easily let me write pre-requisite includes and other necessary metadata at the head of a byte stream.

Share this post


Link to post
Share on other sites
I was thinking more about how the individual sections would be compiled into bytecode in the first place.

It doesn't make much sense to me to compile all sections together in a module, and then separate them into individual sections when saving the bytecode, though I suppose that would be possible too.

Share this post


Link to post
Share on other sites

I was thinking more about how the individual sections would be compiled into bytecode in the first place.


To allow for more fine-grained control over how bytecode gets saved to and loaded from disk? That is the primary reason for why I am requesting this.


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!