Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serializing a TdwsProgram

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...

like image 431
FHannes Avatar asked Jun 19 '12 15:06

FHannes


1 Answers

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.

like image 55
Arnaud Bouchez Avatar answered Oct 21 '22 21:10

Arnaud Bouchez