As I understand it, DWScript
does not compile scripts into an intermediary bytecode.
However, I would like to be able to store a "compiled" script, to be able to send it through a stream or save it to a file.
I was wondering: Is there a way to serialize a TdwsProgram
object?
I didn't manage to find any answer anywhere. I have looked over the code and it doesn't seem to be possible, but I thought I should ask the question anyway...
As far as I remember, it is not implemented nor wanted by its actual maintainer (since the execution AST is a tree of objects).
See this reference article about Why no bytecode format.
The easiest would be to first stream the source code, then compile it again.
DWS compilation is very fast, faster than Delphi, and Eric tries to always improve it, even if new features are added.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With