LNS Home
Script Debugger
Download & Buy
x Explore
x Edit
x Run & Debug
x Deploy
What's New In 4.5
bullet Documentation
bullet Blog Posts
My SD Story
Software Updates
 
4.0.9 Update
3.0.9 Update
bullet 2.0.5 Update
x Free Downloads
 
XML Tools
XSLT Tools
x Property List Tools
x List & Record Tools
Register Your Copy of Script Debugger
Join the Script Debugger Mailing List
x AppleScript/ Scripting Links
Products
x Script Debugger 4.5
Site Contents
bullet Mark’s Blog
Product Registration
Bug Reporting
x Freeware
Contacting Us

SD4 Headling


image

Glossary: Bytecode

image

AppleScript code is compiled into bytecode, meaning that, roughly speaking, the nouns and verbs of the original text are translated into a sort of compressed, coded equivalent, called tokens. These tokens are meaningful to the AppleScript runtime engine (and illegible to everyone else). The runtime engine interprets the bytecode, parsing whatever tokens it meets along its path of execution, accumulating them into chunks, and translating these chunks further, as necessary, in order to execute them.

The implication for you, the AppleScript programmer, is that in its compiled form, a script is illegible. So why are you able to read a compiled script file? It’s because AppleScript decompiles the bytecode, translating the tokens back into their English-like form. If the script targets an application, this decompilation requires the application’s dictionary. This is one reason why things can go wrong when you attempt to open a compiled script. (Script Debugger may be able to help in such a situation by letting you open the script as text.)

Actually, a compiled script file contains not only bytecode but also some further information (such as variable names) needed to decompile the tokens. In a run-only script, this further information is not present, which is why the script cannot be decompiled (and therefore cannot be read by a human being).



Explore | Edit | Run & Debug | Deploy | What's New In 4.5 | My SD Story


Copyright © 1998-2009 Late Night Software Ltd. - All Rights Reserved.