From kde-core-devel Mon Oct 09 20:23:19 2006 From: "Richard Moore" Date: Mon, 09 Oct 2006 20:23:19 +0000 To: kde-core-devel Subject: Re: Using scripting languages for KDE4 main modules Message-Id: <5491a5150610091323l58e9cbdh85bc50f9ccd771bb () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=116042541509548 On 10/9/06, Leo Savernik 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). Rich.