Using scripting languages for KDE4 main modules

Richard Moore richmoore44 at
Mon Oct 9 21:23:19 BST 2006

On 10/9/06, Leo Savernik <l.savernik at> wrote:
> The real memory hog is the representation of the abstract syntax tree and all
> accompanying management objects. For *every* statement, *every* variable,
> *every* call, and *every* reference you need a dedicated object in memory
> *which cannot be shared* (to the contrary of the native script interpreter's
> machine code which, as an .so, *is* shared).

Actually, you don't need to keep around a full AST. You only need to
keep around those parts of the tree that can be referenced by the
language in question. For example in js functions, properties, objects
etc. can be referenced, but arbitrary parts of an expression cannot
be. There is also the matter of the scoping rules which you are
completely ignoring. This is the same in most scripting languages -
basically what you've said isn't true about most script interpreters,
and it isn't true about kjs (hardly the most advanced interpreter in
the world).


More information about the kde-core-devel mailing list