The humble Substack

Richard Gaskin ambassador at fourthworld.com
Mon Nov 18 08:51:46 EST 2013


Cal Horner wrote:

> When a combination mainstack/substack(s) application is compiled into a
> standalone, how much of substack is  converted from an interpreted
> environment into a compiled application?

As Mark noted, a standalone is essentially just a copy of the stackfile 
with the runtime engine embedded into it.  So it's "compiled" only in 
the dictionary sense of the word, as in "combined".

In the Computer Science sense of "compiled", meaning translated to 
native machine instructions executable by the CPU, that happens 
dynamically whenever the message path is changed.

So as Mark noted, when opening a stack the engine unpacks the object 
structures and sets up the message path, and at that point the scripts 
are tokenized into a compact bytecode format for easy translation by the 
engine to the native machine-code instructions as the script is run.

But this tokenization, or first-pass compilation, also occurs when 
setting the script property of an object, or using any of the 
fully-dynamically-compiled expressions like do, call, send, or dispatch.

In this regard I like to think of LC as being more akin to a virtual 
machine than a common app, very much like Dalvik or Java in the way it 
maintains platform-independence of the code until runtime.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys




More information about the Use-livecode mailing list