A method implemented at least in part by a computer, the method comprising: receiving a package that includes source code of software to install on a target device, wherein the source code includes scripting code of a scripting language for a web page; installing the package on the target device; receiving a request to execute the software of the package; in response to the request, determining whether second code has already been generated from the source code and stored in nonvolatile storage, wherein the second code is bytecode or some other intermediate code or executable code generated from the source code by compiling the source code; if the second code has already been generated prior to receiving the request, performing a first set of actions, comprising: executing the second code or code derived therefrom; and if the second code has not already been generated prior to receiving the request, performing a second set of actions, comprising: compiling (525; 625) the source code into the second code, executing the second code or code derived therefrom, and persisting (530; 635) the second code in nonvolatile memory as a file for use in subsequent execution of the software, wherein the second code is electronically signed so that any modifications to the file are detectable and wherein if the compiled code was modified after being generated, re-compiling the source code for use in subsequent execution. receiving a package that includes source code of software to install on a target device, wherein the source code includes scripting code of a scripting language for a web page; installing the package on the target device; receiving a request to execute the software of the package; in response to the request, determining whether second code has already been generated from the source code and stored in nonvolatile storage, wherein the second code is bytecode or some other intermediate code or executable code generated from the source code by compiling the source code; if the second code has already been generated prior to receiving the request, performing a first set of actions, comprising: executing the second code or code derived therefrom; and if the second code has not already been generated prior to receiving the request, performing a second set of actions, comprising: compiling (525; 625) the source code into the second code, executing the second code or code derived therefrom, and persisting (530; 635) the second code in nonvolatile memory as a file for use in subsequent execution of the software, wherein the second code is electronically signed so that any modifications to the file are detectable and wherein if the compiled code was modified after being generated, re-compiling the source code for use in subsequent execution. compiling (525; 625) the source code into the second code, executing the second code or code derived therefrom, and persisting (530; 635) the second code in nonvolatile memory as a file for use in subsequent execution of the software, wherein the second code is electronically signed so that any modifications to the file are detectable and wherein if the compiled code was modified after being generated, re-compiling the source code for use in subsequent execution.