Retrieving Bytecode From Script Section In Module
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.
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.
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.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
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.
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.
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.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement